mirror of
https://github.com/apache/nuttx.git
synced 2026-02-06 04:22:26 +08:00
build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout 2. Fix cmake build break 3. Update all new file license 4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose) ------------------ How to test From within nuttx/. Configure: cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja (or full path in custom board) : cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja This uses ninja generator (install with sudo apt install ninja-build). To build: $ cmake --build build menuconfig: $ cmake --build build -t menuconfig -------------------------- 2. cmake/build: reformat the cmake style by cmake-format https://github.com/cheshirekow/cmake_format $ pip install cmakelang $ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done $ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done Co-authored-by: Matias N <matias@protobits.dev> Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
697
CMakeLists.txt
Normal file
697
CMakeLists.txt
Normal file
File diff suppressed because it is too large
Load Diff
37
arch/CMakeLists.txt
Normal file
37
arch/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
# ##############################################################################
|
||||
# arch/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
# Declare arch library. In contrast to other user/kernel pairs built in KERNEL
|
||||
# mode, on arch/ the "user" portion uses a different set of sources than the
|
||||
# kernel portion. To keep things simple the naming k<lib> is not used. Instead,
|
||||
# the "user" portion is named "arch_interface".
|
||||
|
||||
nuttx_add_kernel_library(arch)
|
||||
target_include_directories(arch PRIVATE ${CMAKE_SOURCE_DIR}/sched)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
nuttx_add_system_library(arch_interface)
|
||||
target_include_directories(arch_interface PRIVATE ${CMAKE_SOURCE_DIR}/sched)
|
||||
endif()
|
||||
|
||||
# TODO: move this higher up ifeq ($(CONFIG_SCHED_INSTRUMENTATION_SYSCALL),y)
|
||||
# EXTRALINKCMDS += @$(TOPDIR)/syscall/syscall_wraps.ldcmd endif
|
||||
|
||||
# include corresponding arch subdirectory
|
||||
add_subdirectory(${CONFIG_ARCH})
|
||||
21
arch/arm/CMakeLists.txt
Normal file
21
arch/arm/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
nuttx_add_subdirectory()
|
||||
33
arch/arm/src/CMakeLists.txt
Normal file
33
arch/arm/src/CMakeLists.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(${ARCH_SUBDIR})
|
||||
add_subdirectory(${NUTTX_CHIP_ABS_DIR} EXCLUDE_FROM_ALL exclude_chip)
|
||||
|
||||
# Include directories (before system ones) as PUBLIC so that it can be exposed
|
||||
# to libboard
|
||||
target_include_directories(arch BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR} common
|
||||
${ARCH_SUBDIR})
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
target_include_directories(arch_interface BEFORE PUBLIC ${NUTTX_CHIP_ABS_DIR}
|
||||
common ${ARCH_SUBDIR})
|
||||
endif()
|
||||
110
arch/arm/src/armv7-a/CMakeLists.txt
Normal file
110
arch/arm/src/armv7-a/CMakeLists.txt
Normal file
@@ -0,0 +1,110 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/armv7-a/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# The vector table is the "head" object, i.e., the one that must forced into the
|
||||
# link in order to draw in all of the other components
|
||||
|
||||
set(SRCS arm_vectortab.S)
|
||||
|
||||
# Common assembly language files
|
||||
|
||||
list(APPEND SRCS arm_cpuhead.S arm_vectoraddrexcptn.S arm_vectors.S
|
||||
arm_saveusercontext.S)
|
||||
|
||||
# Common C source files
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
arm_cache.c
|
||||
arm_cpuinfo.c
|
||||
arm_dataabort.c
|
||||
arm_doirq.c
|
||||
arm_gicv2.c
|
||||
arm_gicv2_dump.c
|
||||
arm_initialstate.c
|
||||
arm_mmu.c
|
||||
arm_prefetchabort.c
|
||||
arm_schedulesigaction.c
|
||||
arm_sigdeliver.c
|
||||
arm_syscall.c
|
||||
arm_tcbinfo.c
|
||||
arm_undefinedinsn.c
|
||||
arm_perf.c
|
||||
cp15_cacheops.c)
|
||||
|
||||
if(CONFIG_ARMV7A_HAVE_PTM)
|
||||
list(APPEND SRCS arm_timer.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV7A_L2CC_PL310)
|
||||
list(APPEND SRCS arm_l2cc_pl310.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_PAGING)
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
arm_allocpage.c
|
||||
arm_checkmapping.c
|
||||
arm_pginitialize.c
|
||||
arm_va2pte.c
|
||||
arm_pghead.S)
|
||||
else()
|
||||
list(APPEND SRCS arm_head.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_ADDRENV)
|
||||
list(APPEND SRCS arm_addrenv.c arm_addrenv_utils.c arm_addrenv_perms.c
|
||||
arm_pgalloc.c)
|
||||
if(CONFIG_ARCH_STACK_DYNAMIC)
|
||||
list(APPEND SRCS arm_addrenv_ustack.c)
|
||||
endif()
|
||||
if(CONFIG_ARCH_KERNEL_STACK)
|
||||
list(APPEND SRCS arm_addrenv_kstack.c)
|
||||
endif()
|
||||
if(CONFIG_ARCH_VMA_MAPPING)
|
||||
list(APPEND SRCS arm_addrenv_shm.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_MM_PGALLOC)
|
||||
list(APPEND SRCS arm_physpgaddr.c)
|
||||
if(CONFIG_ARCH_PGPOOL_MAPPING)
|
||||
list(APPEND SRCS arm_virtpgaddr.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND SRCS arm_fpucmp.c arm_fpuconfig.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SMP)
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
arm_cpuindex.c
|
||||
arm_cpustart.c
|
||||
arm_cpupause.c
|
||||
arm_cpuidlestack.c
|
||||
arm_scu.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
68
arch/arm/src/armv7-m/CMakeLists.txt
Normal file
68
arch/arm/src/armv7-m/CMakeLists.txt
Normal file
@@ -0,0 +1,68 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/armv7-m/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# TODO: do not use config to detect this
|
||||
|
||||
set(SRCS
|
||||
arm_exception.S
|
||||
arm_saveusercontext.S
|
||||
arm_busfault.c
|
||||
arm_cache.c
|
||||
arm_cpuinfo.c
|
||||
arm_doirq.c
|
||||
arm_hardfault.c
|
||||
arm_initialstate.c
|
||||
arm_itm.c
|
||||
arm_memfault.c
|
||||
arm_perf.c
|
||||
arm_schedulesigaction.c
|
||||
arm_sigdeliver.c
|
||||
arm_svcall.c
|
||||
arm_systemreset.c
|
||||
arm_tcbinfo.c
|
||||
arm_trigger_irq.c
|
||||
arm_usagefault.c
|
||||
arm_vectors.c)
|
||||
|
||||
if(CONFIG_ARMV7M_SYSTICK)
|
||||
list(APPEND SRCS arm_systick.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV7M_ITMSYSLOG)
|
||||
list(APPEND SRCS arm_itm_syslog.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV7M_STACKCHECK)
|
||||
list(APPEND SRCS arm_stackcheck.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND SRCS arm_fpuconfig.c arm_fpucmp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_RAMVECTORS)
|
||||
list(APPEND SRCS arm_ramvec_initialize.c arm_ramvec_attach.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARM_MPU OR CONFIG_ARM_MPU_EARLY_RESET)
|
||||
list(APPEND SRCS arm_mpu.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
69
arch/arm/src/armv8-m/CMakeLists.txt
Normal file
69
arch/arm/src/armv8-m/CMakeLists.txt
Normal file
@@ -0,0 +1,69 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/armv8-m/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS
|
||||
arm_exception.S
|
||||
arm_saveusercontext.S
|
||||
arm_busfault.c
|
||||
arm_cache.c
|
||||
arm_cpuinfo.c
|
||||
arm_doirq.c
|
||||
arm_hardfault.c
|
||||
arm_initialstate.c
|
||||
arm_itm.c
|
||||
arm_memfault.c
|
||||
arm_perf.c
|
||||
arm_sau.c
|
||||
arm_schedulesigaction.c
|
||||
arm_securefault.c
|
||||
arm_secure_irq.c
|
||||
arm_sigdeliver.c
|
||||
arm_svcall.c
|
||||
arm_systemreset.c
|
||||
arm_tcbinfo.c
|
||||
arm_trigger_irq.c
|
||||
arm_usagefault.c
|
||||
arm_vectors.c)
|
||||
|
||||
if(CONFIG_ARMV8M_SYSTICK)
|
||||
list(APPEND SRCS arm_systick.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV8M_ITMSYSLOG)
|
||||
list(APPEND SRCS arm_itm_syslog.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV8M_STACKCHECK)
|
||||
list(APPEND SRCS arm_stackcheck.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND SRCS arm_fpuconfig.c arm_fpucmp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_RAMVECTORS)
|
||||
list(APPEND SRCS arm_ramvec_initialize.c arm_ramvec_attach.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARM_MPU OR CONFIG_ARM_MPU_EARLY_RESET)
|
||||
list(APPEND SRCS arm_mpu.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
217
arch/arm/src/cmake/Toolchain.cmake
Normal file
217
arch/arm/src/cmake/Toolchain.cmake
Normal file
@@ -0,0 +1,217 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/Toolchain.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# Toolchain
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
set(ARCH_SUBDIR)
|
||||
|
||||
if(CONFIG_ARCH_ARMV7A) # ARMv7-A
|
||||
set(ARCH_SUBDIR armv7-a)
|
||||
elseif(CONFIG_ARCH_ARMV7R) # ARMv7-R
|
||||
set(ARCH_SUBDIR armv7-r)
|
||||
elseif(CONFIG_ARCH_ARMV7M) # ARMv7-M
|
||||
set(ARCH_SUBDIR armv7-m)
|
||||
elseif(CONFIG_ARCH_ARMV8M) # ARMv8-M
|
||||
set(ARCH_SUBDIR armv8-m)
|
||||
elseif(CONFIG_ARCH_ARMV6M) # ARMv6-M
|
||||
set(ARCH_SUBDIR armv6-m)
|
||||
else() # ARM9, ARM7TDMI, etc.
|
||||
set(ARCH_SUBDIR arm)
|
||||
endif()
|
||||
|
||||
include(${ARCH_SUBDIR})
|
||||
|
||||
if(CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
set(CMAKE_ASM_COMPILER clang)
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_STRIP llvm-strip --strip-unneeded)
|
||||
set(CMAKE_OBJCOPY llvm-objcopy)
|
||||
set(CMAKE_OBJDUMP llvm-objdump)
|
||||
set(CMAKE_LINKER ld.lld)
|
||||
set(CMAKE_LD ld.lld)
|
||||
set(CMAKE_AR llvm-ar)
|
||||
set(CMAKE_NM llvm-nm)
|
||||
set(CMAKE_RANLIB llvm-ranlib)
|
||||
|
||||
# Since the no_builtin attribute is not fully supported on Clang disable the
|
||||
# built-in functions, refer:
|
||||
# https://github.com/apache/incubator-nuttx/pull/5971
|
||||
|
||||
add_compile_options(-fno-builtin)
|
||||
else()
|
||||
set(TOOLCHAIN_PREFIX arm-none-eabi)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_PREFIX})
|
||||
|
||||
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_STRIP ${TOOLCHAIN_PREFIX}-strip --strip-unneeded)
|
||||
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}-objcopy)
|
||||
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}-objdump)
|
||||
|
||||
if(CONFIG_LTO_FULL AND CONFIG_ARCH_TOOLCHAIN_GNU)
|
||||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_LD ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}-gcc-ar)
|
||||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}-gcc-nm)
|
||||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-gcc-ranlib)
|
||||
else()
|
||||
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}-ld)
|
||||
set(CMAKE_LD ${TOOLCHAIN_PREFIX}-ld)
|
||||
set(CMAKE_AR ${TOOLCHAIN_PREFIX}-ar)
|
||||
set(CMAKE_NM ${TOOLCHAIN_PREFIX}-nm)
|
||||
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-ranlib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# override the ARCHIVE command
|
||||
|
||||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs -o <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_CXX_ARCHIVE_CREATE
|
||||
"<CMAKE_AR> rcs -o <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
set(CMAKE_ASM_ARCHIVE_CREATE
|
||||
"<CMAKE_AR> rcs -o <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||
|
||||
# Architecture flags
|
||||
|
||||
add_link_options(--entry=__start)
|
||||
add_link_options(-nostdlib)
|
||||
add_compile_options(-fno-common)
|
||||
add_compile_options(-Wall -Wshadow -Wundef)
|
||||
add_compile_options(-nostdlib)
|
||||
|
||||
if(CONFIG_ARM_THUMB)
|
||||
add_compile_options(-mthumb)
|
||||
|
||||
# GCC Manual: -mthumb ... If you want to force assembler files to be
|
||||
# interpreted as Thumb code, either add a `.thumb' directive to the source or
|
||||
# pass the -mthumb option directly to the assembler by prefixing it with -Wa.
|
||||
|
||||
add_compile_options(-Wa,-mthumb)
|
||||
|
||||
# Outputs an implicit IT block when there is a conditional instruction without
|
||||
# an enclosing IT block.
|
||||
|
||||
add_compile_options(-Wa,-mimplicit-it=always)
|
||||
endif()
|
||||
|
||||
if(CONFIG_UNWINDER_ARM)
|
||||
add_compile_options(-funwind-tables -fasynchronous-unwind-tables)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_CUSTOMOPT)
|
||||
add_compile_options(${CONFIG_DEBUG_OPTLEVEL})
|
||||
elseif(CONFIG_DEBUG_FULLOPT)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
add_compile_options(-Oz)
|
||||
else()
|
||||
add_compile_options(-Os)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_DEBUG_NOOPT)
|
||||
add_compile_options(-fno-strict-aliasing)
|
||||
endif()
|
||||
|
||||
if(CONFIG_FRAME_POINTER)
|
||||
add_compile_options(-fno-omit-frame-pointer -fno-optimize-sibling-calls)
|
||||
else()
|
||||
add_compile_options(-fomit-frame-pointer)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STACK_CANARIES)
|
||||
add_compile_options(-fstack-protector-all)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
add_compile_options(-fprofile-generate -ftest-coverage)
|
||||
endif()
|
||||
|
||||
# Optimization of unused sections
|
||||
|
||||
if(CONFIG_DEBUG_OPT_UNUSED_SECTIONS)
|
||||
add_link_options(-Wl,--gc-sections)
|
||||
add_compile_options(-ffunction-sections -fdata-sections)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ENDIAN_BIG)
|
||||
add_compile_options(-mbig-endian)
|
||||
endif()
|
||||
|
||||
# Link Time Optimization
|
||||
|
||||
if(CONFIG_LTO_THIN)
|
||||
add_compile_options(-flto=thin)
|
||||
elseif(CONFIG_LTO_FULL)
|
||||
add_compile_options(-flto)
|
||||
if(CONFIG_ARCH_TOOLCHAIN_GNU)
|
||||
add_compile_options(-fno-builtin)
|
||||
add_compile_options(-fuse-linker-plugin)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Debug link map
|
||||
|
||||
if(CONFIG_DEBUG_LINK_MAP)
|
||||
add_link_options(-Wl,--cref -Wl,-Map=nuttx.map)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_SYMBOLS)
|
||||
add_compile_options(-g)
|
||||
endif()
|
||||
|
||||
set(ARCHCFLAGS "-Wstrict-prototypes")
|
||||
set(ARCHCXXFLAGS "-nostdinc++")
|
||||
|
||||
if(CONFIG_CXX_EXCEPTION)
|
||||
string(APPEND ARCHCXXFLAGS " -fno-exceptions -fcheck-new")
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXX_RTTI)
|
||||
string(APPEND ARCHCXXFLAGS " -fno-rtti")
|
||||
endif()
|
||||
|
||||
if(NOT "${CMAKE_C_FLAGS}" STREQUAL "")
|
||||
string(REGEX MATCH "${ARCHCFLAGS}" EXISTS_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS
|
||||
"${CMAKE_ASM_FLAGS}${ARCHCFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS}${ARCHCFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS}${ARCHCXXFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-c")
|
||||
else()
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "--specs=nosys.specs")
|
||||
endif()
|
||||
19
arch/arm/src/cmake/arm.cmake
Normal file
19
arch/arm/src/cmake/arm.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/arm.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
21
arch/arm/src/cmake/armv6-m.cmake
Normal file
21
arch/arm/src/cmake/armv6-m.cmake
Normal file
@@ -0,0 +1,21 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/armv6-m.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_compile_options(-mcpu=cortex-m0 -mthumb -mfloat-abi=soft)
|
||||
68
arch/arm/src/cmake/armv7-a.cmake
Normal file
68
arch/arm/src/cmake/armv7-a.cmake
Normal file
@@ -0,0 +1,68 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/armv7-a.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(PLATFORM_FLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CORTEXA5)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a5)
|
||||
elseif(CONFIG_ARCH_CORTEXA7)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a7)
|
||||
elseif(CONFIG_ARCH_CORTEXA8)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a8)
|
||||
elseif(CONFIG_ARCH_CORTEXA9)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-a9)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_ARM_DPFPU32)
|
||||
set(ARCHFPUD16 -d16)
|
||||
endif()
|
||||
|
||||
# Cortex-A5 | -mfpu=vfpv4-fp16 | -mfpu=vfpv4-d16-fp16 | -mfpu=neon-fp16
|
||||
# Cortex-A7 | -mfpu=vfpv4 | -mfpu=vfpv4-d16 | -mfpu=neon-vfpv4
|
||||
# Cortex-A8 | -mfpu=vfpv3 | | -mfpu=neon (alias for
|
||||
# neon-vfpv3) Cortex-A9 | -mfpu=vfpv3-fp16 | -mfpu=vfpv3-d16-fp16 |
|
||||
# -mfpu=neon-fp16 Cortex-A15 | -mfpu=vfpv4 | |
|
||||
# -mfpu=neon-vfpv4
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
if(CONFIG_ARM_FPU_ABI_SOFT)
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=softfp)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=hard)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARM_NEON)
|
||||
set(ARCHNEON neon-)
|
||||
endif()
|
||||
if(CONFIG_ARCH_CORTEXA8)
|
||||
set(ARCHFPU vfpv3)
|
||||
elseif(CONFIG_ARCH_CORTEXA9)
|
||||
set(ARCHFPU vfpv3)
|
||||
else()
|
||||
set(ARCHFPU vfpv4)
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=${ARCHNEON}${ARCHFPU}${ARCHFPUD16})
|
||||
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=soft)
|
||||
endif()
|
||||
|
||||
add_compile_options(${PLATFORM_FLAGS})
|
||||
93
arch/arm/src/cmake/armv7-m.cmake
Normal file
93
arch/arm/src/cmake/armv7-m.cmake
Normal file
@@ -0,0 +1,93 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/armv7-m.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(PLATFORM_FLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CORTEXM4)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m4 -march=armv7e-m)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv4-sp-d16)
|
||||
endif()
|
||||
elseif(CONFIG_ARCH_CORTEXM7)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m7 -march=armv7e-m)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
if(CONFIG_ARCH_DPFPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-d16)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-sp-d16)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
if(CONFIG_ARM_FPU_ABI_SOFT)
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=softfp)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=hard)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=soft)
|
||||
endif()
|
||||
|
||||
# Clang Configuration files
|
||||
|
||||
if(CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
set(ARCHFLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CORTEXM4)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
string(APPEND ARCHFLAGS "--config armv7em_hard_fpv4_sp_d16_nosys")
|
||||
else()
|
||||
string(APPEND ARCHFLAGS "--config armv7em_soft_nofp_nosys")
|
||||
endif()
|
||||
elseif(CONFIG_ARCH_CORTEXM7)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
string(APPEND ARCHFLAGS "--config armv7em_hard_fpv5_d16_nosys")
|
||||
else()
|
||||
string(APPEND ARCHFLAGS "--config armv7em_soft_nofp_nosys")
|
||||
endif()
|
||||
else()
|
||||
string(APPEND ARCHFLAGS "--config armv7em_soft_nofp_nosys")
|
||||
endif()
|
||||
|
||||
if(NOT "${CMAKE_C_FLAGS}" STREQUAL "" AND NOT "${ARCHFLAGS}" STREQUAL "")
|
||||
string(REGEX MATCH "${ARCHFLAGS}" EXISTS_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS_FLAGS)
|
||||
set(CMAKE_ASM_FLAGS
|
||||
"${CMAKE_ASM_FLAGS}${ARCHFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS
|
||||
"${CMAKE_C_FLAGS}${ARCHFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
"${CMAKE_CXX_FLAGS}${ARCHFLAGS}"
|
||||
CACHE STRING "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV7M_STACKCHECK)
|
||||
list(APPEND PLATFORM_FLAGS -finstrument-functions -ffixed-r10)
|
||||
endif()
|
||||
|
||||
add_compile_options(${PLATFORM_FLAGS})
|
||||
42
arch/arm/src/cmake/armv7-r.cmake
Normal file
42
arch/arm/src/cmake/armv7-r.cmake
Normal file
@@ -0,0 +1,42 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/armv7-r.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(PLATFORM_FLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CORTEXR4)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-r4)
|
||||
elseif(CONFIG_ARCH_CORTEXR5)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-r5)
|
||||
elseif(CONFIG_ARCH_CORTEXR7)
|
||||
list(APPEND PLATFORM_FLAGS -mcpu=cortex-r7)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=vfpv3-d16)
|
||||
if(CONFIG_ARM_FPU_ABI_SOFT)
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=softfp)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=hard)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=soft)
|
||||
endif()
|
||||
|
||||
add_compile_options(${PLATFORM_FLAGS})
|
||||
62
arch/arm/src/cmake/armv8-m.cmake
Normal file
62
arch/arm/src/cmake/armv8-m.cmake
Normal file
@@ -0,0 +1,62 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cmake/armv8-m.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(PLATFORM_FLAGS)
|
||||
|
||||
if(CONFIG_ARCH_CORTEXM23)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m23 -march=armv8-m.main
|
||||
-mfloat-abi=soft)
|
||||
elseif(CONFIG_ARCH_CORTEXM33)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m33 -march=armv8-m.main+dsp)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-sp-d16)
|
||||
endif()
|
||||
elseif(CONFIG_ARCH_CORTEXM35P)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m35p -march=armv8-m.main+dsp)
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-sp-d16)
|
||||
endif()
|
||||
elseif(CONFIG_ARCH_CORTEXM55)
|
||||
list(APPEND PLATFORM_FLAGS -mtune=cortex-m55)
|
||||
if(CONFIG_ARM_HAVE_MVE)
|
||||
list(APPEND PLATFORM_FLAGS -march=armv8.1-m.main+mve.fp+fp.dp)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -march=armv8.1-m.main+dsp)
|
||||
endif()
|
||||
if(CONFIG_ARCH_FPU)
|
||||
list(APPEND PLATFORM_FLAGS -mfpu=fpv5-d16)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_FPU)
|
||||
if(CONFIG_ARM_FPU_ABI_SOFT)
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=softfp)
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=hard)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND PLATFORM_FLAGS -mfloat-abi=soft)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARMV8M_STACKCHECK)
|
||||
list(APPEND PLATFORM_FLAGS -finstrument-functions -ffixed-r10)
|
||||
endif()
|
||||
|
||||
add_compile_options(${PLATFORM_FLAGS})
|
||||
103
arch/arm/src/cmake/platform.cmake
Normal file
103
arch/arm/src/cmake/platform.cmake
Normal file
@@ -0,0 +1,103 @@
|
||||
# ##############################################################################
|
||||
# ./arch/arm/src/cmake/platform.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# configure target processor
|
||||
|
||||
if(CONFIG_ARCH_CORTEXM0)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m0)
|
||||
elseif(CONFIG_ARCH_CORTEXM3)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m3)
|
||||
elseif(CONFIG_ARCH_CORTEXM4)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
elseif(CONFIG_ARCH_CORTEXM7)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
|
||||
elseif(CONFIG_ARCH_CORTEXM23)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m23)
|
||||
elseif(CONFIG_ARCH_CORTEXM33)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m33)
|
||||
elseif(CONFIG_ARCH_CORTEXM35P)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m35p)
|
||||
elseif(CONFIG_ARCH_CORTEXM55)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m55)
|
||||
elseif(CONFIG_ARCH_CORTEXA5)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-a5)
|
||||
elseif(CONFIG_ARCH_CORTEXA7)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-a7)
|
||||
elseif(CONFIG_ARCH_CORTEXA8)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-a8)
|
||||
elseif(CONFIG_ARCH_CORTEXA9)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-a9)
|
||||
elseif(CONFIG_ARCH_CORTEXR4)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-r4)
|
||||
elseif(CONFIG_ARCH_CORTEXR5)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-r5)
|
||||
elseif(CONFIG_ARCH_CORTEXR7)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-r7)
|
||||
else()
|
||||
message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR not set")
|
||||
endif()
|
||||
|
||||
get_directory_property(NUTTX_EXTRA_FLAGS DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMPILE_OPTIONS)
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-libgcc-file-name
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
if(NOT EXISTS ${extra_library} AND CONFIG_ARCH_TOOLCHAIN_CLANG)
|
||||
get_filename_component(COMPILER_RT_LIB ${extra_library} NAME)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name ${COMPILER_RT_LIB}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
endif()
|
||||
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
|
||||
if(NOT CONFIG_LIBM)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libm.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBSUPCXX)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libsupc++.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_COVERAGE)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} ${NUTTX_EXTRA_FLAGS}
|
||||
--print-file-name=libgcov.a
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE extra_library)
|
||||
list(APPEND EXTRA_LIB ${extra_library})
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY NUTTX_EXTRA_LIBRARIES ${EXTRA_LIB})
|
||||
98
arch/arm/src/common/CMakeLists.txt
Normal file
98
arch/arm/src/common/CMakeLists.txt
Normal file
@@ -0,0 +1,98 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/common/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_ARCH_TOOLCHAIN_IAR)
|
||||
set(ARCH_TOOLCHAIN_PATH iar)
|
||||
else()
|
||||
set(ARCH_TOOLCHAIN_PATH gnu)
|
||||
endif()
|
||||
|
||||
set(SRCS
|
||||
arm_allocateheap.c
|
||||
arm_createstack.c
|
||||
arm_exit.c
|
||||
arm_getintstack.c
|
||||
arm_initialize.c
|
||||
arm_lowputs.c
|
||||
arm_modifyreg8.c
|
||||
arm_modifyreg16.c
|
||||
arm_modifyreg32.c
|
||||
arm_nputs.c
|
||||
arm_releasestack.c
|
||||
arm_registerdump.c
|
||||
arm_stackframe.c
|
||||
arm_switchcontext.c
|
||||
arm_usestack.c
|
||||
arm_vfork.c
|
||||
${ARCH_TOOLCHAIN_PATH}/vfork.S)
|
||||
|
||||
if(NOT CONFIG_ALARM_ARCH AND NOT CONFIG_TIMER_ARCH)
|
||||
list(APPEND SRCS arm_mdelay.c arm_udelay.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STACK_COLORATION)
|
||||
list(APPEND SRCS arm_checkstack.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS arm_idle.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED OR CONFIG_BUILD_KERNEL)
|
||||
list(APPEND SRCS arm_task_start.c arm_pthread_start.c arm_signal_dispatch.c)
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED)
|
||||
list(APPEND SRCS ${ARCH_TOOLCHAIN_PATH}/arm_signal_handler.S)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARM_SEMIHOSTING_SYSLOG)
|
||||
list(APPEND SRCS arm_semi_syslog.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARM_SEMIHOSTING_HOSTFS)
|
||||
list(APPEND SRCS arm_hostfs.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SCHED_THREAD_LOCAL)
|
||||
list(APPEND SRCS arm_tls.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_UNWINDER_FRAME_POINTER)
|
||||
list(APPEND SRCS arm_backtrace_fp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_UNWINDER_STACK_POINTER)
|
||||
list(APPEND SRCS arm_backtrace_sp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_UNWINDER_ARM)
|
||||
list(APPEND SRCS arm_backtrace_unwind.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_HAVE_TESTSET AND NOT CONFIG_ARCH_ARMV6M)
|
||||
list(APPEND SRCS ${ARCH_TOOLCHAIN_PATH}/arm_testset.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_HAVE_FETCHADD)
|
||||
list(APPEND SRCS ${ARCH_TOOLCHAIN_PATH}/arm_fetchadd.S)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
166
arch/arm/src/cxd56xx/CMakeLists.txt
Normal file
166
arch/arm/src/cxd56xx/CMakeLists.txt
Normal file
@@ -0,0 +1,166 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/cxd56xx/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS
|
||||
cxd56_farapistub.S
|
||||
cxd56_allocateheap.c
|
||||
cxd56_idle.c
|
||||
cxd56_uid.c
|
||||
cxd56_serial.c
|
||||
cxd56_uart.c
|
||||
cxd56_irq.c
|
||||
cxd56_start.c
|
||||
cxd56_timerisr.c
|
||||
cxd56_pinconfig.c
|
||||
cxd56_clock.c
|
||||
cxd56_delay.c
|
||||
cxd56_gpio.c
|
||||
cxd56_pmic.c
|
||||
cxd56_cpufifo.c
|
||||
cxd56_icc.c
|
||||
cxd56_powermgr.c
|
||||
cxd56_farapi.c
|
||||
cxd56_sysctl.c)
|
||||
|
||||
if(CONFIG_SMP)
|
||||
list(APPEND SRCS cxd56_cpuidlestack.c)
|
||||
list(APPEND SRCS cxd56_cpuindex.c)
|
||||
list(APPEND SRCS cxd56_cpupause.c)
|
||||
list(APPEND SRCS cxd56_cpustart.c)
|
||||
if(CONFIG_CXD56_TESTSET)
|
||||
list(APPEND SRCS cxd56_testset.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_USE_TEXT_HEAP)
|
||||
list(APPEND SRCS cxd56_textheap.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_UART0)
|
||||
list(APPEND SRCS cxd56_uart0.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_PM_PROCFS)
|
||||
list(APPEND SRCS cxd56_powermgr_procfs.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_RTC)
|
||||
list(APPEND SRCS cxd56_rtc.c)
|
||||
if(CONFIG_RTC_DRIVER)
|
||||
list(APPEND SRCS cxd56_rtc_lowerhalf.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GPIO_IRQ)
|
||||
list(APPEND SRCS cxd56_gpioint.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_USBDEV)
|
||||
list(APPEND SRCS cxd56_usbdev.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SDIO)
|
||||
list(APPEND SRCS cxd56_sdhci.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SFC)
|
||||
list(APPEND SRCS cxd56_sfc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SPH)
|
||||
list(APPEND SRCS cxd56_sph.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_EMMC)
|
||||
list(APPEND SRCS cxd56_emmc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SPI)
|
||||
list(APPEND SRCS cxd56_spi.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_I2C)
|
||||
list(APPEND SRCS cxd56_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_I2C_BITBANG)
|
||||
list(APPEND SRCS cxd56_i2c_bitbang.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_DMAC)
|
||||
list(APPEND SRCS cxd56_dmac.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_PWM)
|
||||
list(APPEND SRCS cxd56_pwm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GAUGE)
|
||||
list(APPEND SRCS cxd56_gauge.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_CHARGER)
|
||||
list(APPEND SRCS cxd56_charger.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GE2D)
|
||||
list(APPEND SRCS cxd56_ge2d.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_CISIF)
|
||||
list(APPEND SRCS cxd56_cisif.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SCU)
|
||||
list(APPEND SRCS cxd56_scu.c cxd56_scufifo.c)
|
||||
if(CONFIG_CXD56_ADC)
|
||||
list(APPEND SRCS cxd56_adc.c)
|
||||
endif()
|
||||
if(CONFIG_CXD56_UDMAC)
|
||||
list(APPEND SRCS cxd56_udmac.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_TIMER)
|
||||
list(APPEND SRCS cxd56_timer.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_WDT)
|
||||
list(APPEND SRCS cxd56_wdt.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GNSS)
|
||||
list(APPEND SRCS cxd56_gnss.c)
|
||||
list(APPEND SRCS cxd56_cpu1signal.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GEOFENCE)
|
||||
list(APPEND SRCS cxd56_geofence.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_BACKUPLOG)
|
||||
list(APPEND SRCS cxd56_backuplog.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_HOSTIF)
|
||||
list(APPEND SRCS cxd56_hostif.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
49
arch/arm/src/imx6/CMakeLists.txt
Normal file
49
arch/arm/src/imx6/CMakeLists.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/imx6/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS
|
||||
imx_boot.c
|
||||
imx_memorymap.c
|
||||
imx_clockconfig.c
|
||||
imx_irq.c
|
||||
imx_timerisr.c
|
||||
imx_gpio.c
|
||||
imx_iomuxc.c
|
||||
imx_serial.c
|
||||
imx_lowputc.c
|
||||
imx_idle.c)
|
||||
|
||||
if(CONFIG_SMP)
|
||||
list(APPEND SRCS imx_cpuboot.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_IMX6_ECSPI)
|
||||
list(APPEND SRCS imx_ecspi.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_IMX6_ENET)
|
||||
list(APPEND SRCS imx_enet.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_MM_PGALLOC)
|
||||
list(APPEND SRCS imx_pgalloc.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
233
arch/arm/src/stm32/CMakeLists.txt
Normal file
233
arch/arm/src/stm32/CMakeLists.txt
Normal file
@@ -0,0 +1,233 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/stm32/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
stm32_allocateheap.c
|
||||
stm32_start.c
|
||||
stm32_rcc.c
|
||||
stm32_lse.c
|
||||
stm32_lsi.c
|
||||
stm32_gpio.c
|
||||
stm32_exti_gpio.c
|
||||
stm32_flash.c
|
||||
stm32_irq.c
|
||||
stm32_dma.c
|
||||
stm32_lowputc.c
|
||||
stm32_serial.c
|
||||
stm32_spi.c
|
||||
stm32_i2s.c
|
||||
stm32_sdio.c
|
||||
stm32_tim.c
|
||||
stm32_waste.c
|
||||
stm32_ccm.c
|
||||
stm32_uid.c
|
||||
stm32_capture.c
|
||||
stm32_dfumode.c)
|
||||
|
||||
if(CONFIG_TIMER)
|
||||
list(APPEND SRCS stm32_tim_lowerhalf.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_TICKLESS_TIMER)
|
||||
list(APPEND SRCS stm32_tickless.c)
|
||||
else()
|
||||
list(APPEND SRCS stm32_timerisr.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ONESHOT)
|
||||
list(APPEND SRCS stm32_oneshot.c stm32_oneshot_lowerhalf.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_FREERUN)
|
||||
list(APPEND SRCS stm32_freerun.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED)
|
||||
list(APPEND SRCS stm32_userspace.c stm32_mpuinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_CCM_PROCFS)
|
||||
list(APPEND SRCS stm32_procfs_ccm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_I2C_V1)
|
||||
if(CONFIG_STM32_I2C_ALT)
|
||||
list(APPEND SRCS stm32_i2c_alt.c)
|
||||
elseif(CONFIG_STM32_STM32F4XXX)
|
||||
list(APPEND SRCS stm32f40xxx_i2c.c)
|
||||
else()
|
||||
list(APPEND SRCS stm32_i2c.c)
|
||||
endif()
|
||||
elseif(CONFIG_STM32_HAVE_IP_I2C_V2)
|
||||
list(APPEND SRCS stm32_i2c_v2.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_USBDEV)
|
||||
if(CONFIG_STM32_USB)
|
||||
list(APPEND SRCS stm32_usbdev.c)
|
||||
endif()
|
||||
if(CONFIG_STM32_OTGFS)
|
||||
list(APPEND SRCS stm32_otgfsdev.c)
|
||||
endif()
|
||||
if(CONFIG_STM32_OTGHS)
|
||||
list(APPEND SRCS stm32_otghsdev.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_USBHOST)
|
||||
if(CONFIG_STM32_OTGFS)
|
||||
list(APPEND SRCS stm32_otgfshost.c)
|
||||
endif()
|
||||
if(CONFIG_STM32_OTGHS)
|
||||
list(APPEND SRCS stm32_otghshost.c)
|
||||
endif()
|
||||
if(CONFIG_USBHOST_TRACE)
|
||||
list(APPEND SRCS stm32_usbhost.c)
|
||||
else()
|
||||
if(CONFIG_DEBUG_USB)
|
||||
list(APPEND SRCS stm32_usbhost.c)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS stm32_idle.c)
|
||||
endif()
|
||||
|
||||
list(APPEND SRCS stm32_pmstop.c stm32_pmstandby.c stm32_pmsleep.c)
|
||||
|
||||
if(NOT CONFIG_ARCH_CUSTOM_PMINIT)
|
||||
list(APPEND SRCS stm32_pminitialize.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ETHMAC)
|
||||
list(APPEND SRCS stm32_eth.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_PWR)
|
||||
list(APPEND SRCS stm32_pwr.c stm32_exti_pwr.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_RTC)
|
||||
list(APPEND SRCS stm32_rtc.c)
|
||||
if(CONFIG_RTC_ALARM)
|
||||
list(APPEND SRCS stm32_exti_alarm.c)
|
||||
endif()
|
||||
if(CONFIG_RTC_PERIODIC)
|
||||
list(APPEND SRCS stm32_exti_wakeup.c)
|
||||
endif()
|
||||
if(CONFIG_RTC_DRIVER)
|
||||
list(APPEND SRCS stm32_rtc_lowerhalf.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ADC)
|
||||
list(APPEND SRCS stm32_adc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_SDADC)
|
||||
list(APPEND SRCS stm32_sdadc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_DAC)
|
||||
list(APPEND SRCS stm32_dac.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_COMP)
|
||||
list(APPEND SRCS stm32_comp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_OPAMP)
|
||||
list(APPEND SRCS stm32_opamp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HRTIM)
|
||||
list(APPEND SRCS stm32_hrtim.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_1WIREDRIVER)
|
||||
list(APPEND SRCS stm32_1wire.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HCIUART)
|
||||
list(APPEND SRCS stm32_hciuart.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_RNG)
|
||||
list(APPEND SRCS stm32_rng.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_LTDC)
|
||||
list(APPEND SRCS stm32_ltdc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_DMA2D)
|
||||
list(APPEND SRCS stm32_dma2d.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_PWM)
|
||||
list(APPEND SRCS stm32_pwm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_QENCODER)
|
||||
list(APPEND SRCS stm32_qencoder.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_CAN)
|
||||
list(APPEND SRCS stm32_can.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_IWDG)
|
||||
list(APPEND SRCS stm32_iwdg.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_WWDG)
|
||||
list(APPEND SRCS stm32_wwdg.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_FEATURES)
|
||||
list(APPEND SRCS stm32_dumpgpio.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_AES)
|
||||
list(APPEND SRCS stm32_aes.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_BBSRAM)
|
||||
list(APPEND SRCS stm32_bbsram.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_FMC)
|
||||
list(APPEND SRCS stm32_fmc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_FSMC)
|
||||
list(APPEND SRCS stm32_fsmc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_FOC)
|
||||
list(APPEND SRCS stm32_foc.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
60
arch/arm/src/stm32u5/CMakeLists.txt
Normal file
60
arch/arm/src/stm32u5/CMakeLists.txt
Normal file
@@ -0,0 +1,60 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/stm32u5/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS
|
||||
stm32_allocateheap.c
|
||||
stm32_exti_gpio.c
|
||||
stm32_gpio.c
|
||||
stm32_irq.c
|
||||
stm32_lowputc.c
|
||||
stm32_rcc.c
|
||||
stm32_serial.c
|
||||
stm32_start.c
|
||||
stm32_waste.c
|
||||
stm32_uid.c
|
||||
stm32_spi.c
|
||||
stm32_lse.c
|
||||
stm32_lsi.c
|
||||
stm32_pwr.c
|
||||
stm32_tim.c
|
||||
stm32_flash.c
|
||||
stm32_timerisr.c)
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS stm32_idle.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIMER)
|
||||
list(APPEND SRCS stm32_tim_lowerhalf.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED)
|
||||
list(APPEND SRCS stm32_userspace.c stm32_mpuinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_FEATURES)
|
||||
list(APPEND SRCS stm32_dumpgpio.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32U5_STM32U585XX)
|
||||
list(APPEND SRCS stm32u585xx_rcc.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
140
arch/arm/src/tiva/CMakeLists.txt
Normal file
140
arch/arm/src/tiva/CMakeLists.txt
Normal file
@@ -0,0 +1,140 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/tiva/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_ARCH_CHIP_LM)
|
||||
set(ARCH_CHIP lm)
|
||||
elseif(CONFIG_ARCH_CHIP_TM4C)
|
||||
set(ARCH_CHIP tm4c)
|
||||
elseif(CONFIG_ARCH_CHIP_CC13X0)
|
||||
set(ARCH_CHIP cc13xx)
|
||||
elseif(CONFIG_ARCH_CHIP_CC13X2)
|
||||
set(ARCH_CHIP cc13xx)
|
||||
endif()
|
||||
|
||||
set(SRCS)
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS tiva_idle.c)
|
||||
endif()
|
||||
|
||||
list(APPEND SRCS tiva_allocateheap.c tiva_irq.c tiva_lowputc.c tiva_serial.c)
|
||||
list(APPEND SRCS tiva_ssi.c)
|
||||
|
||||
if(CONFIG_ARCH_CHIP_LM3S)
|
||||
list(APPEND SRCS lmxx_tm4c_start.c lm3s_gpio.c lmxx_tm4c_gpioirq.c)
|
||||
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
|
||||
elseif(CONFIG_ARCH_CHIP_LM4F)
|
||||
list(APPEND SRCS lmxx_tm4c_start.c lm4f_gpio.c lmxx_tm4c_gpioirq.c)
|
||||
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
|
||||
elseif(CONFIG_ARCH_CHIP_TM4C)
|
||||
list(APPEND SRCS lmxx_tm4c_start.c tm4c_gpio.c lmxx_tm4c_gpioirq.c)
|
||||
if(CONFIG_ARCH_CHIP_TM4C129)
|
||||
list(APPEND SRCS tm4c129_sysctrl.c)
|
||||
else()
|
||||
list(APPEND SRCS lm4xx_tm3c_sysctrl.c)
|
||||
endif()
|
||||
|
||||
elseif(CONFIG_ARCH_CHIP_CC13X0)
|
||||
list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c)
|
||||
list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
|
||||
list(APPEND SRCS cc13x0_trim.c cc13x0_rom.c)
|
||||
elseif(CONFIG_ARCH_CHIP_CC13X2)
|
||||
list(APPEND SRCS cc13xx_start.c cc13xx_prcm.c cc13xx_chipinfo.c cc13xx_gpio.c)
|
||||
list(APPEND SRCS cc13xx_gpioirq.c cc13xx_enableclks.c cc13xx_enablepwr.c)
|
||||
list(APPEND SRCS cc13x2_aux_sysif.c)
|
||||
if(CONFIG_ARCH_CHIP_CC13XX_V1)
|
||||
list(APPEND SRCS cc13x2_v1_trim.c cc13x2_cc26x2_v1_rom.c)
|
||||
else()
|
||||
list(APPEND SRCS cc13x2_v2_trim.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_DEBUG_GPIO_INFO)
|
||||
list(APPEND SRCS tiva_dumpgpio.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_SCHED_TICKLESS)
|
||||
list(APPEND SRCS tiva_timerisr.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED)
|
||||
list(APPEND SRCS tiva_userspace.c tiva_mpuinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_I2C)
|
||||
list(APPEND SRCS tiva_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_PWM)
|
||||
list(APPEND SRCS tiva_pwm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_QEI)
|
||||
list(APPEND SRCS tiva_qencoder.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_TIMER)
|
||||
list(APPEND SRCS tiva_timerlib.c)
|
||||
if(CONFIG_TIVA_TIMER32_PERIODIC)
|
||||
list(APPEND SRCS tiva_timerlow32.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_ADC)
|
||||
list(APPEND SRCS tiva_adclow.c)
|
||||
list(APPEND SRCS tiva_adclib.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_CAN)
|
||||
list(APPEND SRCS tiva_can.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_ETHERNET)
|
||||
if(CONFIG_ARCH_CHIP_LM3S)
|
||||
list(APPEND SRCS lm3s_ethernet.c)
|
||||
endif()
|
||||
if(CONFIG_ARCH_CHIP_TM4C)
|
||||
list(APPEND SRCS tm4c_ethernet.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_FLASH)
|
||||
list(APPEND SRCS tiva_flash.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_EEPROM)
|
||||
list(APPEND SRCS tiva_eeprom.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIVA_HCIUART)
|
||||
list(APPEND SRCS tiva_hciuart.c)
|
||||
endif()
|
||||
|
||||
set(COMMON_SRCS)
|
||||
|
||||
foreach(src ${SRCS})
|
||||
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/common/${src})
|
||||
list(APPEND COMMON_SRCS common/${src})
|
||||
else()
|
||||
list(APPEND COMMON_SRCS ${ARCH_CHIP}/${src})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
target_sources(arch PRIVATE ${COMMON_SRCS})
|
||||
196
arch/sim/CMakeLists.txt
Normal file
196
arch/sim/CMakeLists.txt
Normal file
@@ -0,0 +1,196 @@
|
||||
# ##############################################################################
|
||||
# arch/sim/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
include_directories(include)
|
||||
add_subdirectory(src)
|
||||
|
||||
# configure host binary ######################################################
|
||||
|
||||
target_include_directories(nuttx PRIVATE ${CONFIG_ARCH_CHIP})
|
||||
|
||||
target_compile_definitions(nuttx
|
||||
PRIVATE CONFIG_USEC_PER_TICK=${CONFIG_USEC_PER_TICK})
|
||||
|
||||
if(APPLE)
|
||||
target_compile_options(nuttx PRIVATE -Wno-deprecated-declarations)
|
||||
endif()
|
||||
|
||||
# configure simulated nuttx ##################################################
|
||||
|
||||
if(NOT WIN32)
|
||||
# Add -fvisibility=hidden Because we don't want export nuttx's symbols to
|
||||
# shared libraries
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS -fvisibility=hidden)
|
||||
|
||||
# Add -fno-common because macOS "ld -r" doesn't seem to pick objects for
|
||||
# common symbols.
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS -fno-common)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_SANITIZE)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS -fsanitize=address -fsanitize=undefined
|
||||
-fno-omit-frame-pointer)
|
||||
endif()
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS
|
||||
# NuttX is sometimes built as a native target. In that case, the
|
||||
# __NuttX__ macro is predefined by the compiler.
|
||||
# https://github.com/NuttX/buildroot
|
||||
#
|
||||
# In other cases, __NuttX__ is an ordinary user-definded macro. It's
|
||||
# especially the case for NuttX sim, which is a target to run the
|
||||
# entire NuttX as a program on the host OS, which can be Linux,
|
||||
# macOS, Windows, etc.
|
||||
# https://cwiki.apache.org/confluence/display/NUTTX/NuttX+Simulation
|
||||
# In that case, the host OS compiler is used to build NuttX. Thus,
|
||||
# eg. NuttX sim on macOS is built with __APPLE__. We #undef
|
||||
# predefined macros for those possible host OSes here because the OS
|
||||
# APIs this library should use are of NuttX, not the host OS.
|
||||
-U_AIX
|
||||
-U_WIN32
|
||||
-U__APPLE__
|
||||
-U__FreeBSD__
|
||||
-U__NetBSD__
|
||||
-U__linux__
|
||||
-U__sun__
|
||||
-U__unix__
|
||||
-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
|
||||
|
||||
# common options #############################################################
|
||||
|
||||
if(X86_64 AND CONFIG_SIM_M32)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS -m32)
|
||||
target_compile_options(nuttx PRIVATE -m32)
|
||||
target_link_options(nuttx PRIVATE -m32)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBCXX)
|
||||
if(APPLE)
|
||||
# macOS uses libc++abi
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_DEFINITIONS LIBCXX_BUILDING_LIBCXXABI)
|
||||
else()
|
||||
# Linux C++ ABI seems vary. Probably __GLIBCXX__ is the best bet. XXX what
|
||||
# to do for windows?
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_DEFINITIONS __GLIBCXX__)
|
||||
endif()
|
||||
|
||||
# Disable availability macros. The availability on Host OS is not likely
|
||||
# appropriate for NuttX.
|
||||
#
|
||||
# Note: When compiling NuttX apps, we undefine __APPLE__. It makes libcxx
|
||||
# __availability header unhappy.
|
||||
# https://github.com/llvm/llvm-project/blob/2e2999cd44f6ec9a5e396fa0113497ea82582f69/libcxx/include/__availability#L258
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_DEFINITIONS _LIBCPP_DISABLE_AVAILABILITY)
|
||||
endif()
|
||||
|
||||
# This is part of the top-level export target TODO: how to deal with in CMake?
|
||||
|
||||
# export_startup: board/libboard$(LIBEXT) up_head.o $(HOSTOBJS) nuttx-names.dat
|
||||
# cp up_head.o $(HOSTOBJS) ${EXPORT_DIR}/startup cp nuttx-names.dat
|
||||
# ${EXPORT_DIR}/libs echo main NXmain >> ${EXPORT_DIR}/libs/nuttx-names.dat
|
||||
|
||||
# Loadable module definitions TODO: implement modules with CMake
|
||||
|
||||
# -fno-pic to avoid GOT relocations
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_COMPILE_OPTIONS -fno-pic)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_LINK_OPTIONS -r -e module_initialize -T
|
||||
${NUTTX_DIR}/libs/libc/modlib/gnu-elf.ld)
|
||||
|
||||
if(CONFIG_LIBC_ARCH_ELF_64BIT)
|
||||
# For amd64: It seems macOS/x86_64 loads the program text around
|
||||
# 00000001_xxxxxxxx. The gcc default (-mcmodel=small) would produce
|
||||
# out-of-range 32-bit relocations. Even on Linux, NuttX modules are loaded
|
||||
# into the NuttX heap, which can be out of range with -mcmodel=small.
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_COMPILE_OPTIONS -mcmodel=large)
|
||||
endif()
|
||||
|
||||
# On Linux, we (ab)use the host compiler to compile binaries for NuttX.
|
||||
# Explicitly disable features which might be default on the host while not
|
||||
# available on NuttX.
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_COMPILE_OPTIONS -fno-stack-protector)
|
||||
|
||||
# TODO: move to toolchain file NuttX modules are ELF binaries. Non-ELF platforms
|
||||
# like macOS need to use a separate ELF toolchain. ifeq ($(CONFIG_HOST_MACOS),y)
|
||||
# # eg. brew install x86_64-elf-gcc MODULECC = x86_64-elf-gcc MODULELD =
|
||||
# x86_64-elf-ld MODULESTRIP = x86_64-elf-strip --strip-unneeded endif
|
||||
|
||||
# ELF module definitions
|
||||
|
||||
# -fno-pic to avoid GOT relocations
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_APP_COMPILE_OPTIONS -fno-pic)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_APP_LINK_OPTIONS -r -e main
|
||||
-T${BOARD_PATH}/scripts/gnu-elf.ld)
|
||||
|
||||
# TODO: move to toolchain file
|
||||
if(X86_64 AND CONFIG_SIM_M32)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_LINK_OPTIONS -m32)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_APP_LINK_OPTIONS -m32)
|
||||
endif()
|
||||
30
arch/sim/src/CMakeLists.txt
Normal file
30
arch/sim/src/CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
# ##############################################################################
|
||||
# arch/sim/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(${CONFIG_ARCH_CHIP})
|
||||
|
||||
# Include directories (before system ones) as PUBLIC so that it can be exposed
|
||||
# to libboard
|
||||
target_include_directories(arch BEFORE PUBLIC ${CONFIG_ARCH_CHIP} common)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
target_include_directories(arch_interface BEFORE PUBLIC ${CONFIG_ARCH_CHIP}
|
||||
common)
|
||||
endif()
|
||||
24
arch/sim/src/cmake/Toolchain.cmake
Normal file
24
arch/sim/src/cmake/Toolchain.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# ##############################################################################
|
||||
# arch/sim/cmake/Toolchain.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(APPLE)
|
||||
find_program(CMAKE_C_ELF_COMPILER x86_64-elf-gcc)
|
||||
find_program(CMAKE_CXX_ELF_COMPILER x86_64-elf-g++)
|
||||
endif()
|
||||
19
arch/sim/src/cmake/platform.cmake
Normal file
19
arch/sim/src/cmake/platform.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
# ##############################################################################
|
||||
# arch/sim/src/cmake/platform.cmake
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
228
arch/sim/src/sim/CMakeLists.txt
Normal file
228
arch/sim/src/sim/CMakeLists.txt
Normal file
@@ -0,0 +1,228 @@
|
||||
# ##############################################################################
|
||||
# arch/sim/src/sim/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# Initialize empty variables to hold internal (emulated guest) and external
|
||||
# (host) source files
|
||||
|
||||
set(SRCS)
|
||||
set(HOSTSRCS)
|
||||
|
||||
set(HOST_INCLUDE_DIRS)
|
||||
set(STDLIBS pthread)
|
||||
|
||||
list(APPEND HOST_DEFINITIONS -D__SIM__)
|
||||
|
||||
# common guest sources
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
sim_initialize.c
|
||||
sim_idle.c
|
||||
sim_doirq.c
|
||||
sim_initialstate.c
|
||||
sim_createstack.c
|
||||
sim_usestack.c
|
||||
sim_releasestack.c
|
||||
sim_stackframe.c
|
||||
sim_exit.c
|
||||
sim_schedulesigaction.c
|
||||
sim_switchcontext.c
|
||||
sim_heap.c
|
||||
sim_uart.c
|
||||
sim_copyfullstate.c
|
||||
sim_sigdeliver.c
|
||||
sim_registerdump.c
|
||||
sim_saveusercontext.c
|
||||
sim_textheap.c)
|
||||
|
||||
if(CONFIG_HOST_X86_64)
|
||||
if(CONFIG_SIM_M32)
|
||||
list(APPEND SRCS sim_vfork_x86.S)
|
||||
else()
|
||||
list(APPEND SRCS sim_vfork_x86_64.S)
|
||||
endif()
|
||||
elseif(CONFIG_HOST_X86)
|
||||
list(APPEND SRCS sim_vfork_x86.S)
|
||||
elseif(CONFIG_HOST_ARM)
|
||||
list(APPEND SRCS sim_vfork_arm.S)
|
||||
elseif(CONFIG_HOST_ARM64)
|
||||
list(APPEND SRCS sim_vfork_arm64.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SCHED_BACKTRACE)
|
||||
list(APPEND SRCS sim_backtrace.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_HAVE_VFORK AND CONFIG_SCHED_WAITPID)
|
||||
list(APPEND SRCS sim_vfork.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ONESHOT)
|
||||
list(APPEND SRCS sim_oneshot.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RTC_DRIVER)
|
||||
list(APPEND SRCS sim_rtc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_LCDDRIVER)
|
||||
list(APPEND SRCS sim_lcd.c)
|
||||
elseif(CONFIG_SIM_FRAMEBUFFER)
|
||||
list(APPEND SRCS sim_framebuffer.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STACK_COLORATION)
|
||||
list(APPEND SRCS sim_checkstack.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_FS_FAT)
|
||||
list(APPEND SRCS sim_blockdevice.c sim_deviceimage.c)
|
||||
list(APPEND STDLIBS z)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(NOT CONFIG_LIBCXX)
|
||||
list(APPEND STDLIBS c++abi)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND STDLIBS rt)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RPTUN)
|
||||
list(APPEND SRCS sim_rptun.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_SOUND_ALSA)
|
||||
list(APPEND SRCS sim_alsa.c)
|
||||
list(APPEND STDLIBS asound)
|
||||
list(APPEND STDLIBS mad)
|
||||
endif()
|
||||
|
||||
# host sources ###############################################################
|
||||
|
||||
list(
|
||||
APPEND
|
||||
HOSTSRCS
|
||||
sim_hostirq.c
|
||||
sim_hostmemory.c
|
||||
sim_hostmisc.c
|
||||
sim_hosttime.c
|
||||
sim_hostuart.c)
|
||||
|
||||
if(CONFIG_SPINLOCK)
|
||||
list(APPEND HOSTSRCS sim_testset.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SMP)
|
||||
list(APPEND SRCS sim_smpsignal.c sim_cpuidlestack.c)
|
||||
list(APPEND HOSTSRCS sim_hostsmp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_X11FB)
|
||||
list(APPEND HOSTSRCS sim_x11framebuffer.c)
|
||||
list(APPEND STDLIBS X11 Xext)
|
||||
|
||||
if(CONFIG_SIM_TOUCHSCREEN)
|
||||
list(APPEND SRCS sim_touchscreen.c)
|
||||
list(APPEND HOSTSRCS sim_x11eventloop.c)
|
||||
elseif(CONFIG_SIM_AJOYSTICK)
|
||||
list(APPEND SRCS sim_ajoystick.c)
|
||||
list(APPEND HOSTSRCS sim_x11eventloop.c)
|
||||
elseif(CONFIG_SIM_BUTTONS)
|
||||
list(APPEND HOSTSRCS sim_x11eventloop.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_NETDEV_TAP)
|
||||
list(APPEND SRCS sim_netdriver.c)
|
||||
|
||||
if(NOT CYGWIN)
|
||||
list(APPEND HOSTSRCS sim_tapdev.c)
|
||||
|
||||
else() # CYGWIN != y
|
||||
list(APPEND HOSTSRCS sim_wpcap.c)
|
||||
list(APPEND STDLIBS /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a)
|
||||
endif() # CONFIG_WINDOWS_CYGWIN != y
|
||||
elseif(CONFIG_SIM_NETDEV_VPNKIT)
|
||||
list(APPEND SRCS sim_netdriver.c)
|
||||
list(APPEND HOST_DEFINITIONS
|
||||
CONFIG_SIM_NETDEV_VPNKIT_PATH=\"${CONFIG_SIM_NETDEV_VPNKIT_PATH}\")
|
||||
list(APPEND HOSTSRCS sim_vpnkit.c vpnkit/protocol.c vpnkit/negotiate.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_HCISOCKET)
|
||||
list(APPEND HOSTSRCS sim_hcisocket_host.c)
|
||||
list(APPEND SRCS sim_hcisocket.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_NETUSRSOCK)
|
||||
list(APPEND HOSTSRCS sim_usrsock_host.c)
|
||||
list(APPEND SRCS sim_usrsock.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_BTUART)
|
||||
list(APPEND HOSTSRCS sim_hcisocket_host.c)
|
||||
list(APPEND SRCS sim_btuart.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_I2C_RESET)
|
||||
list(APPEND HOST_DEFINITIONS CONFIG_I2C_RESET=1)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_I2CBUS_LINUX)
|
||||
list(APPEND HOSTSRCS sim_i2cbuslinux.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_SPI_LINUX)
|
||||
list(APPEND HOSTSRCS sim_spilinux.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SIM_HOSTFS)
|
||||
list(APPEND HOSTSRCS sim_hostfs.c)
|
||||
list(APPEND HOST_DEFINITIONS CONFIG_NAME_MAX=${CONFIG_NAME_MAX})
|
||||
|
||||
configure_file(${NUTTX_DIR}/include/nuttx/fs/hostfs.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/hostfs.h COPYONLY)
|
||||
target_include_directories(nuttx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
target_include_directories(nuttx PRIVATE ${CMAKE_BINARY_DIR}/include/nuttx)
|
||||
target_include_directories(nuttx PRIVATE ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
target_sources(sim_head PUBLIC sim_head.c sim_doirq.c)
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
|
||||
if(WIN32)
|
||||
set(HOSTDIR win)
|
||||
else()
|
||||
set(HOSTDIR posix)
|
||||
target_link_libraries(nuttx PUBLIC ${STDLIBS})
|
||||
endif()
|
||||
|
||||
set(WINHOSTSRCS)
|
||||
foreach(hostsrc ${HOSTSRCS})
|
||||
list(APPEND WINHOSTSRCS ${HOSTDIR}/${hostsrc})
|
||||
endforeach()
|
||||
|
||||
set(HOSTSRCS ${WINHOSTSRCS})
|
||||
|
||||
target_sources(nuttx PRIVATE ${HOSTSRCS})
|
||||
target_compile_definitions(nuttx PRIVATE ${HOST_DEFINITIONS})
|
||||
35
audio/CMakeLists.txt
Normal file
35
audio/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
# ##############################################################################
|
||||
# audio/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_AUDIO)
|
||||
nuttx_add_kernel_library(audio)
|
||||
|
||||
set(SRCS audio.c)
|
||||
|
||||
if(CONFIG_AUDIO_COMP)
|
||||
list(APPEND SRCS audio_comp.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_AUDIO_FORMAT_PCM)
|
||||
list(APPEND SRCS pcm_decode.c)
|
||||
endif()
|
||||
|
||||
target_sources(audio PRIVATE ${SRCS})
|
||||
endif()
|
||||
61
binfmt/CMakeLists.txt
Normal file
61
binfmt/CMakeLists.txt
Normal file
@@ -0,0 +1,61 @@
|
||||
# ##############################################################################
|
||||
# binfmt/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
nuttx_add_kernel_library(binfmt)
|
||||
|
||||
nuttx_add_subdirectory()
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
binfmt_globals.c
|
||||
binfmt_initialize.c
|
||||
binfmt_register.c
|
||||
binfmt_unregister.c
|
||||
binfmt_loadmodule.c
|
||||
binfmt_unloadmodule.c
|
||||
binfmt_execmodule.c
|
||||
binfmt_exec.c
|
||||
binfmt_copyargv.c
|
||||
binfmt_dumpmodule.c
|
||||
binfmt_coredump.c)
|
||||
|
||||
if(CONFIG_BINFMT_LOADABLE)
|
||||
list(APPEND SRCS binfmt_exit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIBC_EXECFUNCS)
|
||||
list(APPEND SRCS binfmt_execsymtab.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ELF)
|
||||
list(APPEND SRCS elf.c)
|
||||
endif()
|
||||
|
||||
# Builtin application interfaces
|
||||
|
||||
if(CONFIG_BUILTIN)
|
||||
list(APPEND SRCS builtin.c)
|
||||
endif()
|
||||
|
||||
target_sources(binfmt PRIVATE ${SRCS})
|
||||
target_include_directories(binfmt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
51
binfmt/libelf/CMakeLists.txt
Normal file
51
binfmt/libelf/CMakeLists.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
# ##############################################################################
|
||||
# binfmt/libelf/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_ELF)
|
||||
set(SRCS)
|
||||
|
||||
# ELF library
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
libelf_bind.c
|
||||
libelf_init.c
|
||||
libelf_addrenv.c
|
||||
libelf_iobuffer.c
|
||||
libelf_load.c
|
||||
libelf_read.c
|
||||
libelf_sections.c
|
||||
libelf_symbols.c
|
||||
libelf_uninit.c
|
||||
libelf_unload.c
|
||||
libelf_verify.c)
|
||||
|
||||
if(CONFIG_ELF_COREDUMP)
|
||||
list(APPEND SRCS libelf_coredump.c)
|
||||
target_include_directories(binfmt PRIVATE ${NUTTX_DIR}/sched)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BINFMT_CONSTRUCTORS)
|
||||
list(APPEND SRCS libelf_ctors.c libelf_dtors.c)
|
||||
endif()
|
||||
|
||||
target_sources(binfmt PRIVATE ${SRCS})
|
||||
endif()
|
||||
35
binfmt/libnxflat/CMakeLists.txt
Normal file
35
binfmt/libnxflat/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
# ##############################################################################
|
||||
# binfmt/libnxflat/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_NXFLAT)
|
||||
|
||||
target_sources(
|
||||
binfmt
|
||||
PRIVATE # NXFLAT library
|
||||
libnxflat_init.c
|
||||
libnxflat_uninit.c
|
||||
libnxflat_addrenv.c
|
||||
libnxflat_load.c
|
||||
libnxflat_unload.c
|
||||
libnxflat_verify.c
|
||||
libnxflat_read.c
|
||||
libnxflat_bind.c)
|
||||
|
||||
endif()
|
||||
65
boards/CMakeLists.txt
Normal file
65
boards/CMakeLists.txt
Normal file
@@ -0,0 +1,65 @@
|
||||
# ##############################################################################
|
||||
# boards/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# Determine if there is a Kconfig file for any custom board configuration
|
||||
|
||||
# TODO: implement if("${CONFIG_ARCH_BOARD_CUSTOM}" STREQUAL "y") CUSTOM_DIR =
|
||||
# $(patsubst "%",%,$(CONFIG_ARCH_BOARD_CUSTOM_DIR))
|
||||
# if("${CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH}" STREQUAL "y") CUSTOM_KPATH =
|
||||
# $(TOPDIR)$(DELIM)$(CUSTOM_DIR)$(DELIM)Kconfig else CUSTOM_KPATH =
|
||||
# $(CUSTOM_DIR)$(DELIM)Kconfig endif CUSTOM_KCONFIG = $(if $(wildcard
|
||||
# $(CUSTOM_KPATH)),y,) else CUSTOM_KCONFIG = endif
|
||||
|
||||
# ifeq ($(CUSTOM_KCONFIG),y) BOARD_KCONFIG = $(CUSTOM_KPATH) else BOARD_KCONFIG
|
||||
# = $(TOPDIR)$(DELIM)configs$(DELIM)dummy$(DELIM)dummy_kconfig endif
|
||||
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/dummy.c "")
|
||||
nuttx_add_kernel_library(board ${CMAKE_BINARY_DIR}/dummy.c)
|
||||
|
||||
# boardctl support
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
target_sources(board PRIVATE boardctl.c)
|
||||
endif()
|
||||
|
||||
# obtain include directories exported by libarch
|
||||
target_include_directories(board
|
||||
PRIVATE $<TARGET_PROPERTY:arch,INCLUDE_DIRECTORIES>)
|
||||
|
||||
# add contents of <arch>, <soc> and <board> directories, adding common/ subdirs
|
||||
# if found at each arch and soc level
|
||||
|
||||
if(EXISTS ${NUTTX_BOARD_ABS_DIR}/../common/CMakeLists.txt)
|
||||
add_subdirectory("${NUTTX_BOARD_ABS_DIR}/../common" EXCLUDE_FROM_ALL
|
||||
exclude_common)
|
||||
|
||||
# Create link ARCH_SRC_BOARD_BOARD_SYMLINK
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/arch/${CONFIG_ARCH}/src/board)
|
||||
file(CREATE_LINK ${NUTTX_BOARD_ABS_DIR}/src
|
||||
${CMAKE_BINARY_DIR}/arch/${CONFIG_ARCH}/src/board/board SYMBOLIC)
|
||||
endif()
|
||||
|
||||
if(EXISTS ${NUTTX_BOARD_ABS_DIR}/../drivers/CMakeLists.txt)
|
||||
add_subdirectory("${NUTTX_BOARD_ABS_DIR}/../drivers" EXCLUDE_FROM_ALL
|
||||
exclude_drivers)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${NUTTX_BOARD_ABS_DIR} EXCLUDE_FROM_ALL exclude_board)
|
||||
183
boards/arm/cxd56xx/common/CMakeLists.txt
Normal file
183
boards/arm/cxd56xx/common/CMakeLists.txt
Normal file
@@ -0,0 +1,183 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/cxd56xx/common/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
if(CONFIG_ARCH_BOARD_COMMON)
|
||||
set(SRCS)
|
||||
|
||||
list(APPEND SRCS src/cxd56_boot.c)
|
||||
|
||||
if(CONFIG_AUDIO_CXD56)
|
||||
list(APPEND SRCS src/cxd56_audio.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_AUDIO)
|
||||
list(APPEND SRCS src/cxd56_audio.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_MODEM_ALTMDM)
|
||||
list(APPEND SRCS src/cxd56_altmdm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARDCTL_UNIQUEID)
|
||||
list(APPEND SRCS src/cxd56_uid.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_BACKUPLOG)
|
||||
list(APPEND SRCS src/cxd56_crashdump.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS)
|
||||
list(APPEND SRCS src/cxd56_sensors.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_AK09912)
|
||||
list(APPEND SRCS src/cxd56_ak09912_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_AK09912_SCU)
|
||||
list(APPEND SRCS src/cxd56_ak09912_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_APDS9930_SCU)
|
||||
list(APPEND SRCS src/cxd56_apds9930_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_APDS9960)
|
||||
list(APPEND SRCS src/cxd56_apds9960_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BH1721FVC_SCU)
|
||||
list(APPEND SRCS src/cxd56_bh1721fvc_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BH1745NUC_SCU)
|
||||
list(APPEND SRCS src/cxd56_bh1745nuc_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BM1383GLV_SCU)
|
||||
list(APPEND SRCS src/cxd56_bm1383glv_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BM1422GMV_SCU)
|
||||
list(APPEND SRCS src/cxd56_bm1422gmv_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BMI160_I2C)
|
||||
list(APPEND SRCS src/cxd56_bmi160_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BMI160_SCU)
|
||||
list(APPEND SRCS src/cxd56_bmi160_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BMI160_SPI)
|
||||
list(APPEND SRCS src/cxd56_bmi160_spi.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BMP280)
|
||||
list(APPEND SRCS src/cxd56_bmp280_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BMP280_SCU)
|
||||
list(APPEND SRCS src/cxd56_bmp280_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_KX022_SCU)
|
||||
list(APPEND SRCS src/cxd56_kx022_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_LT1PA01_SCU)
|
||||
list(APPEND SRCS src/cxd56_lt1pa01_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_RPR0521RS_SCU)
|
||||
list(APPEND SRCS src/cxd56_rpr0521rs_scu.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_SCD41)
|
||||
list(APPEND SRCS src/cxd56_scd41_i2c.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_NETDEVICES)
|
||||
list(APPEND SRCS src/cxd56_netinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_WL_GS2200M)
|
||||
list(APPEND SRCS src/cxd56_gs2200m.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_ILI9340)
|
||||
list(APPEND SRCS src/cxd56_ili9340.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_LPM013M091A)
|
||||
list(APPEND SRCS src/cxd56_lpm013m091a.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SFC)
|
||||
list(APPEND SRCS src/cxd56_flash.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_USBMSC)
|
||||
list(APPEND SRCS src/cxd56_usbmsc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_I2C_DRIVER)
|
||||
list(APPEND SRCS src/cxd56_i2cdev.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_I2C_BITBANG)
|
||||
list(APPEND SRCS src/cxd56_i2cdev_bitbang.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SPI_DRIVER)
|
||||
list(APPEND SRCS src/cxd56_spidev.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_VIDEO_ISX012)
|
||||
list(APPEND SRCS src/cxd56_isx012.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_VIDEO_ISX019)
|
||||
list(APPEND SRCS src/cxd56_isx019.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_IMAGEPROC)
|
||||
list(APPEND SRCS src/cxd56_imageproc.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BCM20706)
|
||||
list(APPEND SRCS src/cxd56_bcm20706.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_EMMC)
|
||||
list(APPEND SRCS src/cxd56_emmcdev.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SPISD)
|
||||
list(APPEND SRCS src/cxd56_spisd.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARD_USBDEV_SERIALSTR)
|
||||
list(APPEND SRCS src/cxd56_usbdevserialstr.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
endif()
|
||||
45
boards/arm/cxd56xx/spresense/CMakeLists.txt
Normal file
45
boards/arm/cxd56xx/spresense/CMakeLists.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/cxd56xx/spresense/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
add_subdirectory(kernel)
|
||||
set_property(
|
||||
GLOBAL PROPERTY LD_SCRIPT_USER ${CMAKE_CURRENT_LIST_DIR}/scripts/memory.ld
|
||||
${CMAKE_CURRENT_LIST_DIR}/scripts/user-space.ld)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
nuttx_post_build
|
||||
SOURCE_DIR ${CMAKE_SOURCE_DIR}/tools/cxd56
|
||||
INSTALL_DIR ${CMAKE_BINARY_DIR}/tools/cxd56
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
|
||||
USES_TERMINAL_CONFIGURE true
|
||||
USES_TERMINAL_BUILD true
|
||||
USES_TERMINAL_INSTALL true
|
||||
DEPENDS nuttx)
|
||||
|
||||
add_custom_command(
|
||||
TARGET nuttx_post_build
|
||||
POST_BUILD
|
||||
BYPRODUCTS nuttx.spk
|
||||
COMMAND ${CMAKE_BINARY_DIR}/bin/mkspk -c2 nuttx nuttx nuttx.spk
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
89
boards/arm/cxd56xx/spresense/src/CMakeLists.txt
Normal file
89
boards/arm/cxd56xx/spresense/src/CMakeLists.txt
Normal file
@@ -0,0 +1,89 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/cxd56xx/spresense/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
set(SRCS cxd56_main.c cxd56_clock.c cxd56_bringup.c)
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS cxd56_appinit.c)
|
||||
list(APPEND SRCS cxd56_power.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARDCTL_IOCTL)
|
||||
list(APPEND SRCS cxd56_ioctl.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_LEDS)
|
||||
list(APPEND SRCS cxd56_leds.c)
|
||||
elseif(CONFIG_USERLED)
|
||||
list(APPEND SRCS cxd56_userleds.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_BUTTONS)
|
||||
list(APPEND SRCS cxd56_buttons.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GPIO_IRQ)
|
||||
list(APPEND SRCS cxd56_gpioif.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_PWM)
|
||||
list(APPEND SRCS cxd56_pwm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SPI)
|
||||
list(APPEND SRCS cxd56_spi.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SDIO)
|
||||
list(APPEND SRCS cxd56_sdcard.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_SDCARD_AUTOMOUNT)
|
||||
list(APPEND SRCS cxd56_automount.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_GAUGE)
|
||||
list(APPEND SRCS cxd56_gauge.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_CXD56_CHARGER)
|
||||
list(APPEND SRCS cxd56_charger.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_USBDEV_COMPOSITE)
|
||||
list(APPEND SRCS cxd56_composite.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_MODEM_ALT1250)
|
||||
list(APPEND SRCS cxd56_alt1250_power.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
if(CONFIG_CXD56_USE_SYSBUS)
|
||||
set(LDSCRIPT ramconfig-new.ld)
|
||||
else()
|
||||
set(LDSCRIPT ramconfig.ld)
|
||||
endif()
|
||||
|
||||
# TODO: make this the default and then allow boards to redefine
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/${LDSCRIPT}")
|
||||
28
boards/arm/imx6/sabre-6quad/CMakeLists.txt
Normal file
28
boards/arm/imx6/sabre-6quad/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/imx6/sabre-6quad/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
add_subdirectory(kernel)
|
||||
set_property(
|
||||
GLOBAL PROPERTY LD_SCRIPT_USER ${CMAKE_CURRENT_LIST_DIR}/scripts/memory.ld
|
||||
${CMAKE_CURRENT_LIST_DIR}/scripts/user-space.ld)
|
||||
endif()
|
||||
36
boards/arm/imx6/sabre-6quad/src/CMakeLists.txt
Normal file
36
boards/arm/imx6/sabre-6quad/src/CMakeLists.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/imx6/sabre-6quad/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS imx_boardinit.c imx_bringup.c)
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS imx_appinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_LEDS)
|
||||
list(APPEND SRCS imx_autoleds.c)
|
||||
else()
|
||||
list(APPEND SRCS imx_userleds.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
# TODO: make this the default and then allow boards to redefine
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/dramboot.ld")
|
||||
22
boards/arm/stm32/common/CMakeLists.txt
Normal file
22
boards/arm/stm32/common/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/common/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
target_include_directories(board PRIVATE include)
|
||||
127
boards/arm/stm32/common/src/CMakeLists.txt
Normal file
127
boards/arm/stm32/common/src/CMakeLists.txt
Normal file
@@ -0,0 +1,127 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/common/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
if(CONFIG_SENSORS_BMP180)
|
||||
list(APPEND SRCS stm32_bmp180.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LEDS_APA102)
|
||||
list(APPEND SRCS stm32_apa102.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_WS2812)
|
||||
list(APPEND SRCS stm32_ws2812.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_MAX6675)
|
||||
list(APPEND SRCS stm32_max6675.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_VEML6070)
|
||||
list(APPEND SRCS stm32_veml6070.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_INPUT_NUNCHUCK)
|
||||
list(APPEND SRCS stm32_nunchuck.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_AUDIO_TONE)
|
||||
list(APPEND SRCS stm32_tone.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_BACKPACK)
|
||||
list(APPEND SRCS stm32_lcd_backpack.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_SSD1306)
|
||||
list(APPEND SRCS stm32_ssd1306.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_LM75)
|
||||
list(APPEND SRCS stm32_lm75.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_WL_NRF24L01)
|
||||
list(APPEND SRCS stm32_nrf24l01.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_HCSR04)
|
||||
list(APPEND SRCS stm32_hcsr04.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_APDS9960)
|
||||
list(APPEND SRCS stm32_apds9960.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_ZEROCROSS)
|
||||
list(APPEND SRCS stm32_zerocross.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_QENCODER)
|
||||
list(APPEND SRCS stm32_qencoder.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_INA219)
|
||||
list(APPEND SRCS stm32_ina219.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_L3GD20)
|
||||
list(APPEND SRCS stm32_l3gd20.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_MPL115A)
|
||||
list(APPEND SRCS stm32_mpl115a.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_DHTXX)
|
||||
list(APPEND SRCS stm32_dhtxx.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_XEN1210)
|
||||
list(APPEND SRCS stm32_xen1210.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_BH1750FVI)
|
||||
list(APPEND SRCS stm32_bh1750.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_MLX90614)
|
||||
list(APPEND SRCS stm32_mlx90614.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_SENSORS_MAX31855)
|
||||
list(APPEND SRCS stm32_max31855.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LIS3DSH)
|
||||
list(APPEND SRCS stm32_lis3dsh.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARD_STM32_IHM07M1)
|
||||
list(APPEND SRCS stm32_ihm07m1.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARD_STM32_IHM08M1)
|
||||
list(APPEND SRCS stm32_ihm08m1.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
21
boards/arm/stm32/stm32f103-minimum/CMakeLists.txt
Normal file
21
boards/arm/stm32/stm32f103-minimum/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/stm32f103-minimum/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
153
boards/arm/stm32/stm32f103-minimum/src/CMakeLists.txt
Normal file
153
boards/arm/stm32/stm32f103-minimum/src/CMakeLists.txt
Normal file
@@ -0,0 +1,153 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/stm32f103-minimum/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(CSRCS)
|
||||
|
||||
list(APPEND CSRCS stm32_boot.c stm32_bringup.c stm32_spi.c)
|
||||
|
||||
if("${CONFIG_LIB_BOARDCTL}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_appinit.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_ARCH_BUTTONS}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_buttons.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_ARCH_LEDS}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_autoleds.c)
|
||||
else()
|
||||
list(APPEND CSRCS stm32_userleds.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_ADC}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_adc.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_DEV_GPIO}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_gpio.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_PWM}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_pwm.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_ZEROCROSS}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_zerocross.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LEDS_APA102}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_apa102.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_BMP180}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_bmp180.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LM75_I2C}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_lm75.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_RGBLED}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_rgbled.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_MMCSD}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_mmcsd.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_MTD_W25}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_w25.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_MTD_AT24XX}" STREQUAL "y")
|
||||
if("${CONFIG_STM32_I2C1}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_at24.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("${CONFIG_AUDIO_TONE}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_tone.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_CAN_MCP2515}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_mcp2515.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_CL_MFRC522}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_mfrc522.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_HCSR04}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_hcsr04.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_MAX6675}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_max6675.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LCD_MAX7219}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_max7219.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_INPUT_NUNCHUCK}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_nunchuck.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LCD_SSD1306_I2C}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_ssd1306.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LCD_ST7567}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_lcd.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_LCD_PCD8544}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_pcd8544.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_APDS9960}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_apds9960.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_QENCODER}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_qencoder.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_SENSORS_VEML6070}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_veml6070.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_WL_NRF24L01}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_nrf24l01.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_USBDEV}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_usbdev.c)
|
||||
endif()
|
||||
|
||||
if("${CONFIG_USBMSC}" STREQUAL "y")
|
||||
list(APPEND CSRCS stm32_usbmsc.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${CSRCS})
|
||||
|
||||
# Configure linker script TODO: better to place this in boards/CMakeLists.txt?
|
||||
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
|
||||
28
boards/arm/stm32/stm32f4discovery/CMakeLists.txt
Normal file
28
boards/arm/stm32/stm32f4discovery/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/stm32f4discovery/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
add_subdirectory(kernel)
|
||||
set_property(
|
||||
GLOBAL PROPERTY LD_SCRIPT_USER ${CMAKE_CURRENT_LIST_DIR}/scripts/memory.ld
|
||||
${CMAKE_CURRENT_LIST_DIR}/scripts/user-space.ld)
|
||||
endif()
|
||||
21
boards/arm/stm32/stm32f4discovery/kernel/CMakeLists.txt
Normal file
21
boards/arm/stm32/stm32f4discovery/kernel/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/stm32f4discovery/kernel/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
nuttx_add_aux_library(userspace stm32_userspace.c)
|
||||
224
boards/arm/stm32/stm32f4discovery/src/CMakeLists.txt
Normal file
224
boards/arm/stm32/stm32f4discovery/src/CMakeLists.txt
Normal file
@@ -0,0 +1,224 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32/stm32f4discovery/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS stm32_boot.c stm32_bringup.c stm32_spi.c)
|
||||
|
||||
if(CONFIG_ARCH_LEDS)
|
||||
list(APPEND SRCS stm32_autoleds.c)
|
||||
else()
|
||||
list(APPEND SRCS stm32_userleds.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_AUDIO_CS43L22)
|
||||
list(APPEND SRCS stm32_cs43l22.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_BUTTONS)
|
||||
list(APPEND SRCS stm32_buttons.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_CAN_CHARDRIVER)
|
||||
list(APPEND SRCS stm32_can.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_OTGFS)
|
||||
list(APPEND SRCS stm32_usb.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_ST7567)
|
||||
list(APPEND SRCS stm32_st7567.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ENC28J60)
|
||||
list(APPEND SRCS stm32_enc28j60.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LPWAN_SX127X)
|
||||
list(APPEND SRCS stm32_sx127x.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_MAX7219)
|
||||
list(APPEND SRCS stm32_max7219.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_ST7032)
|
||||
list(APPEND SRCS stm32_st7032.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_PCA9635PW)
|
||||
list(APPEND SRCS stm32_pca9635.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_SDIO)
|
||||
list(APPEND SRCS stm32_sdio.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ETHMAC)
|
||||
list(APPEND SRCS stm32_ethernet.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LEDS_MAX7219)
|
||||
list(APPEND SRCS stm32_max7219_leds.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RGBLED)
|
||||
list(APPEND SRCS stm32_rgbled.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RTC_DS1307)
|
||||
list(APPEND SRCS stm32_ds1307.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_PWM)
|
||||
list(APPEND SRCS stm32_pwm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS stm32_appinit.c)
|
||||
if(CONFIG_BOARDCTL_RESET)
|
||||
list(APPEND SRCS stm32_reset.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_CUSTOM_PMINIT)
|
||||
list(APPEND SRCS stm32_pm.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_PM_BUTTONS)
|
||||
list(APPEND SRCS stm32_pmbuttons.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS stm32_idle.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_FSMC)
|
||||
list(APPEND SRCS stm32_extmem.c)
|
||||
|
||||
if(CONFIG_LCD_SSD1289)
|
||||
list(APPEND SRCS stm32_ssd1289.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_SSD1351)
|
||||
list(APPEND SRCS stm32_ssd1351.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_UG2864AMBAG01)
|
||||
list(APPEND SRCS stm32_ug2864ambag01.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_UG2864HSWEG01)
|
||||
list(APPEND SRCS stm32_ug2864hsweg01.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_TIMER)
|
||||
list(APPEND SRCS stm32_timer.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_HCIUART)
|
||||
if(CONFIG_BLUETOOTH_UART)
|
||||
list(APPEND SRCS stm32_hciuart.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ROMFS)
|
||||
list(APPEND SRCS stm32_romfs_initialize.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARDCTL_UNIQUEID)
|
||||
list(APPEND SRCS stm32_uid.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_USBMSC)
|
||||
list(APPEND SRCS stm32_usbmsc.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_STM32_ETHMAC)
|
||||
if(CONFIG_NETDEVICES)
|
||||
list(APPEND SRCS stm32_netinit.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_MMCSD_SPI)
|
||||
list(APPEND SRCS stm32_mmcsd.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_WL_GS2200M)
|
||||
list(APPEND SRCS stm32_gs2200m.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_LCD_ST7789)
|
||||
list(APPEND SRCS stm32_st7789.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
# TODO: make this the default and then allow boards to redefine
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
|
||||
|
||||
# TODO:move this to apropriate arch/toolchain level
|
||||
set_property(
|
||||
GLOBAL APPEND
|
||||
PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:-fno-strict-aliasing
|
||||
-fomit-frame-pointer>)
|
||||
|
||||
# TODO: see where to put pic flags set_property(TARGET nuttx APPEND PROPERTY
|
||||
# NUTTX_COMPILE_OPTIONS $<$<NOT:$<COMPILE_LANGUAGE:ASM>>:-fpic -msingle-pic-base
|
||||
# -mpic-register=r10>)
|
||||
|
||||
# ifeq ($(CONFIG_ARMV7M_TOOLCHAIN_CLANGL),y) ARCHCFLAGS += -nostdlib
|
||||
# -ffreestanding ARCHCXXFLAGS += -nostdlib -ffreestanding else ARCHCFLAGS +=
|
||||
# -funwind-tables ARCHCXXFLAGS += -fno-rtti -funwind-tables ifneq
|
||||
# ($(CONFIG_DEBUG_NOOPT),y) ARCHOPTIMIZATION += -fno-strength-reduce endif endif
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_COMPILE_OPTIONS -funwind-tables)
|
||||
set_property(GLOBAL APPEND PROPERTY COMPILE_OPTIONS -fno-strength-reduce)
|
||||
|
||||
# TODO: nxflat NXFLATLDFLAGS1 = -r -d -warn-common NXFLATLDFLAGS2 =
|
||||
# $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld
|
||||
# -no-check-sections LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
# Loadable module definitions
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_COMPILE_OPTIONS -mlong-calls)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_MODULE_LINK_OPTIONS -r -e module_initialize -T
|
||||
${NUTTX_DIR}/libs/libc/modlib/gnu-elf.ld)
|
||||
|
||||
# ELF module definitions
|
||||
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_APP_COMPILE_OPTIONS -mlong-calls)
|
||||
set_property(
|
||||
TARGET nuttx
|
||||
APPEND
|
||||
PROPERTY NUTTX_ELF_APP_LINK_OPTIONS -r -e main
|
||||
-T${NUTTX_BOARD_DIR}/scripts/gnu-elf.ld)
|
||||
28
boards/arm/stm32u5/b-u585i-iot02a/CMakeLists.txt
Normal file
28
boards/arm/stm32u5/b-u585i-iot02a/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32u5/b-u585i-iot02a/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
add_subdirectory(kernel)
|
||||
set_property(
|
||||
GLOBAL PROPERTY LD_SCRIPT_USER ${CMAKE_CURRENT_LIST_DIR}/scripts/memory.ld
|
||||
${CMAKE_CURRENT_LIST_DIR}/scripts/user-space.ld)
|
||||
endif()
|
||||
34
boards/arm/stm32u5/b-u585i-iot02a/src/CMakeLists.txt
Normal file
34
boards/arm/stm32u5/b-u585i-iot02a/src/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/stm32u5/b-u585i-iot02a/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS stm32_boot.c stm32_bringup.c stm32_spi.c)
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS stm32_appinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_BOARD_STM32U5_CUSTOM_CLOCKCONFIG)
|
||||
list(APPEND SRCS stm32_clockconfig.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
# TODO: make this the default and then allow boards to redefine
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/flash.ld")
|
||||
28
boards/arm/tiva/lm3s6965-ek/CMakeLists.txt
Normal file
28
boards/arm/tiva/lm3s6965-ek/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/tiva/lm3s6965-ek/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT CONFIG_BUILD_FLAT)
|
||||
add_subdirectory(kernel)
|
||||
set_property(
|
||||
GLOBAL PROPERTY LD_SCRIPT_USER ${CMAKE_CURRENT_LIST_DIR}/scripts/memory.ld
|
||||
${CMAKE_CURRENT_LIST_DIR}/scripts/user-space.ld)
|
||||
endif()
|
||||
40
boards/arm/tiva/lm3s6965-ek/src/CMakeLists.txt
Normal file
40
boards/arm/tiva/lm3s6965-ek/src/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
# ##############################################################################
|
||||
# boards/arm/tiva/lm3s6965-ek/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS lm_boot.c lm_leds.c lm_ethernet.c lm_ssi.c)
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS lm_appinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_NX_LCDDRIVER)
|
||||
list(APPEND SRCS lm_oled.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARD_LATE_INITIALIZE)
|
||||
list(APPEND SRCS lm_bringup.c)
|
||||
elseif(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS lm_bringup.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
# TODO: make this the default and then allow boards to redefine
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/ld.script")
|
||||
21
boards/sim/sim/sim/CMakeLists.txt
Normal file
21
boards/sim/sim/sim/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# ##############################################################################
|
||||
# boards/sim/sim/sim/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
add_subdirectory(src)
|
||||
@@ -6,7 +6,6 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ALLSYMS=y
|
||||
CONFIG_ARCH="sim"
|
||||
CONFIG_ARCH_BOARD="sim"
|
||||
CONFIG_ARCH_BOARD_SIM=y
|
||||
|
||||
79
boards/sim/sim/sim/src/CMakeLists.txt
Normal file
79
boards/sim/sim/sim/src/CMakeLists.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
# ##############################################################################
|
||||
# boards/sim/sim/sim/src/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
# CSRCS = dummy.c
|
||||
|
||||
if(CONFIG_BOARD_LATE_INITIALIZE)
|
||||
list(APPEND SRCS sim_boot.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS sim_appinit.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BOARD_LATE_INITIALIZE)
|
||||
list(APPEND SRCS sim_bringup.c)
|
||||
if(CONFIG_LIBC_ZONEINFO_ROMFS)
|
||||
list(APPEND SRCS sim_zoneinfo.c)
|
||||
endif()
|
||||
elseif(CONFIG_BOARDCTL)
|
||||
list(APPEND SRCS sim_bringup.c)
|
||||
if(CONFIG_LIBC_ZONEINFO_ROMFS)
|
||||
list(APPEND SRCS sim_zoneinfo.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_EXAMPLES_GPIO)
|
||||
if(CONFIG_GPIO_LOWER_HALF)
|
||||
list(APPEND SRCS sim_ioexpander.c)
|
||||
else()
|
||||
list(APPEND SRCS sim_gpio.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_BUTTONS)
|
||||
list(APPEND SRCS sim_buttons.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_MOTOR_FOC_DUMMY)
|
||||
list(APPEND SRCS sim_foc.c)
|
||||
endif()
|
||||
|
||||
target_sources(board PRIVATE ${SRCS})
|
||||
|
||||
set_property(GLOBAL PROPERTY LD_SCRIPT "${NUTTX_BOARD_DIR}/scripts/gnu-elf.ld")
|
||||
|
||||
if(CONFIG_NSH_ROMFSETC AND CONFIG_NSH_ARCHROMFS)
|
||||
nuttx_add_romfs(
|
||||
NAME
|
||||
etc
|
||||
MOUNTPOINT
|
||||
etc
|
||||
RCSRCS
|
||||
etc/init.d/rcS
|
||||
etc/init.d/rc.sysinit
|
||||
RCRAWS
|
||||
etc/group
|
||||
etc/passwd
|
||||
PATH
|
||||
${CMAKE_CURRENT_BINARY_DIR}/etc)
|
||||
|
||||
target_link_libraries(board PRIVATE romfs_etc)
|
||||
endif()
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user