diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt index bae93c7..483abcf 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt @@ -5,9 +5,7 @@ add_subdirectory(TARGET_NRF52) endif() -if("SDK_11" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_SDK_11) -elseif("SDK_15_0" IN_LIST MBED_TARGET_LABELS) +if("SDK_15_0" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_SDK_15_0) endif() diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt index e5a11bc..765e180 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt @@ -1,7 +1,9 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) +if("MCU_NRF52832" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52832) +elseif("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) add_subdirectory(TARGET_MCU_NRF52840) endif() diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/CMakeLists.txt new file mode 100644 index 0000000..adf9b9a --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NRF52_DK" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_NRF52_DK + ) +elseif("SDT52832B" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_SDT52832B + ) +endif() + +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52832.sct) + set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_nrf52832.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/NRF52832.ld) + set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52832.S) +endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + +target_include_directories(mbed-core + INTERFACE + . + config + device +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + + device/cmsis_nvic.c + device/system_nrf52.c + + ${STARTUP_FILE} +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct index b7aa36a..22c873c 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 /* Default to no softdevice */ #if !defined(MBED_APP_START) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt index 79114b7..e7b035d 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt @@ -1,20 +1,56 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("NRF52840_DK" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(TARGET_NRF52840_DK) +if ("ARDUINO_NANO33BLE" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_ARDUINO_NANO33BLE + ) +elseif("EP_AGORA" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_EP_AGORA + ) + target_sources(mbed-core + INTERFACE + TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp + ) +elseif("EP_ATLAS" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_EP_ATLAS + ) +elseif("NRF52840_DK" IN_LIST MBED_TARGET_LABELS) + target_include_directories(mbed-core + INTERFACE + TARGET_NRF52840_DK + ) endif() +if(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE device/TOOLCHAIN_ARM_STD/nRF52840.sct) + set(STARTUP_FILE device/TOOLCHAIN_ARM_STD/startup_nrf52840.S) +elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/NRF52840.ld) + set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_NRF52840.S) +endif() + +set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE}) + target_include_directories(mbed-core INTERFACE . - ./config + config + device ) target_sources(mbed-core INTERFACE PeripheralPins.c USBPhy_Nordic.cpp -) -add_subdirectory(device) + device/cmsis_nvic.c + device/system_nrf52840.c + + ${STARTUP_FILE} +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/CMakeLists.txt deleted file mode 100644 index 5c029cc..0000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-core - INTERFACE - . -) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/CMakeLists.txt deleted file mode 100644 index e81255d..0000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") - set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_NRF52840.S) - set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/NRF52840.ld) -elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") - set(STARTUP_FILE TOOLCHAIN_ARM_STD/startup_nrf52840.S) - set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM_STD/nRF52840.sct) -elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") - set(STARTUP_FILE TOOLCHAIN_IAR/startup_NRF52840_IAR.S) - set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/nRF52840.icf) -endif() - -set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) - -target_include_directories(mbed-core - INTERFACE - . -) - -target_sources(mbed-core - INTERFACE - ${STARTUP_FILE} - cmsis_nvic.c - system_nrf52840.c -) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_NONE/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_NONE/CMakeLists.txt index 2981edd..aa6d1b6 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_NONE/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_NONE/CMakeLists.txt @@ -4,9 +4,9 @@ target_include_directories(mbed-core INTERFACE - ./libraries - ./libraries/fstorage - ./nrf_soc_nosd/ + libraries + libraries/fstorage + nrf_soc_nosd ) target_sources(mbed-core diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/CMakeLists.txt index 18f2795..8d60cb7 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/CMakeLists.txt @@ -4,22 +4,22 @@ target_include_directories(mbed-core INTERFACE - ./libraries - ./libraries/atomic - ./libraries/atomic_fifo - ./libraries/balloc - ./libraries/delay - ./libraries/experimental_log - ./libraries/experimental_log/src - ./libraries/experimental_memobj - ./libraries/experimental_section_vars - ./libraries/fds - ./libraries/fstorage - ./libraries/queue - ./libraries/spi_mngr - ./libraries/strerror - ./libraries/twi_mngr - ./libraries/util + libraries + libraries/atomic + libraries/atomic_fifo + libraries/balloc + libraries/delay + libraries/experimental_log + libraries/experimental_log/src + libraries/experimental_memobj + libraries/experimental_section_vars + libraries/fds + libraries/fstorage + libraries/queue + libraries/spi_mngr + libraries/strerror + libraries/twi_mngr + libraries/util ) target_sources(mbed-core diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/integration/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/integration/CMakeLists.txt index f32d9bb..9196462 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/integration/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/integration/CMakeLists.txt @@ -4,9 +4,9 @@ target_include_directories(mbed-core INTERFACE . - ./nrfx - ./nrfx/legacy - ./nrfx/legacy/ble_flash + nrfx + nrfx/legacy + nrfx/legacy/ble_flash ) target_sources(mbed-core diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/CMakeLists.txt index 755dd40..65b9b27 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/CMakeLists.txt @@ -4,16 +4,16 @@ target_include_directories(mbed-core INTERFACE . - ./nrfx - ./nrfx/drivers - ./nrfx/drivers/include - ./nrfx/drivers/src - ./nrfx/drivers/src/prs - ./nrfx/hal - ./nrfx/mdk - ./nrfx/soc - ./softdevice - ./softdevice/common + nrfx + nrfx/drivers + nrfx/drivers/include + nrfx/drivers/src + nrfx/drivers/src/prs + nrfx/hal + nrfx/mdk + nrfx/soc + softdevice + softdevice/common ) target_sources(mbed-core diff --git a/tools/cmake/README.md b/tools/cmake/README.md index bc10cf3..117703e 100644 --- a/tools/cmake/README.md +++ b/tools/cmake/README.md @@ -19,7 +19,6 @@ Only a limited set of targets is supported at the moment. The following targets are supported: -- NRF52840_DK - Ambiq Micro targets - Analog Devices targets - ARM FM targets @@ -27,6 +26,7 @@ - Freescale targets - GigaDevice targets - MAXIM targets +- Nordic targets - NXP targets - Renesas targets - Samsung targets