diff --git a/.gitignore b/.gitignore index ad52c208f81..3da68113d33 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,8 @@ DELIVERY/ # Directory used to clone and build TF-M features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_IGNORE/ + +# CMake +CMakeCache.txt +cmake_install.cmake +CMakeFiles/ diff --git a/.travis.yml b/.travis.yml index 94999cfbe4b..90fd04d6d51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,14 +26,17 @@ env: cache: pip: true + ccache: true directories: - ${HOME}/.cache/deps - - ${HOME}/.ccache - before_install: - source tools/test/travis-ci/functions.sh +addons: + apt: + packages: + - ninja-build matrix: include: @@ -106,7 +109,6 @@ matrix: ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \ ':!*events/tests/*' ':!*drivers/tests/*' - ### Docs Tests ### - &docs-vm stage: "Docs" diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000000..b3c7d3f8c66 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,249 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This is the boilerplate for Mbed OS + +cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR) + +# Using relative paths behavior +if(POLICY CMP0076) + cmake_policy(SET CMP0076 NEW) +endif() + +include(${MBED_CONFIG_PATH}/mbed_config.cmake) +include(${MBED_PATH}/tools/cmake/core.cmake) + +add_library(mbed-core INTERFACE) + +add_library(mbed-os INTERFACE) + +target_link_libraries(mbed-os + INTERFACE + mbed-rtos + mbed-core +) + +add_library(mbed-baremetal INTERFACE) + +target_link_libraries(mbed-baremetal + INTERFACE + mbed-core +) + +# Validate selected C library type +# The C library type selected has to match the library that the target can support +if(${MBED_C_LIB} STREQUAL "small") + if(NOT "small" IN_LIST MBED_TARGET_SUPPORTED_C_LIBS) + if("std" IN_LIST MBED_TARGET_SUPPORTED_C_LIBS) + message(WARNING + "We noticed that target.c_lib is set to `${MBED_C_LIB}`." + " As the ${MBED_TARGET} target does not support a small C library for the ${MBED_TOOLCHAIN} toolchain," + " we are using the standard C library instead." + ) + set(MBED_C_LIB "std" CACHE STRING "") + endif() + endif() +elseif(NOT ${MBED_C_LIB} IN_LIST MBED_TARGET_SUPPORTED_C_LIBS) + message(FATAL_ERROR + "Invalid `target.c_lib` ('${MBED_C_LIB}') for '${MBED_TARGET}' target." + "\nPossible value(s): ${MBED_TARGET_SUPPORTED_C_LIBS}" + ) +endif() + +# Validate selected printf library +set(MBED_PRINTF_LIB_TYPES std minimal-printf) +if(NOT ${MBED_PRINTF_LIB} IN_LIST MBED_PRINTF_LIB_TYPES) + message(FATAL_ERROR + "Invalid printf library type '${MBED_PRINTF_LIB}'. Possible values:\n ${MBED_PRINTF_LIB_TYPES}" + ) +endif() + +mbed_set_cpu_core_definitions(mbed-core) +if(${MBED_TOOLCHAIN_FILE_USED}) + mbed_set_cpu_core_options(mbed-core ${MBED_TOOLCHAIN}) + mbed_set_toolchain_options(mbed-core) + mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN}) + mbed_set_c_lib(mbed-core ${MBED_C_LIB}) + mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB}) +endif() + + +set(MBED_TARGET_LABELS + ${MBED_TARGET_LABELS} CACHE INTERNAL "" +) + +target_compile_definitions(mbed-core + INTERFACE + ${MBED_TARGET_DEFINITIONS} + ${MBED_CONFIG_DEFINITIONS} +) + +# Add compile definitions for backward compatibility with the toolchain +# supported. New source files should instead check for __GNUC__ and __clang__ +# for the GCC_ARM and ARM toolchains respectively. +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + target_compile_definitions(mbed-core + INTERFACE + TOOLCHAIN_GCC_ARM + TOOLCHAIN_GCC + ) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + target_compile_definitions(mbed-core + INTERFACE + TOOLCHAIN_ARM + ) +endif() + +# Include mbed.h and config from generate folder +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# These targets are made visible here so their source files which +# are spread in different directories can be referenced and can be linked against +# by libraries that depend on them. +# TODO CMake: Should the source files be moved? +add_library(mbed-device_key INTERFACE) +add_library(mbed-rtos INTERFACE) + +add_subdirectory(cmsis) +add_subdirectory(drivers) +add_subdirectory(hal) +add_subdirectory(platform) +add_subdirectory(rtos) +add_subdirectory(targets) + +# The directories below contain optional target libraries +add_subdirectory(events EXCLUDE_FROM_ALL) +add_subdirectory(connectivity EXCLUDE_FROM_ALL) +add_subdirectory(storage EXCLUDE_FROM_ALL) +add_subdirectory(drivers/device_key EXCLUDE_FROM_ALL) +add_subdirectory(drivers/source/usb EXCLUDE_FROM_ALL) +add_subdirectory(features EXCLUDE_FROM_ALL) +add_subdirectory(platform/FEATURE_EXPERIMENTAL_API EXCLUDE_FROM_ALL) +add_subdirectory(cmsis/CMSIS_5/CMSIS/RTOS2 EXCLUDE_FROM_ALL) +add_subdirectory(cmsis/device/rtos EXCLUDE_FROM_ALL) + +# +# Configures the application +# +function(mbed_configure_app_target target) + mbed_set_language_standard(${target}) +endfunction() + +# +# Specifies linker script used for linking `target`. +# +function(mbed_set_mbed_target_linker_script target) + get_property(mbed_target_linker_script GLOBAL PROPERTY MBED_TARGET_LINKER_FILE) + if(MBED_TOOLCHAIN STREQUAL "GCC_ARM") + mbed_generate_gcc_options_for_linker(${target} _linker_preprocess_definitions) + set(CMAKE_PRE_BUILD_COMMAND + COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P + ${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${target}.link_script.ld + + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld" + ) + elseif(MBED_TOOLCHAIN STREQUAL "ARM") + set(CMAKE_PRE_BUILD_COMMAND COMMAND "") + target_link_options(mbed-core + INTERFACE + "--scatter=${mbed_target_linker_script}" + ) + endif() + add_custom_command( + TARGET + ${target} + PRE_LINK + ${CMAKE_PRE_BUILD_COMMAND} + COMMENT + "Link line:" + VERBATIM + ) +endfunction() + +# +# Converts output file of `target` to binary file and to Intel HEX file. +# +function(mbed_generate_bin_hex target) + get_property(elf_to_bin GLOBAL PROPERTY ELF2BIN) + if(MBED_TOOLCHAIN STREQUAL "GCC_ARM") + set(CMAKE_POST_BUILD_COMMAND + COMMAND ${elf_to_bin} -O binary $ ${CMAKE_BINARY_DIR}/${target}.bin + COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.bin" + COMMAND ${elf_to_bin} -O ihex $ ${CMAKE_BINARY_DIR}/${target}.hex + COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.hex" + ) + elseif(MBED_TOOLCHAIN STREQUAL "ARM") + get_property(mbed_studio_arm_compiler GLOBAL PROPERTY MBED_STUDIO_ARM_COMPILER) + set(CMAKE_POST_BUILD_COMMAND + COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --bin -o ${CMAKE_BINARY_DIR}/${target}.bin $ + COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.bin" + COMMAND ${elf_to_bin} ${mbed_studio_arm_compiler} --i32combined -o ${CMAKE_BINARY_DIR}/${target}.hex $ + COMMAND ${CMAKE_COMMAND} -E echo "-- built: ${CMAKE_BINARY_DIR}/${target}.hex" + ) + endif() + add_custom_command( + TARGET + ${target} + POST_BUILD + ${CMAKE_POST_BUILD_COMMAND} + COMMENT + "executable:" + VERBATIM + ) +endfunction() + +# +# Parse toolchain generated map file of `target` and display a readable table format. +# +function(mbed_generate_map_file target) + find_package (Python3) + add_custom_command( + TARGET + ${target} + POST_BUILD + COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR} + COMMENT + "Displaying memory map for ${target}" +) +endfunction() + +# +# Validate selected application profile. +# +function(mbed_validate_application_profile target) + get_target_property(app_link_libraries ${target} LINK_LIBRARIES) + string(FIND "${app_link_libraries}" "mbed-baremetal" string_found_position) + if(${string_found_position} GREATER_EQUAL 0) + if(NOT "bare-metal" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES) + message(FATAL_ERROR + "Use full profile as baremetal profile is not supported for this Mbed target") + endif() + elseif(NOT "full" IN_LIST MBED_TARGET_SUPPORTED_APPLICATION_PROFILES) + message(FATAL_ERROR + "The full profile is not supported for this Mbed target") + endif() +endfunction() + +# +# Set post build operations +# +function(mbed_set_post_build target) + mbed_validate_application_profile(${target}) + mbed_generate_bin_hex(${target}) + mbed_generate_map_file(${target}) +endfunction() + +# Ninja requires to be forced for response files +if ("${CMAKE_GENERATOR}" MATCHES "Ninja") + # known issue ARMClang and Ninja with response files for windows + # https://gitlab.kitware.com/cmake/cmake/-/issues/21093 + if(NOT (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES "ARMClang")) + set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "") + endif() +endif() diff --git a/cmsis/CMSIS_5/CMSIS/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/CMakeLists.txt new file mode 100644 index 00000000000..6d0f9bb5482 --- /dev/null +++ b/cmsis/CMSIS_5/CMSIS/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("CORTEX_A" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_A) +elseif("CORTEX_M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_M) +endif() + diff --git a/cmsis/CMSIS_5/CMSIS/RTOS2/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/RTOS2/CMakeLists.txt new file mode 100644 index 00000000000..5953cc598e5 --- /dev/null +++ b/cmsis/CMSIS_5/CMSIS/RTOS2/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(RTX) + +target_include_directories(mbed-rtos + INTERFACE + Include +) + +target_sources(mbed-rtos + INTERFACE + Source/os_systick.c + Source/os_tick_ptim.c +) diff --git a/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt new file mode 100644 index 00000000000..24d9f345c3d --- /dev/null +++ b/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt @@ -0,0 +1,74 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_cortex_m_exception_handlers toolchain_dir) + foreach(key ${MBED_TARGET_LABELS}) + if(${key} STREQUAL CORTEX_A) + set(STARTUP_RTX_FILE TARGET_CORTEX_A/irq_ca.S) + elseif(${key} STREQUAL M0) + set(STARTUP_RTX_FILE TARGET_M0/irq_cm0.S) + elseif(${key} STREQUAL M0P) + set(STARTUP_RTX_FILE TARGET_M0P/irq_cm0.S) + elseif(${key} STREQUAL M23) + set(STARTUP_RTX_FILE TARGET_M23/irq_armv8mbl.S) + elseif(${key} STREQUAL M3) + set(STARTUP_RTX_FILE TARGET_M3/irq_cm3.S) + elseif(${key} STREQUAL M33) + set(STARTUP_RTX_FILE TARGET_M33/irq_armv8mml.S) + elseif(${key} STREQUAL RTOS_M4_M7) + set(STARTUP_RTX_FILE TARGET_RTOS_M4_M7/irq_cm4f.S) + endif() + + target_sources(mbed-rtos + INTERFACE + Source/${toolchain_dir}/${STARTUP_RTX_FILE} + ) + endforeach() +endfunction() + +function(_mbed_get_cortex_a_exception_handlers) + foreach(key ${MBED_TARGET_LABELS}) + if(${key} STREQUAL CORTEX_A) + target_sources(mbed-rtos INTERFACE Config/TARGET_CORTEX_A/handlers.c) + endif() + endforeach() +endfunction() + +_mbed_get_cortex_a_exception_handlers() + +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_ARM) +elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + _mbed_get_cortex_m_exception_handlers(TOOLCHAIN_IAR) +endif() + +target_include_directories(mbed-rtos + INTERFACE + Config + Include + Include1 + Source +) + +target_sources(mbed-rtos + INTERFACE + Config/RTX_Config.c + + Library/cmsis_os1.c + + Source/rtx_delay.c + Source/rtx_evflags.c + Source/rtx_evr.c + Source/rtx_kernel.c + Source/rtx_lib.c + Source/rtx_memory.c + Source/rtx_mempool.c + Source/rtx_msgqueue.c + Source/rtx_mutex.c + Source/rtx_semaphore.c + Source/rtx_system.c + Source/rtx_thread.c + Source/rtx_timer.c +) diff --git a/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_A/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_A/CMakeLists.txt new file mode 100644 index 00000000000..d31ef5d4ab7 --- /dev/null +++ b/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_A/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + Include +) + +target_sources(mbed-core + INTERFACE + Source/irq_ctrl_gic.c +) diff --git a/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/CMakeLists.txt b/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/CMakeLists.txt new file mode 100644 index 00000000000..f13c8c6ce83 --- /dev/null +++ b/cmsis/CMSIS_5/CMSIS/TARGET_CORTEX_M/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + Include +) + +target_sources(mbed-core + INTERFACE + Source/mbed_tz_context.c +) diff --git a/cmsis/CMSIS_5/CMakeLists.txt b/cmsis/CMSIS_5/CMakeLists.txt new file mode 100644 index 00000000000..47b2183f3f7 --- /dev/null +++ b/cmsis/CMSIS_5/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(CMSIS) diff --git a/cmsis/CMakeLists.txt b/cmsis/CMakeLists.txt new file mode 100644 index 00000000000..b2442a67a1b --- /dev/null +++ b/cmsis/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(CMSIS_5) +add_subdirectory(device) + diff --git a/cmsis/device/CMakeLists.txt b/cmsis/device/CMakeLists.txt new file mode 100644 index 00000000000..d968802881b --- /dev/null +++ b/cmsis/device/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(RTE) + +target_include_directories(mbed-core + INTERFACE + . +) diff --git a/cmsis/device/RTE/CMakeLists.txt b/cmsis/device/RTE/CMakeLists.txt new file mode 100644 index 00000000000..f51bf2378f5 --- /dev/null +++ b/cmsis/device/RTE/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + include +) diff --git a/cmsis/device/rtos/CMakeLists.txt b/cmsis/device/rtos/CMakeLists.txt new file mode 100644 index 00000000000..27e0c374b95 --- /dev/null +++ b/cmsis/device/rtos/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + target_sources(mbed-rtos + INTERFACE + TOOLCHAIN_GCC_ARM/mbed_boot_gcc_arm.c + ) +elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + target_sources(mbed-rtos + INTERFACE + TOOLCHAIN_ARM_STD/mbed_boot_arm_std.c + ) +elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + target_sources(mbed-rtos + INTERFACE + TOOLCHAIN_IAR/mbed_boot_iar.c + ) +endif() + +target_include_directories(mbed-rtos + INTERFACE + include +) + +target_sources(mbed-rtos + INTERFACE + source/mbed_boot.c + source/mbed_rtos_rtx.c + source/mbed_rtx_handlers.c + source/mbed_rtx_idle.cpp +) + +target_compile_definitions(mbed-rtos + INTERFACE + MBED_CONF_RTOS_PRESENT=1 +) diff --git a/connectivity/CMakeLists.txt b/connectivity/CMakeLists.txt new file mode 100644 index 00000000000..9c3c1c7e0fe --- /dev/null +++ b/connectivity/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# List of all connectivity libraries available. +add_library(mbed-802.15.4-rf INTERFACE) +add_library(mbed-ble INTERFACE) +add_library(mbed-ble-blue_nrg INTERFACE) +add_library(mbed-ble-cordio INTERFACE) +add_library(mbed-ble-cordio_ll INTERFACE) +add_library(mbed-cellular INTERFACE) +add_library(mbed-coap INTERFACE) +add_library(mbed-emac INTERFACE) +add_library(mbed-lorawan INTERFACE) +add_library(mbed-lwipstack INTERFACE) +add_library(mbed-mbedtls INTERFACE) +add_library(mbed-mbedtls-cryptocell310 INTERFACE) +add_library(mbed-nanostack INTERFACE) +add_library(mbed-nanostack-coap_service INTERFACE) +add_library(mbed-nanostack-mbed_mesh_api INTERFACE) +add_library(mbed-nanostack-hal_mbed_cmsis_rtos INTERFACE) +add_library(mbed-nanostack-sal_stack INTERFACE) +add_library(mbed-nanostack-sal_stack-event_loop INTERFACE) +add_library(mbed-nanostack-libservice INTERFACE) +add_library(mbed-netsocket INTERFACE) +add_library(mbed-nfc INTERFACE) +add_library(mbed-ppp INTERFACE) +add_library(mbed-wifi INTERFACE) + + +add_subdirectory(FEATURE_BLE) +add_subdirectory(cellular) +add_subdirectory(drivers) +add_subdirectory(libraries) +add_subdirectory(lorawan) +add_subdirectory(lwipstack) +add_subdirectory(mbedtls) +add_subdirectory(nanostack) +add_subdirectory(netsocket) +add_subdirectory(nfc) diff --git a/connectivity/FEATURE_BLE/CMakeLists.txt b/connectivity/FEATURE_BLE/CMakeLists.txt new file mode 100644 index 00000000000..c2e0c02d2df --- /dev/null +++ b/connectivity/FEATURE_BLE/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(libraries) +add_subdirectory(source) + +target_include_directories(mbed-ble + INTERFACE + . + include + include/ble + include/ble/common + include/ble/common/ble + include/ble/common/ble/gap + include/ble/compatibility + include/ble/compatibility/ble + include/ble/driver + include/ble/gap + include/ble/gatt + include/ble/services + source +) + +target_compile_definitions(mbed-ble + INTERFACE + MBED_CONF_BLE_PRESENT=1 +) diff --git a/connectivity/FEATURE_BLE/libraries/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/CMakeLists.txt new file mode 100644 index 00000000000..7e649d8df14 --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("CORDIO_LL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORDIO_LL) +endif() + +add_subdirectory(cordio_stack) + +target_include_directories(mbed-ble-cordio + INTERFACE + . +) + +target_link_libraries(mbed-ble-cordio + INTERFACE + mbed-ble +) diff --git a/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt new file mode 100644 index 00000000000..ea4d4ea0fad --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/TARGET_CORDIO_LL/CMakeLists.txt @@ -0,0 +1,327 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio_ll + INTERFACE + . + ./stack + ./stack/controller + ./stack/controller/include + ./stack/controller/include/ble + ./stack/controller/include/common + ./stack/controller/sources/ble/bb + ./stack/controller/sources/ble/include + ./stack/controller/sources/ble/lctr + ./stack/controller/sources/ble/lhci + ./stack/controller/sources/ble/sch + ./stack/controller/sources/common/bb + ./stack/controller/sources/common/sch + ./stack/thirdparty + ./stack/thirdparty/nordic-bsp/components/boards + ./stack/thirdparty/uecc + ./stack_adaptation +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/bb/bb_ble_adv_master.c + stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c + stack/controller/sources/ble/bb/bb_ble_adv_slave.c + stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c + stack/controller/sources/ble/bb/bb_ble_bis_master.c + stack/controller/sources/ble/bb/bb_ble_bis_slave.c + stack/controller/sources/ble/bb/bb_ble_cis.c + stack/controller/sources/ble/bb/bb_ble_cis_master.c + stack/controller/sources/ble/bb/bb_ble_cis_slave.c + stack/controller/sources/ble/bb/bb_ble_conn.c + stack/controller/sources/ble/bb/bb_ble_conn_master.c + stack/controller/sources/ble/bb/bb_ble_conn_slave.c + stack/controller/sources/ble/bb/bb_ble_dtm.c + stack/controller/sources/ble/bb/bb_ble_main.c + stack/controller/sources/ble/bb/bb_ble_pdufilt.c + stack/controller/sources/ble/bb/bb_ble_periodiclist.c + stack/controller/sources/ble/bb/bb_ble_reslist.c + stack/controller/sources/ble/bb/bb_ble_sniffer.c + stack/controller/sources/ble/bb/bb_ble_whitelist.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/init/init.c + stack/controller/sources/ble/init/init_ctr.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/lctr/lctr_act_adv_master.c + stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c + stack/controller/sources/ble/lctr/lctr_act_adv_slave.c + stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c + stack/controller/sources/ble/lctr/lctr_act_bis_master.c + stack/controller/sources/ble/lctr/lctr_act_bis_slave.c + stack/controller/sources/ble/lctr/lctr_act_cis.c + stack/controller/sources/ble/lctr/lctr_act_cis_master.c + stack/controller/sources/ble/lctr/lctr_act_cis_slave.c + stack/controller/sources/ble/lctr/lctr_act_conn.c + stack/controller/sources/ble/lctr/lctr_act_conn_master.c + stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c + stack/controller/sources/ble/lctr/lctr_act_conn_past.c + stack/controller/sources/ble/lctr/lctr_act_enc.c + stack/controller/sources/ble/lctr/lctr_act_enc_master.c + stack/controller/sources/ble/lctr/lctr_act_init_master.c + stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c + stack/controller/sources/ble/lctr/lctr_act_pc.c + stack/controller/sources/ble/lctr/lctr_act_phy.c + stack/controller/sources/ble/lctr/lctr_isr_adv_master.c + stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c + stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c + stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c + stack/controller/sources/ble/lctr/lctr_isr_bis_master.c + stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c + stack/controller/sources/ble/lctr/lctr_isr_cis.c + stack/controller/sources/ble/lctr/lctr_isr_cis_master.c + stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c + stack/controller/sources/ble/lctr/lctr_isr_conn.c + stack/controller/sources/ble/lctr/lctr_isr_conn_master.c + stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c + stack/controller/sources/ble/lctr/lctr_isr_init_master.c + stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c + stack/controller/sources/ble/lctr/lctr_main.c + stack/controller/sources/ble/lctr/lctr_main_adv_master.c + stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c + stack/controller/sources/ble/lctr/lctr_main_adv_slave.c + stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c + stack/controller/sources/ble/lctr/lctr_main_bis.c + stack/controller/sources/ble/lctr/lctr_main_bis_master.c + stack/controller/sources/ble/lctr/lctr_main_bis_slave.c + stack/controller/sources/ble/lctr/lctr_main_cis.c + stack/controller/sources/ble/lctr/lctr_main_cis_master.c + stack/controller/sources/ble/lctr/lctr_main_cis_slave.c + stack/controller/sources/ble/lctr/lctr_main_conn.c + stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c + stack/controller/sources/ble/lctr/lctr_main_conn_data.c + stack/controller/sources/ble/lctr/lctr_main_conn_master.c + stack/controller/sources/ble/lctr/lctr_main_conn_slave.c + stack/controller/sources/ble/lctr/lctr_main_enc_master.c + stack/controller/sources/ble/lctr/lctr_main_enc_slave.c + stack/controller/sources/ble/lctr/lctr_main_init_master.c + stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c + stack/controller/sources/ble/lctr/lctr_main_iso.c + stack/controller/sources/ble/lctr/lctr_main_iso_data.c + stack/controller/sources/ble/lctr/lctr_main_master_phy.c + stack/controller/sources/ble/lctr/lctr_main_past.c + stack/controller/sources/ble/lctr/lctr_main_pc.c + stack/controller/sources/ble/lctr/lctr_main_priv.c + stack/controller/sources/ble/lctr/lctr_main_sc.c + stack/controller/sources/ble/lctr/lctr_main_slave_phy.c + stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c + stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c + stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c + stack/controller/sources/ble/lctr/lctr_pdu_bis.c + stack/controller/sources/ble/lctr/lctr_pdu_conn.c + stack/controller/sources/ble/lctr/lctr_pdu_enc.c + stack/controller/sources/ble/lctr/lctr_pdu_iso.c + stack/controller/sources/ble/lctr/lctr_sm_adv_master.c + stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c + stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c + stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c + stack/controller/sources/ble/lctr/lctr_sm_bis_master.c + stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c + stack/controller/sources/ble/lctr/lctr_sm_cis.c + stack/controller/sources/ble/lctr/lctr_sm_conn_master.c + stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c + stack/controller/sources/ble/lctr/lctr_sm_init_master.c + stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c + stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/lhci/lhci_cmd.c + stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c + stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c + stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c + stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c + stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c + stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c + stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_conn.c + stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c + stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c + stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c + stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c + stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_iso.c + stack/controller/sources/ble/lhci/lhci_cmd_past.c + stack/controller/sources/ble/lhci/lhci_cmd_pc.c + stack/controller/sources/ble/lhci/lhci_cmd_phy.c + stack/controller/sources/ble/lhci/lhci_cmd_sc.c + stack/controller/sources/ble/lhci/lhci_cmd_vs.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c + stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c + stack/controller/sources/ble/lhci/lhci_evt.c + stack/controller/sources/ble/lhci/lhci_evt_adv_master.c + stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c + stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c + stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c + stack/controller/sources/ble/lhci/lhci_evt_bis_master.c + stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c + stack/controller/sources/ble/lhci/lhci_evt_cis_master.c + stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c + stack/controller/sources/ble/lhci/lhci_evt_conn.c + stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c + stack/controller/sources/ble/lhci/lhci_evt_conn_master.c + stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c + stack/controller/sources/ble/lhci/lhci_evt_enc_master.c + stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c + stack/controller/sources/ble/lhci/lhci_evt_iso.c + stack/controller/sources/ble/lhci/lhci_evt_pc.c + stack/controller/sources/ble/lhci/lhci_evt_phy.c + stack/controller/sources/ble/lhci/lhci_evt_sc.c + stack/controller/sources/ble/lhci/lhci_evt_vs.c + stack/controller/sources/ble/lhci/lhci_init.c + stack/controller/sources/ble/lhci/lhci_init_adv_master.c + stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c + stack/controller/sources/ble/lhci/lhci_init_adv_priv.c + stack/controller/sources/ble/lhci/lhci_init_adv_slave.c + stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c + stack/controller/sources/ble/lhci/lhci_init_bis_master.c + stack/controller/sources/ble/lhci/lhci_init_bis_slave.c + stack/controller/sources/ble/lhci/lhci_init_cis_master.c + stack/controller/sources/ble/lhci/lhci_init_cis_slave.c + stack/controller/sources/ble/lhci/lhci_init_conn.c + stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c + stack/controller/sources/ble/lhci/lhci_init_conn_master.c + stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c + stack/controller/sources/ble/lhci/lhci_init_conn_priv.c + stack/controller/sources/ble/lhci/lhci_init_enc_master.c + stack/controller/sources/ble/lhci/lhci_init_enc_slave.c + stack/controller/sources/ble/lhci/lhci_init_iso.c + stack/controller/sources/ble/lhci/lhci_init_past.c + stack/controller/sources/ble/lhci/lhci_init_pc.c + stack/controller/sources/ble/lhci/lhci_init_phy.c + stack/controller/sources/ble/lhci/lhci_init_sc.c + stack/controller/sources/ble/lhci/lhci_main.c + stack/controller/sources/ble/lhci/lhci_main_iso.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/ll/ll_init.c + stack/controller/sources/ble/ll/ll_init_adv_master.c + stack/controller/sources/ble/ll/ll_init_adv_master_ae.c + stack/controller/sources/ble/ll/ll_init_adv_slave.c + stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c + stack/controller/sources/ble/ll/ll_init_bis_master.c + stack/controller/sources/ble/ll/ll_init_bis_slave.c + stack/controller/sources/ble/ll/ll_init_cis_master.c + stack/controller/sources/ble/ll/ll_init_cis_slave.c + stack/controller/sources/ble/ll/ll_init_conn_cs2.c + stack/controller/sources/ble/ll/ll_init_conn_master.c + stack/controller/sources/ble/ll/ll_init_conn_slave.c + stack/controller/sources/ble/ll/ll_init_enc_master.c + stack/controller/sources/ble/ll/ll_init_enc_slave.c + stack/controller/sources/ble/ll/ll_init_init_master.c + stack/controller/sources/ble/ll/ll_init_init_master_ae.c + stack/controller/sources/ble/ll/ll_init_iso.c + stack/controller/sources/ble/ll/ll_init_master_phy.c + stack/controller/sources/ble/ll/ll_init_past.c + stack/controller/sources/ble/ll/ll_init_pc.c + stack/controller/sources/ble/ll/ll_init_priv.c + stack/controller/sources/ble/ll/ll_init_sc.c + stack/controller/sources/ble/ll/ll_init_slave_phy.c + stack/controller/sources/ble/ll/ll_main.c + stack/controller/sources/ble/ll/ll_main_adv_master.c + stack/controller/sources/ble/ll/ll_main_adv_master_ae.c + stack/controller/sources/ble/ll/ll_main_adv_slave.c + stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c + stack/controller/sources/ble/ll/ll_main_bis_master.c + stack/controller/sources/ble/ll/ll_main_bis_slave.c + stack/controller/sources/ble/ll/ll_main_cis_master.c + stack/controller/sources/ble/ll/ll_main_cis_slave.c + stack/controller/sources/ble/ll/ll_main_conn.c + stack/controller/sources/ble/ll/ll_main_conn_master.c + stack/controller/sources/ble/ll/ll_main_conn_master_ae.c + stack/controller/sources/ble/ll/ll_main_conn_slave.c + stack/controller/sources/ble/ll/ll_main_diag.c + stack/controller/sources/ble/ll/ll_main_dtm.c + stack/controller/sources/ble/ll/ll_main_enc_master.c + stack/controller/sources/ble/ll/ll_main_enc_slave.c + stack/controller/sources/ble/ll/ll_main_iso.c + stack/controller/sources/ble/ll/ll_main_past.c + stack/controller/sources/ble/ll/ll_main_pc.c + stack/controller/sources/ble/ll/ll_main_phy.c + stack/controller/sources/ble/ll/ll_main_priv.c + stack/controller/sources/ble/ll/ll_main_sc.c + stack/controller/sources/ble/ll/ll_math.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/lmgr/lmgr_events.c + stack/controller/sources/ble/lmgr/lmgr_main.c + stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c + stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c + stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c + stack/controller/sources/ble/lmgr/lmgr_main_conn.c + stack/controller/sources/ble/lmgr/lmgr_main_iso.c + stack/controller/sources/ble/lmgr/lmgr_main_master.c + stack/controller/sources/ble/lmgr/lmgr_main_priv.c + stack/controller/sources/ble/lmgr/lmgr_main_sc.c + stack/controller/sources/ble/lmgr/lmgr_main_slave.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/ble/sch/sch_ble.c + stack/controller/sources/ble/sch/sch_rm.c + stack/controller/sources/ble/sch/sch_tm.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/controller/sources/common/bb/bb_main.c + + stack/controller/sources/common/chci/chci_tr.c + + stack/controller/sources/common/sch/sch_list.c + stack/controller/sources/common/sch/sch_main.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack/thirdparty/nordic-bsp/components/boards/boards.c + + stack/thirdparty/uecc/asm_arm.inc + stack/thirdparty/uecc/uECC.c + stack/thirdparty/uecc/uECC_ll.c +) + +target_sources(mbed-ble-cordio_ll + INTERFACE + stack_adaptation/custom_chci_tr.cpp +) + +target_link_libraries(mbed-ble-cordio_ll + INTERFACE + mbed-ble-cordio +) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/CMakeLists.txt new file mode 100644 index 00000000000..723954460d2 --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(ble-host) +add_subdirectory(platform) +add_subdirectory(wsf) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt new file mode 100644 index 00000000000..3be9fea4052 --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/ble-host/CMakeLists.txt @@ -0,0 +1,119 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio + INTERFACE + include + sources/hci/dual_chip + sources/sec/common + sources/stack/att + sources/stack/cfg + sources/stack/dm + sources/stack/hci + sources/stack/l2c + sources/stack/smp +) + +target_sources(mbed-ble-cordio + INTERFACE + sources/hci/common/hci_core.c + + sources/hci/dual_chip/hci_cmd.c + sources/hci/dual_chip/hci_cmd_ae.c + sources/hci/dual_chip/hci_cmd_bis.c + sources/hci/dual_chip/hci_cmd_cis.c + sources/hci/dual_chip/hci_cmd_cte.c + sources/hci/dual_chip/hci_cmd_iso.c + sources/hci/dual_chip/hci_cmd_past.c + sources/hci/dual_chip/hci_cmd_phy.c + sources/hci/dual_chip/hci_core_ps.c + sources/hci/dual_chip/hci_evt.c + sources/hci/dual_chip/hci_vs_ae.c + + sources/sec/common/sec_aes.c + sources/sec/common/sec_aes_rev.c + sources/sec/common/sec_ccm_hci.c + sources/sec/common/sec_cmac_hci.c + sources/sec/common/sec_ecc_debug.c + sources/sec/common/sec_ecc_hci.c + sources/sec/common/sec_main.c + + sources/stack/att/att_eatt.c + sources/stack/att/att_main.c + sources/stack/att/att_uuid.c + sources/stack/att/attc_disc.c + sources/stack/att/attc_eatt.c + sources/stack/att/attc_main.c + sources/stack/att/attc_proc.c + sources/stack/att/attc_read.c + sources/stack/att/attc_sign.c + sources/stack/att/attc_write.c + sources/stack/att/atts_ccc.c + sources/stack/att/atts_csf.c + sources/stack/att/atts_dyn.c + sources/stack/att/atts_eatt.c + sources/stack/att/atts_ind.c + sources/stack/att/atts_main.c + sources/stack/att/atts_proc.c + sources/stack/att/atts_read.c + sources/stack/att/atts_sign.c + sources/stack/att/atts_write.c + + sources/stack/cfg/cfg_stack.c + + sources/stack/dm/dm_adv.c + sources/stack/dm/dm_adv_ae.c + sources/stack/dm/dm_adv_leg.c + sources/stack/dm/dm_bis_master.c + sources/stack/dm/dm_bis_slave.c + sources/stack/dm/dm_cis.c + sources/stack/dm/dm_cis_master.c + sources/stack/dm/dm_cis_slave.c + sources/stack/dm/dm_cis_sm.c + sources/stack/dm/dm_conn.c + sources/stack/dm/dm_conn_cte.c + sources/stack/dm/dm_conn_master.c + sources/stack/dm/dm_conn_master_ae.c + sources/stack/dm/dm_conn_master_leg.c + sources/stack/dm/dm_conn_slave.c + sources/stack/dm/dm_conn_slave_ae.c + sources/stack/dm/dm_conn_slave_leg.c + sources/stack/dm/dm_conn_sm.c + sources/stack/dm/dm_dev.c + sources/stack/dm/dm_dev_priv.c + sources/stack/dm/dm_iso.c + sources/stack/dm/dm_main.c + sources/stack/dm/dm_past.c + sources/stack/dm/dm_phy.c + sources/stack/dm/dm_priv.c + sources/stack/dm/dm_scan.c + sources/stack/dm/dm_scan_ae.c + sources/stack/dm/dm_scan_leg.c + sources/stack/dm/dm_sec.c + sources/stack/dm/dm_sec_lesc.c + sources/stack/dm/dm_sec_master.c + sources/stack/dm/dm_sec_slave.c + sources/stack/dm/dm_sync_ae.c + + sources/stack/hci/hci_main.c + + sources/stack/l2c/l2c_coc.c + sources/stack/l2c/l2c_main.c + sources/stack/l2c/l2c_master.c + sources/stack/l2c/l2c_slave.c + + sources/stack/smp/smp_act.c + sources/stack/smp/smp_db.c + sources/stack/smp/smp_main.c + sources/stack/smp/smp_non.c + sources/stack/smp/smp_sc_act.c + sources/stack/smp/smp_sc_main.c + sources/stack/smp/smpi_act.c + sources/stack/smp/smpi_sc_act.c + sources/stack/smp/smpi_sc_sm.c + sources/stack/smp/smpi_sm.c + sources/stack/smp/smpr_act.c + sources/stack/smp/smpr_sc_act.c + sources/stack/smp/smpr_sc_sm.c + sources/stack/smp/smpr_sm.c +) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt new file mode 100644 index 00000000000..ebdae04f20e --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/platform/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio + INTERFACE + include +) diff --git a/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt b/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt new file mode 100644 index 00000000000..cc885d27b6b --- /dev/null +++ b/connectivity/FEATURE_BLE/libraries/cordio_stack/wsf/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio + INTERFACE + include + include/util +) + +target_sources(mbed-ble-cordio + INTERFACE + sources/port/baremetal/wsf_assert.c + sources/port/baremetal/wsf_buf.c + sources/port/baremetal/wsf_bufio.c + sources/port/baremetal/wsf_detoken.c + sources/port/baremetal/wsf_efs.c + sources/port/baremetal/wsf_heap.c + sources/port/baremetal/wsf_msg.c + sources/port/baremetal/wsf_queue.c + sources/port/baremetal/wsf_timer.c + sources/port/baremetal/wsf_trace.c + + sources/util/bda.c + sources/util/bstream.c + sources/util/calc128.c + sources/util/crc32.c + sources/util/fcs.c + sources/util/prand.c + sources/util/print.c + sources/util/terminal.c + sources/util/wstr.c +) diff --git a/connectivity/FEATURE_BLE/source/CMakeLists.txt b/connectivity/FEATURE_BLE/source/CMakeLists.txt new file mode 100644 index 00000000000..1ee562c4fcc --- /dev/null +++ b/connectivity/FEATURE_BLE/source/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(cordio) +add_subdirectory(gap) +add_subdirectory(gatt) +add_subdirectory(generic) +add_subdirectory(pal) + +target_sources(mbed-ble + INTERFACE + BLE.cpp + Gap.cpp + GattClient.cpp + GattServer.cpp + SecurityManager.cpp +) diff --git a/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt b/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt new file mode 100644 index 00000000000..3831ffbef1a --- /dev/null +++ b/connectivity/FEATURE_BLE/source/cordio/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio + INTERFACE + . + source + stack_adaptation +) + +target_sources(mbed-ble-cordio + INTERFACE + driver/CordioHCIDriver.cpp + driver/CordioHCITransportDriver.cpp + driver/H4TransportDriver.cpp + + source/BLEInstanceBaseImpl.cpp + source/GattServerImpl.cpp + source/PalAttClientImpl.cpp + source/PalEventQueueImpl.cpp + source/PalGapImpl.cpp + source/PalGenericAccessServiceImpl.cpp + source/PalPrivateAddressControllerImpl.cpp + source/PalSecurityManagerImpl.cpp + + stack_adaptation/hci_tr.c + stack_adaptation/hci_vs.c + stack_adaptation/pal_mbed_os_adaptation.cpp + stack_adaptation/wsf_cs.c + stack_adaptation/wsf_mbed_os_adaptation.c + stack_adaptation/wsf_os.c +) diff --git a/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt b/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt new file mode 100644 index 00000000000..e7918d9218d --- /dev/null +++ b/connectivity/FEATURE_BLE/source/gap/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + AdvertisingDataBuilder.cpp + AdvertisingParameters.cpp + ConnectionParameters.cpp +) diff --git a/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt b/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt new file mode 100644 index 00000000000..0301c4a3faf --- /dev/null +++ b/connectivity/FEATURE_BLE/source/gatt/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + DiscoveredCharacteristic.cpp +) diff --git a/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt b/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt new file mode 100644 index 00000000000..eec11d5e4c9 --- /dev/null +++ b/connectivity/FEATURE_BLE/source/generic/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble + INTERFACE + . +) + +target_sources(mbed-ble + INTERFACE + FileSecurityDb.cpp + GapImpl.cpp + GattClientImpl.cpp + KVStoreSecurityDb.cpp + PrivateAddressController.cpp + SecurityManagerImpl.cpp +) diff --git a/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt b/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt new file mode 100644 index 00000000000..0681fd1fef3 --- /dev/null +++ b/connectivity/FEATURE_BLE/source/pal/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble + INTERFACE + . +) + +target_sources(mbed-ble + INTERFACE + PalAttClientToGattClient.cpp +) diff --git a/connectivity/cellular/CMakeLists.txt b/connectivity/cellular/CMakeLists.txt new file mode 100644 index 00000000000..636235f0def --- /dev/null +++ b/connectivity/cellular/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(source/framework) + +target_include_directories(mbed-cellular + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/API + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/AT + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/common + ${CMAKE_CURRENT_SOURCE_DIR}/include/cellular/framework/device +) + +target_compile_definitions(mbed-cellular + INTERFACE + MBED_CONF_CELLULAR_PRESENT=1 +) + +target_link_libraries(mbed-cellular + INTERFACE + mbed-netsocket + mbed-core +) diff --git a/connectivity/cellular/source/framework/AT/CMakeLists.txt b/connectivity/cellular/source/framework/AT/CMakeLists.txt new file mode 100644 index 00000000000..f9bfcb1889b --- /dev/null +++ b/connectivity/cellular/source/framework/AT/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-cellular + INTERFACE + AT_CellularContext.cpp + AT_CellularDevice.cpp + AT_CellularInformation.cpp + AT_CellularNetwork.cpp + AT_CellularSMS.cpp + AT_CellularStack.cpp + AT_ControlPlane_netif.cpp +) diff --git a/connectivity/cellular/source/framework/CMakeLists.txt b/connectivity/cellular/source/framework/CMakeLists.txt new file mode 100644 index 00000000000..08ce155f45f --- /dev/null +++ b/connectivity/cellular/source/framework/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(AT) +add_subdirectory(common) +add_subdirectory(device) diff --git a/connectivity/cellular/source/framework/common/CMakeLists.txt b/connectivity/cellular/source/framework/common/CMakeLists.txt new file mode 100644 index 00000000000..2edcac94cf7 --- /dev/null +++ b/connectivity/cellular/source/framework/common/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-cellular + INTERFACE + APN_db.cpp + CellularLog.cpp + CellularUtil.cpp +) diff --git a/connectivity/cellular/source/framework/device/CMakeLists.txt b/connectivity/cellular/source/framework/device/CMakeLists.txt new file mode 100644 index 00000000000..289337f1560 --- /dev/null +++ b/connectivity/cellular/source/framework/device/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-cellular + INTERFACE + ATHandler.cpp + CellularContext.cpp + CellularDevice.cpp + CellularStateMachine.cpp +) diff --git a/connectivity/drivers/802.15.4_RF/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/CMakeLists.txt new file mode 100644 index 00000000000..ecce6c4d717 --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("Freescale" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Freescale) + add_subdirectory(mcr20a-rf-driver) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(stm-s2lp-rf-driver) +endif() + +add_subdirectory(atmel-rf-driver) + +target_link_libraries(mbed-802.15.4-rf + INTERFACE + mbed-nanostack +) diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt new file mode 100644 index 00000000000..223293d7fd8 --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("KW41Z" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_KW41Z) +endif() diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt new file mode 100644 index 00000000000..5fd0224ed1d --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/TARGET_Freescale/TARGET_KW41Z/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-802.15.4-rf + INTERFACE + . +) + +target_sources(mbed-802.15.4-rf + INTERFACE + NanostackRfPhyKw41z.cpp +) diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt new file mode 100644 index 00000000000..2185e82a9dd --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SL_RAIL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SL_RAIL) +endif() diff --git a/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt new file mode 100644 index 00000000000..172a2f9d221 --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/TARGET_Silicon_Labs/TARGET_SL_RAIL/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-802.15.4-rf + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-802.15.4-rf + INTERFACE + NanostackRfPhyEfr32.cpp +) diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt new file mode 100644 index 00000000000..b716ca710c4 --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-802.15.4-rf + INTERFACE + atmel-rf-driver + source +) + +target_sources(mbed-802.15.4-rf + INTERFACE + source/NanostackRfPhyAT86RF215.cpp + source/NanostackRfPhyAtmel.cpp + source/at24mac.cpp +) diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt new file mode 100644 index 00000000000..a29383253d0 --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-802.15.4-rf + INTERFACE + mcr20a-rf-driver + source +) + +target_sources(mbed-802.15.4-rf + INTERFACE + source/MCR20Drv.c + source/NanostackRfPhyMcr20a.cpp +) diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt new file mode 100644 index 00000000000..d64ffa0134f --- /dev/null +++ b/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-802.15.4-rf + INTERFACE + stm-s2lp-rf-driver + source +) + +target_sources(mbed-802.15.4-rf + INTERFACE + source/NanostackRfPhys2lp.cpp + source/at24mac_s2lp.cpp + source/rf_configuration.c +) diff --git a/connectivity/drivers/CMakeLists.txt b/connectivity/drivers/CMakeLists.txt new file mode 100644 index 00000000000..5f6bcb9749f --- /dev/null +++ b/connectivity/drivers/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(802.15.4_RF) +add_subdirectory(ble) +add_subdirectory(cellular) +add_subdirectory(emac) +add_subdirectory(lora) +add_subdirectory(mbedtls) +add_subdirectory(nfc) +add_subdirectory(wifi) diff --git a/connectivity/drivers/ble/CMakeLists.txt b/connectivity/drivers/ble/CMakeLists.txt new file mode 100644 index 00000000000..1bec37f91c9 --- /dev/null +++ b/connectivity/drivers/ble/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(FEATURE_BLE) diff --git a/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt new file mode 100644 index 00000000000..5c879757358 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("BlueNRG_MS" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_BlueNRG_MS) +endif() + +if("CYW43XXX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_CYW43XXX) +endif() + +if("Ambiq_Micro" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Ambiq_Micro) +elseif("CY8C63XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CY8C63XX) +elseif("NORDIC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NORDIC) +elseif("STM32WB" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32WB) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt new file mode 100644 index 00000000000..cb6a3d3ac3b --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_BlueNRG_MS/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble-blue_nrg + INTERFACE + BlueNrgMsHCIDriver.cpp +) + +target_link_libraries(mbed-ble-blue_nrg + INTERFACE + mbed-ble +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt new file mode 100644 index 00000000000..ab7b8cae605 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("PSOC6" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_PSOC6) +endif() + +add_subdirectory(firmware) + +target_include_directories(mbed-ble + INTERFACE + . +) + +target_sources(mbed-ble + INTERFACE + CyH4TransportDriver.cpp + HCIDriver.cpp +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt new file mode 100644 index 00000000000..f0298519b54 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/TARGET_PSOC6/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + cy_bt_cordio_cfg.cpp +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt new file mode 100644 index 00000000000..38328c4c86f --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("43012" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_43012) +endif() + +if("43438" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_43438) +endif() + +if("4343W" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_4343W) +endif() + +if("CYW9P62S1_43012EVB_01" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CYW9P62S1_43012EVB_01) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt new file mode 100644 index 00000000000..31fecb8fe09 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + w_bt_firmware_controller.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt new file mode 100644 index 00000000000..31fecb8fe09 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + w_bt_firmware_controller.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt new file mode 100644 index 00000000000..31fecb8fe09 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + w_bt_firmware_controller.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt new file mode 100644 index 00000000000..31fecb8fe09 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-ble + INTERFACE + w_bt_firmware_controller.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt new file mode 100644 index 00000000000..9a1772d36a6 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/CMakelists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("Apollo3" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Apollo3) +endif() + +target_include_directories(mbed-ble + INTERFACE + hal/apollo3 +) + +target_sources(mbed-ble + INTERFACE + hal/hci_drv_apollo3.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt new file mode 100644 index 00000000000..40709f26787 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_Ambiq_Micro/TARGET_Apollo3/CMakelists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble + PUBLIC + . +) + +target_sources(mbed-ble + PRIVATE + AP3CordioHCIDriver.cpp + AP3CordioHCITransportDriver.cpp +) + +target_link_libraries(mbed-ble + mbed-core +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt new file mode 100644 index 00000000000..22e3ff9939d --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_CY8C63XX/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble + INTERFACE + . + drivers +) + +target_sources(mbed-ble + INTERFACE + Psoc6BLE.cpp + drivers/IPCPipeTransportDriver.cpp +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt new file mode 100644 index 00000000000..db72f31a34d --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NORDIC_CORDIO" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NORDIC_CORDIO) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt new file mode 100644 index 00000000000..6178c325547 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52840) +elseif("NRF5x" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NRF5x) +endif() diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/CMakeLists.txt new file mode 100644 index 00000000000..f79b5099420 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt new file mode 100644 index 00000000000..643912fe344 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble-cordio + INTERFACE + . + ./stack/include +) + +target_sources(mbed-ble-cordio + INTERFACE + NRFCordioHCIDriver.cpp + NRFCordioHCITransportDriver.cpp + + stack/sources/pal_bb.c + stack/sources/pal_bb_ble.c + stack/sources/pal_bb_ble_rf.c + stack/sources/pal_cfg.c + stack/sources/pal_crypto.c + stack/sources/pal_timer.c +) diff --git a/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt b/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt new file mode 100644 index 00000000000..ac76188a1b5 --- /dev/null +++ b/connectivity/drivers/ble/FEATURE_BLE/TARGET_STM32WB/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ble + INTERFACE + . + ./STM32Cube_FW +) + +target_sources(mbed-ble + INTERFACE + HCIDriver.cpp + hw_ipcc.c + + STM32Cube_FW/shci.c + STM32Cube_FW/shci_tl.c + STM32Cube_FW/stm_list.c + STM32Cube_FW/tl_mbox.c +) diff --git a/connectivity/drivers/cellular/Altair/ALT1250/CMakeLists.txt b/connectivity/drivers/cellular/Altair/ALT1250/CMakeLists.txt new file mode 100644 index 00000000000..d70ab1e2655 --- /dev/null +++ b/connectivity/drivers/cellular/Altair/ALT1250/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(PPP) diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt new file mode 100644 index 00000000000..682b480b169 --- /dev/null +++ b/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + ALT1250_PPP.cpp + ALT1250_PPP_CellularContext.cpp + ALT1250_PPP_CellularNetwork.cpp +) diff --git a/connectivity/drivers/cellular/Altair/CMakeLists.txt b/connectivity/drivers/cellular/Altair/CMakeLists.txt new file mode 100644 index 00000000000..8ba299d8e8b --- /dev/null +++ b/connectivity/drivers/cellular/Altair/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(ALT1250) diff --git a/connectivity/drivers/cellular/CMakeLists.txt b/connectivity/drivers/cellular/CMakeLists.txt new file mode 100644 index 00000000000..c32350b0b1a --- /dev/null +++ b/connectivity/drivers/cellular/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STMOD_CELLULAR" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_STMOD_CELLULAR) +endif() + +add_subdirectory(Altair) +add_subdirectory(GEMALTO) +add_subdirectory(GENERIC) +add_subdirectory(MultiTech) +add_subdirectory(QUECTEL) +add_subdirectory(RiotMicro) +add_subdirectory(TELIT) +add_subdirectory(UBLOX) + +target_include_directories(mbed-cellular + INTERFACE + . +) diff --git a/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt new file mode 100644 index 00000000000..fb984bf2a28 --- /dev/null +++ b/connectivity/drivers/cellular/COMPONENT_STMOD_CELLULAR/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + STModCellular.cpp +) diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt new file mode 100644 index 00000000000..82654ee2b26 --- /dev/null +++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + GEMALTO_CINTERION.cpp + GEMALTO_CINTERION_CellularContext.cpp + GEMALTO_CINTERION_CellularInformation.cpp + GEMALTO_CINTERION_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt new file mode 100644 index 00000000000..e1fe296061e --- /dev/null +++ b/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(CINTERION) diff --git a/connectivity/drivers/cellular/GENERIC/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/CMakeLists.txt new file mode 100644 index 00000000000..6eeee2c57c3 --- /dev/null +++ b/connectivity/drivers/cellular/GENERIC/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(GENERIC_AT3GPP) diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt new file mode 100644 index 00000000000..6d4e280652a --- /dev/null +++ b/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + GENERIC_AT3GPP.cpp +) diff --git a/connectivity/drivers/cellular/MultiTech/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/CMakeLists.txt new file mode 100644 index 00000000000..af43b957916 --- /dev/null +++ b/connectivity/drivers/cellular/MultiTech/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(DragonflyNano) diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/CMakeLists.txt new file mode 100644 index 00000000000..d70ab1e2655 --- /dev/null +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(PPP) diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt new file mode 100644 index 00000000000..cfb14ebd5ec --- /dev/null +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-cellular + INTERFACE + SARA4_PPP.cpp + SARA4_PPP_CellularNetwork.cpp +) diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt new file mode 100644 index 00000000000..2b90249f738 --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + QUECTEL_BC95.cpp + QUECTEL_BC95_CellularContext.cpp + QUECTEL_BC95_CellularInformation.cpp + QUECTEL_BC95_CellularNetwork.cpp + QUECTEL_BC95_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt new file mode 100644 index 00000000000..d0d0bfe7d3d --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + QUECTEL_BG96.cpp + QUECTEL_BG96_CellularContext.cpp + QUECTEL_BG96_CellularInformation.cpp + QUECTEL_BG96_CellularNetwork.cpp + QUECTEL_BG96_CellularStack.cpp + QUECTEL_BG96_ControlPlane_netif.cpp +) diff --git a/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt new file mode 100644 index 00000000000..bcce2a5f113 --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(BC95) +add_subdirectory(BG96) +add_subdirectory(EC2X) +add_subdirectory(M26) +add_subdirectory(UG96) diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt new file mode 100644 index 00000000000..b7f944848bb --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-cellular + INTERFACE + QUECTEL_EC2X.cpp +) diff --git a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt new file mode 100644 index 00000000000..b78985a190c --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + QUECTEL_M26.cpp + QUECTEL_M26_CellularContext.cpp + QUECTEL_M26_CellularInformation.cpp + QUECTEL_M26_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt new file mode 100644 index 00000000000..0878e891fc4 --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + QUECTEL_UG96.cpp + QUECTEL_UG96_CellularContext.cpp +) diff --git a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt new file mode 100644 index 00000000000..91fe504563f --- /dev/null +++ b/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + RM1000_AT.cpp + RM1000_AT_CellularContext.cpp + RM1000_AT_CellularNetwork.cpp + RM1000_AT_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt new file mode 100644 index 00000000000..a76e816789d --- /dev/null +++ b/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(AT) diff --git a/connectivity/drivers/cellular/TELIT/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/CMakeLists.txt new file mode 100644 index 00000000000..0950d12d0b0 --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(HE910) +add_subdirectory(ME310) +add_subdirectory(ME910) diff --git a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt new file mode 100644 index 00000000000..c5100183209 --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + TELIT_HE910.cpp +) diff --git a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt new file mode 100644 index 00000000000..e683fb69df4 --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + TELIT_ME310.cpp + TELIT_ME310_CellularContext.cpp + TELIT_ME310_CellularNetwork.cpp + TELIT_ME310_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt new file mode 100644 index 00000000000..6bab7c1ab5e --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-cellular + INTERFACE + TELIT_ME910.cpp + TELIT_ME910_CellularContext.cpp + TELIT_ME910_CellularNetwork.cpp +) diff --git a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt new file mode 100644 index 00000000000..c97e1ea8ac7 --- /dev/null +++ b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + UBLOX_AT.cpp + UBLOX_AT_CellularContext.cpp + UBLOX_AT_CellularNetwork.cpp + UBLOX_AT_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/UBLOX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/CMakeLists.txt new file mode 100644 index 00000000000..12753476255 --- /dev/null +++ b/connectivity/drivers/cellular/UBLOX/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(AT) +add_subdirectory(N2XX) +add_subdirectory(PPP) diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt new file mode 100644 index 00000000000..97340c02724 --- /dev/null +++ b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + UBLOX_N2XX.cpp + UBLOX_N2XX_CellularContext.cpp + UBLOX_N2XX_CellularNetwork.cpp + UBLOX_N2XX_CellularSMS.cpp + UBLOX_N2XX_CellularStack.cpp +) diff --git a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt new file mode 100644 index 00000000000..42afbf9d40d --- /dev/null +++ b/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + INTERFACE + . +) + +target_sources(mbed-cellular + INTERFACE + UBLOX_PPP.cpp +) diff --git a/connectivity/drivers/emac/CMakeLists.txt b/connectivity/drivers/emac/CMakeLists.txt new file mode 100644 index 00000000000..21f104947c2 --- /dev/null +++ b/connectivity/drivers/emac/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("ARM_FM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARM_FM) +elseif("ARM_SSG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARM_SSG) +elseif("Cypress" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Cypress) +elseif("Freescale_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Freescale_EMAC) +elseif("GD_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD_EMAC) +elseif("NUVOTON_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUVOTON_EMAC) +elseif("NXP_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NXP_EMAC) +elseif("RDA_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RDA_EMAC) +elseif("RENESAS_EMAC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RENESAS_EMAC) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +endif() + +target_link_libraries(mbed-emac + INTERFACE + mbed-netsocket +) diff --git a/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt new file mode 100644 index 00000000000..1667b49f069 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_ARM_FM/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("LAN91C111" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_LAN91C111) +endif() diff --git a/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt new file mode 100644 index 00000000000..73b0de8153d --- /dev/null +++ b/connectivity/drivers/emac/TARGET_ARM_FM/COMPONENT_LAN91C111/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + fvp_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt new file mode 100644 index 00000000000..5655d2ce09f --- /dev/null +++ b/connectivity/drivers/emac/TARGET_ARM_SSG/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SMSC9220" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SMSC9220) +endif() diff --git a/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt new file mode 100644 index 00000000000..4a944235dc9 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_ARM_SSG/COMPONENT_SMSC9220/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + smsc9220_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt new file mode 100644 index 00000000000..9c4697181d9 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Cypress/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SCL" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SCL) +endif() + +if("WHD" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_WHD) +endif() diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt new file mode 100644 index 00000000000..3f31f7dba59 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_SCL/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . + ./interface +) + +target_sources(mbed-emac + INTERFACE + interface/SclSTAInterface.cpp + interface/default_wifi_interface.cpp + interface/scl_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt new file mode 100644 index 00000000000..185ab9bb76c --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Cypress/COMPONENT_WHD/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . + ./interface + ./network + ./utils +) + +target_sources(mbed-emac + INTERFACE + interface/CyDhcpServer.cpp + interface/WhdAccessPoint.cpp + interface/WhdSTAInterface.cpp + interface/WhdSoftAPInterface.cpp + interface/whd_emac.cpp + interface/whd_interface.cpp + + utils/cydhcp_server_debug.cpp + utils/cynetwork_utils.c +) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt new file mode 100644 index 00000000000..1aff70d6a02 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("K64F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_K64F) +elseif("K66F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_K66F) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + kinetis_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt new file mode 100644 index 00000000000..5593767f2b3 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K64F/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + hardware_init_MK64F12.c +) diff --git a/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt new file mode 100644 index 00000000000..5d713be4718 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Freescale_EMAC/TARGET_K66F/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + hardware_init_MK66F18.c +) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt new file mode 100644 index 00000000000..fbfd6bd9754 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("GD32F30X" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD32F30X) +elseif("GD32F4XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_GD32F4XX) +endif() + +target_include_directories(mbed-emac + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-emac + INTERFACE + gd32xx_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt new file mode 100644 index 00000000000..516c6da8970 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F30X/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + gd32f3_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt new file mode 100644 index 00000000000..4879b64101d --- /dev/null +++ b/connectivity/drivers/emac/TARGET_GD_EMAC/TARGET_GD32F4XX/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + gd32f4_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt new file mode 100644 index 00000000000..43dab9de3fb --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("M480" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_M480) +elseif("NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUC472) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + numaker_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt new file mode 100644 index 00000000000..d87d21cf8e0 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + m480_eth.c +) diff --git a/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt new file mode 100644 index 00000000000..f42680b29a9 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + nuc472_eth.c +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt new file mode 100644 index 00000000000..ed27ee1c805 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("IMX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_IMX) +elseif("LPCTarget" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_LPCTarget) +elseif("MCU_LPC546XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_LPC546XX) +endif() + diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt new file mode 100644 index 00000000000..62dc1377125 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MIMXRT1050_EVK" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MIMXRT1050_EVK) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + imx_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt new file mode 100644 index 00000000000..db07c9fa60d --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_IMX/TARGET_MIMXRT1050_EVK/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + PRIVATE + hardware_init.c +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt new file mode 100644 index 00000000000..b93dc93b8a7 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_LPCTarget/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + lpc17_emac.cpp + lpc_phy_dp83848.cpp +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt new file mode 100644 index 00000000000..6a5007501b7 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("FF_LPC546XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_FF_LPC546XX) +elseif("LPCXpresso" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_LPCXpresso) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + lpc546xx_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt new file mode 100644 index 00000000000..a6faa3ff12b --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_FF_LPC546XX/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + hardware_init_LPC546XX.c +) diff --git a/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt new file mode 100644 index 00000000000..a6faa3ff12b --- /dev/null +++ b/connectivity/drivers/emac/TARGET_NXP_EMAC/TARGET_MCU_LPC546XX/TARGET_LPCXpresso/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + hardware_init_LPC546XX.c +) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt new file mode 100644 index 00000000000..8dfa28d474d --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(lwip-wifi) + +target_include_directories(mbed-emac + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-emac + INTERFACE + RdaWiFiInterface.cpp + rda5981x_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/CMakeLists.txt new file mode 100644 index 00000000000..98c1686f9de --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/CMakeLists.txt @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(arch) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt new file mode 100644 index 00000000000..0c683b6c57c --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("RDA" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RDA) +endif() diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt new file mode 100644 index 00000000000..6ec34e0daad --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("UNO_91H" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_UNO_91H) +endif() diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt new file mode 100644 index 00000000000..935ad4a1007 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(lib) + +target_include_directories(mbed-emac + PUBLIC + . + ./inc +) + +target_sources(mbed-emac + PRIVATE + src/maclib_task.c + src/rda5991h_wland.c + src/rda_sys_wrapper.c + src/wland_flash.c + src/wland_flash_wp.c + src/wland_ota.c +) diff --git a/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt new file mode 100644 index 00000000000..6e83093782d --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RDA_EMAC/lwip-wifi/arch/TARGET_RDA/TARGET_UNO_91H/lib/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_lib_file_uno_91h) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LIB_FILE TOOLCHAIN_GCC_ARM/libwifi_sta_ap.a) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LIB_FILE TOOLCHAIN_ARM_STD/libwifi_sta_ap.ar) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LIB_FILE TOOLCHAIN_IAR/libwifi_sta_ap.a) + endif() + target_sources(mbed-emac PRIVATE ${LIB_FILE}) +endfunction() + +_mbed_get_lib_file_uno_91h() diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt new file mode 100644 index 00000000000..9a7d66ab9a6 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/CMakelists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("RZ_A1XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RZ_A1XX) +elseif("RZ_A2XX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_RZ_A2XX) +endif() diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt new file mode 100644 index 00000000000..1dc5f4b69df --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/CMakelists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + rza1_emac.cpp + rza1_eth.cpp +) diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt new file mode 100644 index 00000000000..d16d12d469f --- /dev/null +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/CMakelists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + PUBLIC + . + r_ether_rza2 + r_ether_rza2/src/phy + r_ether_rza2/src/targets/TARGET_GR_MANGO + PRIVATE + r_ether_rza2/src +) + +target_sources(mbed-emac + PRIVATE + rza2_emac.cpp + r_ether_rza2/src/r_ether_rza2.c + r_ether_rza2/src/phy/phy.c + r_ether_rza2/src/targets/TARGET_GR_MANGO/r_ether_setting_rza2m.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt new file mode 100644 index 00000000000..c7bd8eb88c7 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STM32F2" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F2) +elseif("STM32F4" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F4) +elseif("STM32F7" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F7) +elseif("STM32H7" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32H7) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + stm32xx_emac.cpp +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt new file mode 100644 index 00000000000..e5d922c4db3 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NUCLEO_F207ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F207ZG) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + stm32f2_eth_conf.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt new file mode 100644 index 00000000000..81691bff8c8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f2_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt new file mode 100644 index 00000000000..011678e4fa7 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("ARCH_MAX" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ARCH_MAX) +elseif("NUCLEO_F429ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F429ZI) +elseif("NUCLEO_F439ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F439ZI) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt new file mode 100644 index 00000000000..605771d9caf --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + stm32f4_eth_conf.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt new file mode 100644 index 00000000000..605771d9caf --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + stm32f4_eth_conf.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt new file mode 100644 index 00000000000..0726441f58b --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + PUBLIC + . +) + +target_sources(mbed-emac + PRIVATE + stm32f4_eth_conf.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt new file mode 100644 index 00000000000..0c6b882c7a6 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("DISCO_F746NG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_F746NG) +elseif("DISCO_F769NI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_F769NI) +elseif("NUCLEO_F746ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F746ZG) +elseif("NUCLEO_F756ZG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F756ZG) +elseif("NUCLEO_F767ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F767ZI) +endif() + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_conf.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt new file mode 100644 index 00000000000..752528bd4f8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt new file mode 100644 index 00000000000..752528bd4f8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt new file mode 100644 index 00000000000..752528bd4f8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt new file mode 100644 index 00000000000..752528bd4f8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt new file mode 100644 index 00000000000..752528bd4f8 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32f7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt new file mode 100644 index 00000000000..0a2f39ea0b3 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("DISCO_H747I" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_H747I) +elseif("NUCLEO_H743ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_H743ZI) +elseif("NUCLEO_H743ZI2" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_H743ZI2) +endif() + +target_include_directories(mbed-emac + PRIVATE + . + ./lan8742 +) + +target_sources(mbed-emac + PRIVATE + lan8742/lan8742.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt new file mode 100644 index 00000000000..5e6c9d6be72 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_DISCO_H747I/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32h7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt new file mode 100644 index 00000000000..5e6c9d6be72 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32h7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt new file mode 100644 index 00000000000..5e6c9d6be72 --- /dev/null +++ b/connectivity/drivers/emac/TARGET_STM/TARGET_STM32H7/TARGET_NUCLEO_H743ZI2/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-emac + INTERFACE + stm32h7_eth_init.c +) diff --git a/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt new file mode 100644 index 00000000000..2e4cc56583b --- /dev/null +++ b/connectivity/drivers/emac/TARGET_Silicon_Labs/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-emac + INTERFACE + . +) + +target_sources(mbed-emac + INTERFACE + sl_emac.cpp + sl_eth_hw.c +) diff --git a/connectivity/drivers/lora/CMakeLists.txt b/connectivity/drivers/lora/CMakeLists.txt new file mode 100644 index 00000000000..0c382d4a453 --- /dev/null +++ b/connectivity/drivers/lora/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SX126X" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX126X) +endif() + +if("SX1272" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX1272) +endif() + +if("SX1276" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SX1276) +endif() diff --git a/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt new file mode 100644 index 00000000000..f9ae4c4817a --- /dev/null +++ b/connectivity/drivers/lora/COMPONENT_SX126X/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-lorawan + INTERFACE + . +) + +target_sources(mbed-lorawan + INTERFACE + SX126X_LoRaRadio.cpp +) diff --git a/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt new file mode 100644 index 00000000000..72919db2d7b --- /dev/null +++ b/connectivity/drivers/lora/COMPONENT_SX1272/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-lorawan + INTERFACE + . + ./registers +) + +target_sources(mbed-lorawan + INTERFACE + SX1272_LoRaRadio.cpp +) diff --git a/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt b/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt new file mode 100644 index 00000000000..b84d8fa92a8 --- /dev/null +++ b/connectivity/drivers/lora/COMPONENT_SX1276/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-lorawan + INTERFACE + . + ./registers +) + +target_sources(mbed-lorawan + INTERFACE + SX1276_LoRaRadio.cpp +) diff --git a/connectivity/drivers/mbedtls/CMakeLists.txt b/connectivity/drivers/mbedtls/CMakeLists.txt new file mode 100644 index 00000000000..cdeb1c5a061 --- /dev/null +++ b/connectivity/drivers/mbedtls/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("CRYPTOCELL310" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(FEATURE_CRYPTOCELL310) +endif() + +if("Cypress" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Cypress) +elseif("NUVOTON" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUVOTON) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +elseif("Samsung" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Samsung) +elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Silicon_Labs) +endif() diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt new file mode 100644 index 00000000000..c5484a707c7 --- /dev/null +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52840) +endif() + +add_subdirectory(binaries) + +target_include_directories(mbed-mbedtls-cryptocell310 + INTERFACE + . + ./include + ./include/cryptocell310 + ./include/cryptocell310/internal +) + +target_sources(mbed-mbedtls-cryptocell310 + INTERFACE + source/aes_alt.c + source/cc_internal.c + source/ccm_alt.c + source/cmac_alt.c + source/ecdh_alt.c + source/ecdsa_alt.c + source/sha1_alt.c + source/sha256_alt.c + source/sha512_alt.c + source/trng.c +) + +target_link_libraries(mbed-mbedtls-cryptocell310 + INTERFACE + mbed-mbedtls +) diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt new file mode 100644 index 00000000000..54c9d208b39 --- /dev/null +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/TARGET_MCU_NRF52840/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_libcc_310_ext) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LIBCC_310_EXT TOOLCHAIN_GCC_ARM/libcc_310_ext.a) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LIBCC_310_EXT TOOLCHAIN_ARM/libcc_310_ext.ar) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LIBCC_310_EXT TOOLCHAIN_IAR/lib_cc310_ext.a) + endif() + target_link_libraries(mbed-mbedtls-cryptocell310 + INTERFACE + ./${LIBCC_310_EXT} + ) +endfunction() + +function(_mbed_get_libcc_310_trng) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LIBCC_310_TRNG TOOLCHAIN_GCC_ARM/libcc_310_trng.a) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LIBCC_310_TRNG TOOLCHAIN_ARM/libcc_310_trng.ar) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LIBCC_310_TRNG TOOLCHAIN_IAR/lib_cc310_trng.a) + endif() + target_link_libraries(mbed-mbedtls-cryptocell310 + INTERFACE + ./${LIBCC_310_TRNG} + ) +endfunction() + +_mbed_get_libcc_310_ext() +_mbed_get_libcc_310_trng() + +target_include_directories(mbed-mbedtls-cryptocell310 + INTERFACE + . +) + +target_sources(mbed-mbedtls-cryptocell310 + INTERFACE + crypto_device_platform.c +) \ No newline at end of file diff --git a/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt new file mode 100644 index 00000000000..5f0f79ff6e5 --- /dev/null +++ b/connectivity/drivers/mbedtls/FEATURE_CRYPTOCELL310/binaries/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_libcc_310_core) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LIBCC_310_CORE TOOLCHAIN_GCC_ARM/libcc_310_core.a) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LIBCC_310_CORE TOOLCHAIN_ARM/libcc_310_core.ar) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LIBCC_310_CORE TOOLCHAIN_IAR/lib_cc310_ext.a) + endif() + target_link_libraries(mbed-mbedtls-cryptocell310 + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/${LIBCC_310_CORE} + ) +endfunction() + +_mbed_get_libcc_310_core() diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt new file mode 100644 index 00000000000..3c9a910fc64 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MXCRYPTO" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO) +endif() diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt new file mode 100644 index 00000000000..dc352310af9 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MXCRYPTO_01" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO_01) +elseif("MXCRYPTO_02" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MXCRYPTO_02) +endif() + +target_include_directories(mbed-mbedtls + INTERFACE + . +) + +target_sources(mbed-mbedtls + INTERFACE + aes_alt.c + crypto_common.c + ecdsa_alt.c + ecp_alt.c + ecp_curves_alt.c + sha1_alt.c + sha256_alt.c + sha512_alt.c +) diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt new file mode 100644 index 00000000000..115af52c988 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_01/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . +) diff --git a/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt new file mode 100644 index 00000000000..115af52c988 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Cypress/TARGET_MXCRYPTO/TARGET_MXCRYPTO_02/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . +) diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt new file mode 100644 index 00000000000..2a282821601 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("M480" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_M480) +elseif("NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUC472) +endif() + diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt new file mode 100644 index 00000000000..23860a7b190 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_M480/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . + ./aes + ./des + ./sha +) + +target_sources(mbed-mbedtls + INTERFACE + aes/aes_alt.c + + des/des_alt.c + + ecp/ecp_internal_alt.c + + sha/sha1_alt.c + sha/sha1_alt_sw.c + sha/sha256_alt.c + sha/sha256_alt_sw.c + sha/sha512_alt.c + sha/sha512_alt_sw.c + sha/sha_alt_hw.c +) diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt new file mode 100644 index 00000000000..e88183925ab --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NUMAKER_PFM_NUC472" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUMAKER_PFM_NUC472) +endif() + +target_include_directories(mbed-mbedtls + INTERFACE + . + ./aes + ./des + ./sha +) + +target_sources(mbed-mbedtls + INTERFACE + aes/aes_alt.c + + des/des_alt.c + + sha/sha1_alt.c + sha/sha1_alt_sw.c + sha/sha256_alt.c + sha/sha256_alt_sw.c + sha/sha_alt_hw.c +) diff --git a/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt new file mode 100644 index 00000000000..7c3fdc503ec --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt new file mode 100644 index 00000000000..6e9c30d7223 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("TARGET_STM32F437xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F437xG) +elseif("STM32F439xI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F439xI) +elseif("STM32F756xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F756xG) +elseif("STM32L443xC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L443xC) +elseif("STM32L486xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L486xG) +elseif("STM32L4S5xI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L4S5xI) +elseif("STM32L562xx" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L562xx) +elseif("STM32WB55xx" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32WB55xx) +endif() + +target_sources(mbed-mbedtls + INTERFACE + aes_alt.cpp + aes_alt_stm32l4.c + ccm_alt.cpp + cryp_stm32.c + gcm_alt.cpp + hash_stm32.c + md5_alt.cpp + sha1_alt.cpp + sha256_alt.cpp +) + +target_include_directories(mbed-mbedtls + INTERFACE + . +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F437xG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt new file mode 100644 index 00000000000..115af52c988 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F439xI/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32F756xG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L443xC/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L486xG/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32L562xx/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt new file mode 100644 index 00000000000..75ef1f348a1 --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_STM/TARGET_STM32WB55xx/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls-stm + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt new file mode 100644 index 00000000000..204b9584a0b --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Samsung/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . + ./sha +) + +target_sources(mbed-mbedtls + INTERFACE + sha/sha256_alt.c + sha/sha512_alt.c +) diff --git a/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt b/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt new file mode 100644 index 00000000000..bba96296fff --- /dev/null +++ b/connectivity/drivers/mbedtls/TARGET_Silicon_Labs/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . +) + +target_sources(mbed-mbedtls + INTERFACE + aes_aes.c + crypto_aes.c + crypto_ecp.c + crypto_management.c + crypto_sha.c +) diff --git a/connectivity/drivers/nfc/CMakeLists.txt b/connectivity/drivers/nfc/CMakeLists.txt new file mode 100644 index 00000000000..214a1e0ba8a --- /dev/null +++ b/connectivity/drivers/nfc/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("PN512" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(PN512) +endif() diff --git a/connectivity/drivers/nfc/PN512/CMakeLists.txt b/connectivity/drivers/nfc/PN512/CMakeLists.txt new file mode 100644 index 00000000000..546f6a936f2 --- /dev/null +++ b/connectivity/drivers/nfc/PN512/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc + ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/controllers + ${CMAKE_CURRENT_SOURCE_DIR}/source + ${CMAKE_CURRENT_SOURCE_DIR}/source/transceiver +) + +target_sources(mbed-nfc + INTERFACE + source/PN512Driver.cpp + source/PN512SPITransportDriver.cpp + source/PN512TransportDriver.cpp + + source/transceiver/pn512.c + source/transceiver/pn512_cmd.c + source/transceiver/pn512_hw.c + source/transceiver/pn512_irq.c + source/transceiver/pn512_poll.c + source/transceiver/pn512_registers.c + source/transceiver/pn512_rf.c + source/transceiver/pn512_timer.c + source/transceiver/pn512_transceive.c +) diff --git a/connectivity/drivers/wifi/CMakeLists.txt b/connectivity/drivers/wifi/CMakeLists.txt new file mode 100644 index 00000000000..1715a75c573 --- /dev/null +++ b/connectivity/drivers/wifi/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(esp8266-driver) + +target_link_libraries(mbed-wifi + INTERFACE + mbed-netsocket +) diff --git a/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt new file mode 100644 index 00000000000..b49ced00a4a --- /dev/null +++ b/connectivity/drivers/wifi/esp8266-driver/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-wifi + INTERFACE + ESP8266Interface.cpp + ESP8266/ESP8266.cpp +) + +target_include_directories(mbed-wifi + INTERFACE + . + ./ESP8266 +) diff --git a/connectivity/libraries/CMakeLists.txt b/connectivity/libraries/CMakeLists.txt new file mode 100644 index 00000000000..18ce7134705 --- /dev/null +++ b/connectivity/libraries/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(mbed-coap) +add_subdirectory(nanostack-libservice) +add_subdirectory(ppp) diff --git a/connectivity/libraries/mbed-coap/CMakeLists.txt b/connectivity/libraries/mbed-coap/CMakeLists.txt new file mode 100644 index 00000000000..71bfd400779 --- /dev/null +++ b/connectivity/libraries/mbed-coap/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-coap + INTERFACE + . + ./mbed-coap + ./source/include +) + +target_sources(mbed-coap + INTERFACE + source/sn_coap_builder.c + source/sn_coap_header_check.c + source/sn_coap_parser.c + source/sn_coap_protocol.c +) + +target_compile_definitions(mbed-coap + INTERFACE + MBED_CONF_COAP_PRESENT=1 +) diff --git a/connectivity/libraries/nanostack-libservice/CMakeLists.txt b/connectivity/libraries/nanostack-libservice/CMakeLists.txt new file mode 100644 index 00000000000..def96854983 --- /dev/null +++ b/connectivity/libraries/nanostack-libservice/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-libservice + INTERFACE + . + ./mbed-client-libservice + ./mbed-client-libservice/platform +) + +target_sources(mbed-nanostack-libservice + INTERFACE + source/IPv6_fcf_lib/ip_fsc.c + source/libList/ns_list.c + source/libip4string/ip4tos.c + source/libip4string/stoip4.c + source/libip6string/stoip6.c + source/nsdynmemLIB/nsdynmemLIB.c + source/nvmHelper/ns_nvm_helper.c +) + +# The definition, source files and include directories below +# are needed by mbed-trace which is part of the mbed-core CMake target +target_compile_definitions(mbed-core + INTERFACE + MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT=1 +) +target_include_directories(mbed-core + INTERFACE + . + ./mbed-client-libservice +) +target_sources(mbed-core + INTERFACE + source/libBits/common_functions.c + source/libip6string/ip6tos.c +) diff --git a/connectivity/libraries/ppp/CMakeLists.txt b/connectivity/libraries/ppp/CMakeLists.txt new file mode 100644 index 00000000000..424b5793dbd --- /dev/null +++ b/connectivity/libraries/ppp/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-ppp + INTERFACE + . + ./include + ./include/polarssl + ./include/ppp +) + +target_sources(mbed-ppp + INTERFACE + source/auth.c + source/ccp.c + source/chap-md5.c + source/chap-new.c + source/chap_ms.c + source/demand.c + source/eap.c + source/eui64.c + source/fsm.c + source/ipcp.c + source/ipv6cp.c + source/lcp.c + source/magic.c + source/mppe.c + source/multilink.c + source/ppp.c + source/ppp_ecp.c + source/ppp_service.cpp + source/ppp_service_if.cpp + source/pppapi.c + source/pppcrypt.c + source/pppoe.c + source/pppol2tp.c + source/pppos.cpp + source/upap.c + source/utils.c + source/vj.c + + source/polarssl/ppp_arc4.c + source/polarssl/ppp_des.c + source/polarssl/ppp_md4.c + source/polarssl/ppp_md5.c + source/polarssl/ppp_sha1.c +) + +target_compile_definitions(mbed-ppp + INTERFACE + MBED_CONF_PPP_PRESENT=1 +) diff --git a/connectivity/lorawan/CMakeLists.txt b/connectivity/lorawan/CMakeLists.txt new file mode 100644 index 00000000000..35bd5282a80 --- /dev/null +++ b/connectivity/lorawan/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(lorastack) +add_subdirectory(system) + +target_include_directories(mbed-lorawan + INTERFACE + .. + . + ./include + ./include/lorawan +) + +target_sources(mbed-lorawan + INTERFACE + source/LoRaWANInterface.cpp + source/LoRaWANStack.cpp +) + +target_compile_definitions(mbed-lorawan + INTERFACE + MBED_CONF_LORAWAN_PRESENT=1 +) + +target_link_libraries(mbed-lorawan + INTERFACE + mbed-events +) diff --git a/connectivity/lorawan/lorastack/CMakeLists.txt b/connectivity/lorawan/lorastack/CMakeLists.txt new file mode 100644 index 00000000000..3b0115a82a5 --- /dev/null +++ b/connectivity/lorawan/lorastack/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-lorawan + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/mac + ${CMAKE_CURRENT_SOURCE_DIR}/phy +) + +target_sources(mbed-lorawan + INTERFACE + mac/LoRaMac.cpp + mac/LoRaMacChannelPlan.cpp + mac/LoRaMacCommand.cpp + mac/LoRaMacCrypto.cpp + + phy/LoRaPHY.cpp + phy/LoRaPHYAS923.cpp + phy/LoRaPHYAU915.cpp + phy/LoRaPHYCN470.cpp + phy/LoRaPHYCN779.cpp + phy/LoRaPHYEU433.cpp + phy/LoRaPHYEU868.cpp + phy/LoRaPHYIN865.cpp + phy/LoRaPHYKR920.cpp + phy/LoRaPHYUS915.cpp +) diff --git a/connectivity/lorawan/system/CMakeLists.txt b/connectivity/lorawan/system/CMakeLists.txt new file mode 100644 index 00000000000..f5f687dd31a --- /dev/null +++ b/connectivity/lorawan/system/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-lorawan + INTERFACE + LoRaWANTimer.cpp +) + +target_include_directories(mbed-lorawan + INTERFACE + . +) diff --git a/connectivity/lwipstack/CMakeLists.txt b/connectivity/lwipstack/CMakeLists.txt new file mode 100644 index 00000000000..96c9b12155d --- /dev/null +++ b/connectivity/lwipstack/CMakeLists.txt @@ -0,0 +1,100 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-lwipstack + INTERFACE + . + ./include + ./include/lwipstack + ./lwip/src/include + ./lwip/src/include/lwip + ./lwip-sys + ./lwip-sys/arch +) + +target_sources(mbed-lwipstack + INTERFACE + lwip/src/api/lwip_api_lib.c + lwip/src/api/lwip_api_msg.c + lwip/src/api/lwip_err.c + lwip/src/api/lwip_if_api.c + lwip/src/api/lwip_netbuf.c + lwip/src/api/lwip_netdb.c + lwip/src/api/lwip_netifapi.c + lwip/src/api/lwip_sockets.c + lwip/src/api/lwip_tcpip.c + + lwip/src/core/ipv4/lwip_autoip.c + lwip/src/core/ipv4/lwip_dhcp.c + lwip/src/core/ipv4/lwip_etharp.c + lwip/src/core/ipv4/lwip_icmp.c + lwip/src/core/ipv4/lwip_igmp.c + lwip/src/core/ipv4/lwip_ip4.c + lwip/src/core/ipv4/lwip_ip4_addr.c + lwip/src/core/ipv4/lwip_ip4_frag.c + + lwip/src/core/ipv6/lwip_dhcp6.c + lwip/src/core/ipv6/lwip_ethip6.c + lwip/src/core/ipv6/lwip_icmp6.c + lwip/src/core/ipv6/lwip_inet6.c + lwip/src/core/ipv6/lwip_ip6.c + lwip/src/core/ipv6/lwip_ip6_addr.c + lwip/src/core/ipv6/lwip_ip6_frag.c + lwip/src/core/ipv6/lwip_mld6.c + lwip/src/core/ipv6/lwip_nd6.c + + lwip/src/core/lwip_altcp.c + lwip/src/core/lwip_altcp_alloc.c + lwip/src/core/lwip_altcp_tcp.c + lwip/src/core/lwip_def.c + lwip/src/core/lwip_dns.c + lwip/src/core/lwip_inet_chksum.c + lwip/src/core/lwip_init.c + lwip/src/core/lwip_ip.c + lwip/src/core/lwip_mem.c + lwip/src/core/lwip_memp.c + lwip/src/core/lwip_netif.c + lwip/src/core/lwip_pbuf.c + lwip/src/core/lwip_raw.c + lwip/src/core/lwip_stats.c + lwip/src/core/lwip_sys.c + lwip/src/core/lwip_tcp.c + lwip/src/core/lwip_tcp_in.c + lwip/src/core/lwip_tcp_out.c + lwip/src/core/lwip_timeouts.c + lwip/src/core/lwip_udp.c + + lwip/src/netif/lwip_bridgeif.c + lwip/src/netif/lwip_bridgeif_fdb.c + lwip/src/netif/lwip_ethernet.c + lwip/src/netif/lwip_lowpan6.c + lwip/src/netif/lwip_lowpan6_ble.c + lwip/src/netif/lwip_lowpan6_common.c + lwip/src/netif/lwip_zepif.c + + lwip-sys/arch/lwip_checksum.c + lwip-sys/arch/lwip_memcpy.c + lwip-sys/arch/lwip_sys_arch.c + lwip-sys/lwip_random.c + lwip-sys/lwip_tcp_isn.c + + source/LWIPInterface.cpp + source/LWIPInterfaceEMAC.cpp + source/LWIPInterfaceL3IP.cpp + source/LWIPInterfacePPP.cpp + source/LWIPMemoryManager.cpp + source/LWIPStack.cpp + source/lwip_tools.cpp +) + +target_compile_definitions(mbed-lwipstack + INTERFACE + MBED_CONF_LWIPSTACK_PRESENT=1 +) + +target_link_libraries(mbed-lwipstack + INTERFACE + mbed-netsocket + mbed-ppp + mbed-randlib +) diff --git a/connectivity/mbedtls/CMakeLists.txt b/connectivity/mbedtls/CMakeLists.txt new file mode 100644 index 00000000000..07ea78117fe --- /dev/null +++ b/connectivity/mbedtls/CMakeLists.txt @@ -0,0 +1,104 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-mbedtls + INTERFACE + . + ./include + ./include/mbedtls + ./platform + ./platform/inc +) + +target_sources(mbed-mbedtls + INTERFACE + platform/src/mbed_trng.cpp + platform/src/platform_alt.cpp + platform/src/shared_rng.cpp + + source/aes.c + source/aesni.c + source/arc4.c + source/aria.c + source/asn1parse.c + source/asn1write.c + source/base64.c + source/bignum.c + source/blowfish.c + source/camellia.c + source/ccm.c + source/certs.c + source/chacha20.c + source/chachapoly.c + source/cipher.c + source/cipher_wrap.c + source/cmac.c + source/ctr_drbg.c + source/debug.c + source/des.c + source/dhm.c + source/ecdh.c + source/ecdsa.c + source/ecjpake.c + source/ecp.c + source/ecp_curves.c + source/entropy.c + source/entropy_poll.c + source/error.c + source/gcm.c + source/hash_wrappers.c + source/havege.c + source/hkdf.c + source/hmac_drbg.c + source/md.c + source/md2.c + source/md4.c + source/md5.c + source/memory_buffer_alloc.c + source/net_sockets.c + source/nist_kw.c + source/oid.c + source/padlock.c + source/pem.c + source/pk.c + source/pk_wrap.c + source/pkcs11.c + source/pkcs12.c + source/pkcs5.c + source/pkparse.c + source/pkwrite.c + source/platform.c + source/platform_util.c + source/poly1305.c + source/ripemd160.c + source/rsa.c + source/rsa_internal.c + source/sha1.c + source/sha256.c + source/sha512.c + source/ssl_cache.c + source/ssl_ciphersuites.c + source/ssl_cli.c + source/ssl_cookie.c + source/ssl_msg.c + source/ssl_srv.c + source/ssl_ticket.c + source/ssl_tls.c + source/threading.c + source/timing.c + source/version.c + source/version_features.c + source/x509.c + source/x509_create.c + source/x509_crl.c + source/x509_crt.c + source/x509_csr.c + source/x509write_crt.c + source/x509write_csr.c + source/xtea.c +) + +target_compile_definitions(mbed-mbedtls + INTERFACE + MBED_CONF_MBEDTLS_PRESENT=1 +) diff --git a/connectivity/nanostack/CMakeLists.txt b/connectivity/nanostack/CMakeLists.txt new file mode 100644 index 00000000000..92571943a43 --- /dev/null +++ b/connectivity/nanostack/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(coap-service) +add_subdirectory(mbed-mesh-api) +add_subdirectory(nanostack-hal-mbed-cmsis-rtos) +add_subdirectory(sal-stack-nanostack) +add_subdirectory(sal-stack-nanostack-eventloop) + +target_include_directories(mbed-nanostack + INTERFACE + . + ./include + ./include/nanostack-interface +) + +target_sources(mbed-nanostack + INTERFACE + source/Nanostack.cpp +) + +target_compile_definitions(mbed-nanostack + INTERFACE + MBED_CONF_NANOSTACK_PRESENT=1 +) + +target_link_libraries(mbed-nanostack + INTERFACE + mbed-nanostack-mbed_mesh_api + mbed-nanostack-sal_stack-event_loop + mbed-nanostack-sal_stack +) diff --git a/connectivity/nanostack/coap-service/CMakeLists.txt b/connectivity/nanostack/coap-service/CMakeLists.txt new file mode 100644 index 00000000000..277e79c6324 --- /dev/null +++ b/connectivity/nanostack/coap-service/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-coap_service + INTERFACE + . + ./coap-service + ./source/include +) + +target_sources(mbed-nanostack-coap_service + INTERFACE + source/coap_connection_handler.c + source/coap_message_handler.c + source/coap_security_handler.c + source/coap_service_api.c +) + +target_link_libraries(mbed-nanostack + INTERFACE + mbed-coap +) diff --git a/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt new file mode 100644 index 00000000000..d420ced17da --- /dev/null +++ b/connectivity/nanostack/mbed-mesh-api/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-mbed_mesh_api + INTERFACE + . + ./mbed-mesh-api + ./source/include +) + +target_sources(mbed-nanostack-mbed_mesh_api + INTERFACE + source/CallbackHandler.cpp + source/LoWPANNDInterface.cpp + source/MeshInterfaceNanostack.cpp + source/NanostackEMACInterface.cpp + source/NanostackEthernetInterface.cpp + source/NanostackMemoryManager.cpp + source/NanostackPPPInterface.cpp + source/ThreadInterface.cpp + source/WisunBorderRouter.cpp + source/WisunInterface.cpp + source/ethernet_tasklet.c + source/mesh_system.c + source/nd_tasklet.c + source/thread_tasklet.c + source/wisun_tasklet.c +) + +target_link_libraries(mbed-nanostack + INTERFACE + mbed-nanostack-hal_mbed_cmsis_rtos +) diff --git a/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt new file mode 100644 index 00000000000..0b948fd62f7 --- /dev/null +++ b/connectivity/nanostack/nanostack-hal-mbed-cmsis-rtos/CMakeLists.txt @@ -0,0 +1,22 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-hal_mbed_cmsis_rtos + INTERFACE + . +) + +target_sources(mbed-nanostack-hal_mbed_cmsis_rtos + INTERFACE + arm_hal_fhss_timer.cpp + arm_hal_interrupt.c + arm_hal_random.c + arm_hal_timer.cpp + ns_event_loop.c + ns_event_loop_mbed.cpp + ns_event_loop_mutex.c + ns_file_system_api.cpp + ns_hal_init.c + + nvm/nvm_ram.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt new file mode 100644 index 00000000000..1e4ebae115a --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack-eventloop/CMakeLists.txt @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack-event_loop + INTERFACE + . + ./nanostack-event-loop + ./nanostack-event-loop/platform + ./source +) + +target_sources(mbed-nanostack-sal_stack-event_loop + INTERFACE + source/event.c + source/ns_timeout.c + source/ns_timer.c + source/system_timer.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt new file mode 100644 index 00000000000..c17fbed0df3 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(source/6LoWPAN) +add_subdirectory(source/BorderRouter) +add_subdirectory(source/Common_Protocols) +add_subdirectory(source/Core) +add_subdirectory(source/DHCPv6_Server) +add_subdirectory(source/DHCPv6_client) +add_subdirectory(source/MAC) +add_subdirectory(source/MLE) +add_subdirectory(source/MPL) +add_subdirectory(source/NWK_INTERFACE) +add_subdirectory(source/RPL) +add_subdirectory(source/Security) +add_subdirectory(source/Service_Libs) +add_subdirectory(source/configs) +add_subdirectory(source/ipv6_stack) +add_subdirectory(source/libDHCPv6) +add_subdirectory(source/libNET) + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + . + ./nanostack + ./nanostack/platform + ./source +) + +target_link_libraries(mbed-nanostack + INTERFACE + mbed-nanostack-coap_service +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt new file mode 100644 index 00000000000..acd1b54fa54 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/6LoWPAN/CMakeLists.txt @@ -0,0 +1,109 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/Bootstraps + ${CMAKE_CURRENT_SOURCE_DIR}/Fragmentation + ${CMAKE_CURRENT_SOURCE_DIR}/IPHC_Decode + ${CMAKE_CURRENT_SOURCE_DIR}/MAC + ${CMAKE_CURRENT_SOURCE_DIR}/Mesh + ${CMAKE_CURRENT_SOURCE_DIR}/ND + ${CMAKE_CURRENT_SOURCE_DIR}/NVM + ${CMAKE_CURRENT_SOURCE_DIR}/Thread + ${CMAKE_CURRENT_SOURCE_DIR}/ws +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + adaptation_interface.c + + Bootstraps/Generic/network_lib.c + Bootstraps/Generic/protocol_6lowpan.c + Bootstraps/Generic/protocol_6lowpan_bootstrap.c + Bootstraps/Generic/protocol_6lowpan_interface.c + + Fragmentation/cipv6_fragmenter.c + + IPHC_Decode/6lowpan_iphc.c + IPHC_Decode/iphc_compress.c + IPHC_Decode/iphc_decompress.c + IPHC_Decode/lowpan_context.c + + MAC/beacon_handler.c + MAC/mac_data_poll.c + MAC/mac_helper.c + MAC/mac_ie_lib.c + MAC/mac_pairwise_key.c + MAC/mac_response_handler.c + + Mesh/mesh.c + + ND/nd_router_object.c + + NVM/nwk_nvm.c + + Thread/thread_bbr_api.c + Thread/thread_bbr_commercial.c + Thread/thread_beacon.c + Thread/thread_bootstrap.c + Thread/thread_border_router_api.c + Thread/thread_ccm.c + Thread/thread_commissioning_api.c + Thread/thread_commissioning_if.c + Thread/thread_common.c + Thread/thread_dhcpv6_server.c + Thread/thread_diagnostic.c + Thread/thread_discovery.c + Thread/thread_host_bootstrap.c + Thread/thread_joiner_application.c + Thread/thread_leader_service.c + Thread/thread_lowpower_api.c + Thread/thread_lowpower_private_api.c + Thread/thread_management_api.c + Thread/thread_management_client.c + Thread/thread_management_if.c + Thread/thread_management_server.c + Thread/thread_mdns.c + Thread/thread_meshcop_lib.c + Thread/thread_mle_message_handler.c + Thread/thread_nd.c + Thread/thread_neighbor_class.c + Thread/thread_net_config_api.c + Thread/thread_network_data_lib.c + Thread/thread_network_data_storage.c + Thread/thread_network_synch.c + Thread/thread_nvm_store.c + Thread/thread_resolution_client.c + Thread/thread_resolution_server.c + Thread/thread_router_bootstrap.c + Thread/thread_routing.c + Thread/thread_test_api.c + + ws/ws_bbr_api.c + ws/ws_bootstrap.c + ws/ws_cfg_settings.c + ws/ws_common.c + ws/ws_eapol_auth_relay.c + ws/ws_eapol_pdu.c + ws/ws_eapol_relay.c + ws/ws_eapol_relay_lib.c + ws/ws_empty_functions.c + ws/ws_ie_lib.c + ws/ws_llc_data_service.c + ws/ws_management_api.c + ws/ws_mpx_header.c + ws/ws_neighbor_class.c + ws/ws_pae_auth.c + ws/ws_pae_controller.c + ws/ws_pae_key_storage.c + ws/ws_pae_lib.c + ws/ws_pae_nvm_data.c + ws/ws_pae_nvm_store.c + ws/ws_pae_supp.c + ws/ws_pae_time.c + ws/ws_pae_timers.c + ws/ws_stats.c + ws/ws_test_api.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt new file mode 100644 index 00000000000..efe01ed2d04 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/BorderRouter/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + border_router.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt new file mode 100644 index 00000000000..8e40b3f40f0 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Common_Protocols/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + icmpv6.c + icmpv6_prefix.c + icmpv6_radv.c + ipv6.c + ipv6_flow.c + ipv6_fragmentation.c + ipv6_resolution.c + mld.c + tcp.c + udp.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt new file mode 100644 index 00000000000..0d11a86c42c --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Core/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + buffer_dyn.c + ns_address_internal.c + ns_monitor.c + ns_socket.c + sockbuf.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt new file mode 100644 index 00000000000..c2946321461 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_Server/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + DHCPv6_Server_service.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt new file mode 100644 index 00000000000..19acbc4f118 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/DHCPv6_client/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + dhcpv6_client_service.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt new file mode 100644 index 00000000000..a1021fa1ee5 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/MAC/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/IEEE802_15_4 + ${CMAKE_CURRENT_SOURCE_DIR}/virtual_rf +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + rf_driver_storage.c + + IEEE802_15_4/mac_cca_threshold.c + IEEE802_15_4/mac_fhss_callbacks.c + IEEE802_15_4/mac_filter.c + IEEE802_15_4/mac_header_helper_functions.c + IEEE802_15_4/mac_indirect_data.c + IEEE802_15_4/mac_mcps_sap.c + IEEE802_15_4/mac_mlme.c + IEEE802_15_4/mac_pd_sap.c + IEEE802_15_4/mac_security_mib.c + IEEE802_15_4/mac_timer.c + IEEE802_15_4/sw_mac.c + + ethernet/ethernet_mac_api.c + + serial/serial_mac_api.c + + virtual_rf/virtual_rf_client.c + virtual_rf/virtual_rf_driver.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt new file mode 100644 index 00000000000..e70aebdc44c --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/MLE/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + mle.c + mle_tlv.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt new file mode 100644 index 00000000000..2e3ca782321 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/MPL/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + mpl.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt new file mode 100644 index 00000000000..5b06badfa3e --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/Include +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + protocol_core.c + protocol_core_sleep.c + protocol_stats.c + protocol_timer.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt new file mode 100644 index 00000000000..326e922b6a8 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/RPL/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + rpl_control.c + rpl_data.c + rpl_downward.c + rpl_mrhof.c + rpl_objective.c + rpl_of0.c + rpl_policy.c + rpl_upward.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt new file mode 100644 index 00000000000..01ba3992a4d --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Security/CMakeLists.txt @@ -0,0 +1,67 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/Common + ${CMAKE_CURRENT_SOURCE_DIR}/PANA + ${CMAKE_CURRENT_SOURCE_DIR}/TLS + ${CMAKE_CURRENT_SOURCE_DIR}/eapol + ${CMAKE_CURRENT_SOURCE_DIR}/kmp + ${CMAKE_CURRENT_SOURCE_DIR}/protocols + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/eap_tls_sec_prot + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/fwh_sec_prot + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/gkh_sec_prot + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/key_sec_prot + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/radius_sec_prot + ${CMAKE_CURRENT_SOURCE_DIR}/protocols/tls_sec_prot +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + Common/security_lib.c + + PANA/eap_protocol.c + PANA/pana.c + PANA/pana_avp.c + PANA/pana_client.c + PANA/pana_eap_header.c + PANA/pana_header.c + PANA/pana_relay_table.c + PANA/pana_server.c + + TLS/tls_ccm_crypt.c + TLS/tls_lib.c + + eapol/eapol_helper.c + eapol/kde_helper.c + + kmp/kmp_addr.c + kmp/kmp_api.c + kmp/kmp_eapol_pdu_if.c + kmp/kmp_socket_if.c + + protocols/sec_prot_certs.c + protocols/sec_prot_keys.c + protocols/sec_prot_lib.c + + protocols/eap_tls_sec_prot/auth_eap_tls_sec_prot.c + protocols/eap_tls_sec_prot/eap_tls_sec_prot_lib.c + protocols/eap_tls_sec_prot/radius_eap_tls_sec_prot.c + protocols/eap_tls_sec_prot/supp_eap_tls_sec_prot.c + + protocols/fwh_sec_prot/auth_fwh_sec_prot.c + protocols/fwh_sec_prot/supp_fwh_sec_prot.c + + protocols/gkh_sec_prot/auth_gkh_sec_prot.c + protocols/gkh_sec_prot/supp_gkh_sec_prot.c + + protocols/key_sec_prot/key_sec_prot.c + + protocols/radius_sec_prot/avp_helper.c + protocols/radius_sec_prot/radius_client_sec_prot.c + + protocols/tls_sec_prot/tls_sec_prot.c + protocols/tls_sec_prot/tls_sec_prot_lib.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt new file mode 100644 index 00000000000..0ca93b60f36 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/Service_Libs/CMakeLists.txt @@ -0,0 +1,103 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/Neighbor_cache + ${CMAKE_CURRENT_SOURCE_DIR}/Trickle + ${CMAKE_CURRENT_SOURCE_DIR}/blacklist + ${CMAKE_CURRENT_SOURCE_DIR}/etx + ${CMAKE_CURRENT_SOURCE_DIR}/fhss + ${CMAKE_CURRENT_SOURCE_DIR}/fnv_hash + ${CMAKE_CURRENT_SOURCE_DIR}/hmac + ${CMAKE_CURRENT_SOURCE_DIR}/ieee_802_11 + ${CMAKE_CURRENT_SOURCE_DIR}/load_balance + ${CMAKE_CURRENT_SOURCE_DIR}/mac_neighbor_table + ${CMAKE_CURRENT_SOURCE_DIR}/mdns + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/port + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/port/compiler + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/port/cpu + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/services + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/services/dns + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/services/mdns + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/services/poll + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/services/serial + ${CMAKE_CURRENT_SOURCE_DIR}/mdns/fnet/fnet_stack/stack + ${CMAKE_CURRENT_SOURCE_DIR}/mle_service + ${CMAKE_CURRENT_SOURCE_DIR}/nd_proxy + ${CMAKE_CURRENT_SOURCE_DIR}/nist_aes_kw + ${CMAKE_CURRENT_SOURCE_DIR}/pan_blacklist + ${CMAKE_CURRENT_SOURCE_DIR}/utils + ${CMAKE_CURRENT_SOURCE_DIR}/whiteboard +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + CCM_lib/ccm_security.c + + CCM_lib/mbedOS/aes_mbedtls_adapter.c + + Neighbor_cache/neighbor_cache.c + + SHA256_Lib/ns_sha256.c + SHA256_Lib/shalib.c + + Trickle/trickle.c + + blacklist/blacklist.c + + etx/etx.c + + fhss/channel_functions.c + fhss/channel_list.c + fhss/fhss.c + fhss/fhss_channel.c + fhss/fhss_common.c + fhss/fhss_configuration_interface.c + fhss/fhss_statistics.c + fhss/fhss_test_api.c + fhss/fhss_ws.c + fhss/fhss_ws_empty_functions.c + + fnv_hash/fnv_hash.c + + hmac/hmac_md.c + + ieee_802_11/ieee_802_11.c + + load_balance/load_balance.c + + mac_neighbor_table/mac_neighbor_table.c + + mdns/ns_fnet_events.c + mdns/ns_fnet_port.c + mdns/ns_mdns_api.c + + mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c + + mdns/fnet/fnet_stack/services/poll/fnet_poll.c + + mdns/fnet/fnet_stack/stack/fnet_stdlib.c + + mle_service/mle_service.c + mle_service/mle_service_buffer.c + mle_service/mle_service_frame_counter_table.c + mle_service/mle_service_interface.c + mle_service/mle_service_security.c + + nd_proxy/nd_proxy.c + + nist_aes_kw/nist_aes_kw.c + + pan_blacklist/pan_blacklist.c + + utils/isqrt.c + utils/ns_conf.c + utils/ns_crc.c + utils/ns_file_system.c + + whiteboard/whiteboard.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt new file mode 100644 index 00000000000..ee8f751e5c6 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/configs/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/base +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt new file mode 100644 index 00000000000..112586ffbfc --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/ipv6_stack/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + ipv6_routing_table.c + protocol_ipv6.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt new file mode 100644 index 00000000000..e99b2b9deda --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/libDHCPv6/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + dhcp_service_api.c + libDHCPv6.c + libDHCPv6_server.c + libDHCPv6_vendordata.c +) diff --git a/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt b/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt new file mode 100644 index 00000000000..1babaf60aa9 --- /dev/null +++ b/connectivity/nanostack/sal-stack-nanostack/source/libNET/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nanostack-sal_stack + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/src +) + +target_sources(mbed-nanostack-sal_stack + INTERFACE + src/multicast_api.c + src/net_6lowpan_parameter_api.c + src/net_dns.c + src/net_dns_internal.h + src/net_ipv6.c + src/net_load_balance.c + src/net_load_balance_internal.h + src/net_mle.c + src/net_rpl.c + src/net_short_address_extension.c + src/net_test.c + src/ns_net.c + src/socket_api.c +) diff --git a/connectivity/netsocket/CMakeLists.txt b/connectivity/netsocket/CMakeLists.txt new file mode 100644 index 00000000000..f6c42886b70 --- /dev/null +++ b/connectivity/netsocket/CMakeLists.txt @@ -0,0 +1,66 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# TODO CMake: Perhaps move this/these file(s) +target_sources(mbed-cellular + INTERFACE + source/CellularNonIPSocket.cpp +) + +target_include_directories(mbed-netsocket + INTERFACE + . + ./include + ./include/netsocket +) + +target_sources(mbed-netsocket + INTERFACE + source/DTLSSocket.cpp + source/DTLSSocketWrapper.cpp + source/EMACInterface.cpp + source/EthernetInterface.cpp + source/ICMPSocket.cpp + source/InternetDatagramSocket.cpp + source/InternetSocket.cpp + source/L3IPInterface.cpp + source/NetStackMemoryManager.cpp + source/NetworkInterface.cpp + source/NetworkInterfaceDefaults.cpp + source/NetworkStack.cpp + source/PPPInterface.cpp + source/SocketAddress.cpp + source/SocketStats.cpp + source/TCPSocket.cpp + source/TLSSocket.cpp + source/TLSSocketWrapper.cpp + source/UDPSocket.cpp + source/WiFiAccessPoint.cpp + source/nsapi_dns.cpp + source/nsapi_ppp.cpp +) + +target_compile_definitions(mbed-netsocket + INTERFACE + MBED_CONF_NSAPI_PRESENT=1 +) + +target_link_libraries(mbed-netsocket + INTERFACE + mbed-mbedtls + mbed-lwipstack + mbed-events +) + +if("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS) + target_link_libraries(mbed-netsocket + INTERFACE + mbed-emac + ) +endif() + +target_link_libraries(mbed-netsocket + INTERFACE + mbed-cellular + mbed-nanostack-libservice +) diff --git a/connectivity/nfc/CMakeLists.txt b/connectivity/nfc/CMakeLists.txt new file mode 100644 index 00000000000..e392191e1d9 --- /dev/null +++ b/connectivity/nfc/CMakeLists.txt @@ -0,0 +1,46 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(libraries) + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc + ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/ndef + ${CMAKE_CURRENT_SOURCE_DIR}/include/nfc/ndef/common +) + +target_sources(mbed-nfc + INTERFACE + source/NFCController.cpp + source/NFCControllerDriver.cpp + source/NFCEEPROM.cpp + source/NFCEEPROMDriver.cpp + source/NFCNDEFCapable.cpp + source/NFCRemoteEndpoint.cpp + source/NFCRemoteInitiator.cpp + source/NFCTarget.cpp + source/Type4RemoteInitiator.cpp + + source/ndef/MessageBuilder.cpp + source/ndef/MessageParser.cpp + source/ndef/RecordParser.cpp + + source/ndef/common/Mime.cpp + source/ndef/common/SimpleMessageParser.cpp + source/ndef/common/Text.cpp + source/ndef/common/URI.cpp + source/ndef/common/util.cpp +) + +target_compile_definitions(mbed-nfc + INTERFACE + MBED_CONF_NFC_PRESENT=1 +) + +target_link_libraries(mbed-nfc + INTERFACE + mbed-events +) diff --git a/connectivity/nfc/libraries/CMakeLists.txt b/connectivity/nfc/libraries/CMakeLists.txt new file mode 100644 index 00000000000..88ec2f12228 --- /dev/null +++ b/connectivity/nfc/libraries/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(acore) +add_subdirectory(stack) + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/connectivity/nfc/libraries/acore/CMakeLists.txt b/connectivity/nfc/libraries/acore/CMakeLists.txt new file mode 100644 index 00000000000..2054aaba5ce --- /dev/null +++ b/connectivity/nfc/libraries/acore/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/acore +) + +target_sources(mbed-nfc + INTERFACE + source/ac_buffer.c + source/ac_buffer_builder.c + source/ac_buffer_reader.c + source/ac_stream.c +) diff --git a/connectivity/nfc/libraries/stack/CMakeLists.txt b/connectivity/nfc/libraries/stack/CMakeLists.txt new file mode 100644 index 00000000000..6727ed7b908 --- /dev/null +++ b/connectivity/nfc/libraries/stack/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(tech) +add_subdirectory(transceiver) + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/ndef + ${CMAKE_CURRENT_SOURCE_DIR}/platform +) + +target_sources(mbed-nfc + INTERFACE + ndef/ndef.c + + platform/nfc_scheduler.c + platform/nfc_transport.c +) diff --git a/connectivity/nfc/libraries/stack/tech/CMakeLists.txt b/connectivity/nfc/libraries/stack/tech/CMakeLists.txt new file mode 100644 index 00000000000..5f4f0d8e1bb --- /dev/null +++ b/connectivity/nfc/libraries/stack/tech/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/iso7816 + ${CMAKE_CURRENT_SOURCE_DIR}/isodep + ${CMAKE_CURRENT_SOURCE_DIR}/type4 +) + +target_sources(mbed-nfc + INTERFACE + iso7816/iso7816.c + iso7816/iso7816_app.c + + isodep/isodep_target.c + + type4/type4_target.c +) diff --git a/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt b/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt new file mode 100644 index 00000000000..48a733da3ad --- /dev/null +++ b/connectivity/nfc/libraries/stack/transceiver/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-nfc + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-nfc + INTERFACE + transceiver.c +) diff --git a/docs/design-documents/tools/cmake.md b/docs/design-documents/tools/cmake.md new file mode 100644 index 00000000000..2c700ceb5a5 --- /dev/null +++ b/docs/design-documents/tools/cmake.md @@ -0,0 +1,111 @@ +# CMake Mbed OS + +Requirements: +- CMake 3.18.2 and higher +- `mbed-tools` (python 3.6 and higher) + +Two steps approach: + +- Mbed OS core CMake +- Building an application with mbed-tools + +Definitions and configurations would be defined in CMake files, an Mbed app configuration file (`/path/to/app/mbed_app.json`) and Mbed library configuration files (`/path/to/mbed-os//mbed_lib.json`). `mbed-tools` would parse the Mbed library and app configuration files and generate an `mbed_config.cmake` file. + +The following rules must be respected to include special prefix directories (TARGET_, COMPONENT_ and FEATURE_). + +Target labels, components, and features defined in `/path/to/mbed-os/targets/targets.json` are used to help the build system determine which directories contain sources/include files to use in the build process. + +This is a problem as labels, components and features directories will most likely be renamed and will not necessarily use the special prefixes TARGET_, COMPONENT_ and FEATURE_ respectively. Whenever such directories are encountered, check the directory name without the special prefix in the CMake list `MBED_TARGET_LABELS` generated by `mbed-tools` then include the subdirectory to the build process if found. + +For example when the user builds for the `NUCLEO_F411RE` Mbed target, `mbed-tools` includes the `STM` label to the `MBED_TARGET_LABELS` list. `TARGET_STM` can only be added to the list of build directories as shown below: + +``` +# CMake input source file: mbed-os/targets/CMakeList.txt + +if("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +endif() +``` +The same could be applied to other labels like features or components. + +## Mbed OS Core (Mbed OS repository) + +There are numerous CMake files in the Mbed OS repository tree: + +* A `CMakeLists.txt` entry point in the Mbed OS root, describing the top level build specification for the Mbed OS source tree. +* `CMakeLists.txt` entry points in each Mbed OS module subdirectory, describing the build specification for a module or component + +A number of CMake scripts are contained in the `mbed-os/tools/cmake` directory: +* `core.cmake` - selects the core script from the `cmake/cores` directory, based on the value of the `MBED_CPU_CORE` variable +* `profile.cmake` - selects the profile script from the `cmake/profiles` directory, based on the value of the `MBED_PROFILE` variable +* `toolchain.cmake` - selects the toolchain script from the `cmake/toolchains` directory, based on the value of the `MBED_TOOLCHAIN` variable + +The next sections will describe static CMake files within Mbed OS Core repository. + +### 1. Mbed OS `CMakeLists.txt` Entry Point + +The `CMakeLists.txt` entry point in the root of the Mbed OS repository contains the top level build specification for Mbed OS. This file also includes the auto generated `mbed_config.cmake` script, which is created by `mbed-tools`. + +This is not intended to be included by an application. Applications must use `add_subdirectory(${MBED_PATH})`. + +### 2. Toolchain CMake Scripts + +All the toolchain settings are defined in the scripts found in `cmake/toolchains/`. + +### 3. Profile CMake Scripts + +The build profiles such as release or debug are defined in the scripts found in `cmake/profiles/`. + +### 4. MCU Core CMake Scripts + +The MCU core definitions are defined in the scripts found in `cmake/cores/`. + +### 5. Utilities CMake Scripts + +Custom functions/macros used within Mbed OS. + +### 7. Component `CMakeLists.txt` Entry Point + +This file statically defines the build specification of an Mbed OS component. It contains conditional statements that depend on the configuration parameters generated by `mbed-tools`. +The rule of thumb is to not expose header files that are internal. We would like to avoid having everything in the include paths as we do now. + +## Building an Application + +`mbed-tools` is the next generation of command line tooling for Mbed OS. `mbed-tools` replaces `mbed-cli` and the Python modules in the `mbed-os/tools` directory. + +`mbed-tools` consolidates all of the required modules to build Mbed OS, along with the command line interface, into a single Python package which can be installed using standard Python packaging tools. + +Each application contains a top-level CMakeLists.txt file. The `mbedtools init` command can create this top-level CMakeLists.txt, or a user can create it manually. Each application also has a number of json configuration files. `mbedtools configure` creates an Mbed configuration CMake file (`.mbedbuild/mbed_config.cmake`). The process for building an application looks like: + +1. Parse the arguments provided to build command +1. Parse the application configuration +1. Get the target configuration +1. Get the Mbed OS configuration (select what modules we need and get their config, paths, etc) +1. Create .mbedbuild/mbed_config.cmake +1. Build an application + +### Configuration + +The main purpose of `mbed-tools` is to parse the Mbed configuration system's JSON files (`mbed_lib.json`, `mbed_app.json` and `targets.json`). The tool outputs a single CMake configuration script, which is included by `app.cmake` and `mbed-os/CMakeLists.txt`. + +To generate the CMake config script (named `mbed_config.cmake`) the user can run the `configure` command: + +`mbedtools configure -t -m ` + +This will output `mbed_config.cmake` in a directory named `.mbedbuild` at the root of the program tree. + +`mbed_config.cmake` contains several variable definitions used to select the toolchain, core and profile CMake scripts to be used in the build system generation: +* `MBED_TOOLCHAIN` +* `MBED_TARGET` +* `MBED_CPU_CORE` +* `MBED_C_LIB` +* `MBED_TARGET_SUPPORTED_C_LIBS` +* `MBED_PRINTF_LIB` + +The tools also generate an `MBED_TARGET_LABELS` variable, containing the labels, components and feature definitions from `targets.json`, used to select the required Mbed OS components to be built. + +The macro definitions parsed from the Mbed OS configuration system are also included in `mbed_config.cmake`, so it is no longer necessary for the tools to generate any `mbed_config.h` file to define macros. + +### mbedignore + +With a build system that can understand dependencies between applications, features, components, and targets, `mbedignore` is no longer needed. CMake creates a list of exactly what's needed for an application build, rather than do what the legacy tools did and include everything by default, leaving the application to specify what is not needed. It's far more natural to express what you need rather than what you don't need, not to mention more future proof should some new feature appear in Mbed OS which your application would need to ignore. diff --git a/docs/design-documents/tools/cmake_components.md b/docs/design-documents/tools/cmake_components.md new file mode 100644 index 00000000000..b09ecbfda93 --- /dev/null +++ b/docs/design-documents/tools/cmake_components.md @@ -0,0 +1,136 @@ +# Creating components with CMake + +One of the main goals to achieve with CMake is to have components in Mbed OS. A modular built allowing users to select what they require, not building everything as we used to with old tools. + +## Components in Mbed OS (bare-metal) + +Mbed OS consist of: +- cmsis +- rtos-api +- drivers +- platform +- hal +- targets + +Their dependencies: + +cmsis: +None + +drivers: +- platform +- rtos-api +- hal +- targets +- events + +rtos-api: +- targets +- platform + +platform: +- rtos-api +- hal +- targets + +hal: +- targets + +targets: +- hal +- drivers +- platform +- rtos-api +- cmsis + +Breaking the dependencies would be a huge effort and it possibly would result in rewriting these components as they were for years considered as monolitic - having everything available. + +## Components as object libraries + +CMake provides OBJECT libraries but it does not support circular dependencies that we have in our tree. Therefore we build Mbed OS as whole (all object files combined). + +## One object library "mbed-core" + +Our current approach on feature-cmake branch is to use OBJECT libraries. We built almost entire tree of Mbed OS, the number of object files is big. As result building take longer and we have again windows path limitation (one file compilation command is more than 43k characters long). + +To address the problem, CMake provides response files. They do not work out of the box as we experienced. Generators support them but they contain bugs. We found at least two bugs in CMake itself (Ninja, Make tested with Gcc Arm and ARMClang). We are still possibly having issues with other generators (more testing is required). + +Note, we shall use response files with static libraries or any other solution we choose to avoid path limitation in OS. + +These bugs will be fixed eventually. However, we still have not addressed the main problem - there are too many objects files to compile. We need a solution to split the tree into components and built only what is required. Therefore response files could be considered as a workaround for now until we get components in CMake. + +## Only core libraries built as objects + +These components would form mbed-core library built as OBJECT library in CMake: +- cmsis +- events +- rtos-api +- drivers +- hal +- targets +- platform + +The rest of components and features could be static or object libraries. They could be selected by a user and be added on request. + +## Components as static libraries + +It is a known problem that weakly linked symbols are not resolved with strong symbols with static libraries. We won't disallow linking with static libraries, just internal Mbed OS components should be object libraries to avoid the problem with weakly symbols as many of the components rely on them. + +### Using whole-archive to workaround weak symbols limitation + +Toolchains provide a flag to enforce keeping symbols (GCC --whole-archive, clang -force_load). See the issue with forcing linker flag to the components https://github.com/zephyrproject-rtos/zephyr/issues/8441 and https://github.com/zephyrproject-rtos/zephyr/issues/6961 for details. This has drawbacks that will need more research. See also CMake issue https://gitlab.kitware.com/cmake/cmake/-/issues/20078 - not simple to fix in CMake. + +`whole-archive` is only available to Gcc Arm, ARMClang does not provide it. + +### Removing weak symbols + +We could find alternative to weak symbols and fix them in our tree one by one. It was already achieved in Mbed OS 3 where we did not support weak symbols. + +### Object files for files with weak symbols + +Mbed 2 was released as a library, we provided object files for files that were providing weak symbols (retarget, file handling and others). They were linked together with the mbed library. This however might not be achievable (its implementation in CMake might contain hacks to get other components paths and flags as retarget file depends on multiple other components). + +## External components + +They can be either object or static library. Only one limitation due to selecting object library is that any component linked by an application shall not have circular dependencies between the components (CMake will issue an error that we are linking with an object library (`mbed-core`) and it does not support it - this will be fixed but no ETA given). + +## Solution: Mbed-os components + +mbed-core component (object library) consists of: +- cmsis +- events +- rtos-api +- drivers +- hal +- targets +- platform + +The rest of the tree is formed by components. + +Each component creates a new CMake library and adds includes/sources: + +``` +add_library(mbed-nanostack INTERFACE) + +target_include_directories(mbed-nanostack + INTERFACE + include +) + +target_sources(mbed-nanostack + INTERFACE + file.c +) +``` + +If there are dependencies for a component, use `target_link_libraries`. For instance, nanostack depends on 4 other components: + +``` +target_link_libraries(mbed-nanostack INTERFACE mbed-nanostack-libservice mbed-netsocket mbed-coap) +``` + +An application just links to what is required: + +``` +target_link_libraries(mbed-os-example-nanostack-example mbed-nanostack mbed-core) +``` diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt new file mode 100644 index 00000000000..83bb2223098 --- /dev/null +++ b/drivers/CMakeLists.txt @@ -0,0 +1,46 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . + ./include + ./include/drivers + ./include/drivers/internal +) + +target_sources(mbed-core + INTERFACE + source/AnalogIn.cpp + source/AnalogOut.cpp + source/BufferedSerial.cpp + source/BusIn.cpp + source/BusInOut.cpp + source/BusOut.cpp + source/CAN.cpp + source/DigitalIn.cpp + source/DigitalInOut.cpp + source/DigitalOut.cpp + source/FlashIAP.cpp + source/I2C.cpp + source/I2CSlave.cpp + source/InterruptIn.cpp + source/MbedCRC.cpp + source/PortIn.cpp + source/PortInOut.cpp + source/PortOut.cpp + source/PwmOut.cpp + source/QSPI.cpp + source/ResetReason.cpp + source/SPI.cpp + source/SPISlave.cpp + source/SerialBase.cpp + source/SerialWireOutput.cpp + source/Ticker.cpp + source/Timeout.cpp + source/Timer.cpp + source/TimerEvent.cpp + source/UnbufferedSerial.cpp + source/Watchdog.cpp +) + diff --git a/drivers/device_key/CMakeLists.txt b/drivers/device_key/CMakeLists.txt new file mode 100644 index 00000000000..2edc173faeb --- /dev/null +++ b/drivers/device_key/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# This is a specific driver for the mbed-storage CMake target. +# TODO CMake: Perhaps move this/these file(s) +target_include_directories(mbed-device_key + INTERFACE + ./include + ./include/device_key +) + +target_sources(mbed-device_key + INTERFACE + source/DeviceKey.cpp + ../source/SFDP.cpp +) + +target_link_libraries(mbed-device_key + INTERFACE + mbed-storage-kvstore +) diff --git a/drivers/source/usb/CMakeLists.txt b/drivers/source/usb/CMakeLists.txt new file mode 100644 index 00000000000..f11766443bd --- /dev/null +++ b/drivers/source/usb/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-usb INTERFACE) + +target_include_directories(mbed-usb + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-usb + INTERFACE + AsyncOp.cpp + ByteBuffer.cpp + EndpointResolver.cpp + LinkedListBase.cpp + OperationListBase.cpp + PolledQueue.cpp + TaskBase.cpp + USBAudio.cpp + USBCDC.cpp + USBCDC_ECM.cpp + USBDevice.cpp + USBHID.cpp + USBKeyboard.cpp + USBMIDI.cpp + USBMSD.cpp + USBMouse.cpp + USBMouseKeyboard.cpp + USBSerial.cpp +) + +target_link_libraries(mbed-usb INTERFACE mbed-storage) diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt new file mode 100644 index 00000000000..1b6ed37aa3c --- /dev/null +++ b/events/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-events INTERFACE) + +target_include_directories(mbed-events + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/events + ${CMAKE_CURRENT_SOURCE_DIR}/include/events/internal +) + +target_sources(mbed-events + INTERFACE + source/EventQueue.cpp + source/equeue.c + source/equeue_mbed.cpp + source/equeue_posix.c + source/mbed_shared_queues.cpp +) + +target_compile_definitions(mbed-events + INTERFACE + MBED_CONF_EVENTS_PRESENT=1 +) diff --git a/features/CMakeLists.txt b/features/CMakeLists.txt new file mode 100644 index 00000000000..2ed29211d20 --- /dev/null +++ b/features/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# List of all features libraries available. +add_library(mbed-fpga-ci-test-shield INTERFACE) +add_library(mbed-client-cli INTERFACE) + +add_subdirectory(frameworks/COMPONENT_FPGA_CI_TEST_SHIELD) +add_subdirectory(frameworks/mbed-client-cli) diff --git a/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt b/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt new file mode 100644 index 00000000000..76a5f8dd52d --- /dev/null +++ b/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-fpga-ci-test-shield + INTERFACE + include + include/fpga_ci_test_shield +) + +target_sources(mbed-fpga-ci-test-shield + INTERFACE + source/DynamicPinList.cpp + source/I2CTester.cpp + source/MbedTester.cpp + source/SPIMasterTester.cpp + source/SPISlaveTester.cpp + source/SPITester.cpp + source/UARTTester.cpp +) diff --git a/features/frameworks/mbed-client-cli/CMakeLists.txt b/features/frameworks/mbed-client-cli/CMakeLists.txt new file mode 100644 index 00000000000..bb923d44476 --- /dev/null +++ b/features/frameworks/mbed-client-cli/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-client-cli + INTERFACE + . + ./mbed-client-cli +) + +target_sources(mbed-client-cli + INTERFACE + source/ns_cmdline.c +) + +target_link_libraries(mbed-client-cli + INTERFACE + mbed-nanostack-libservice +) diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt new file mode 100644 index 00000000000..21b16d313c3 --- /dev/null +++ b/hal/CMakeLists.txt @@ -0,0 +1,35 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("FLASH_CMSIS_ALGO" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_FLASH_CMSIS_ALGO) +endif() + +add_subdirectory(usb) + +target_include_directories(mbed-core + INTERFACE + include + include/hal +) + +target_sources(mbed-core + INTERFACE + source/LowPowerTickerWrapper.cpp + source/mbed_compat.c + source/mbed_critical_section_api.c + source/mbed_flash_api.c + source/mbed_gpio.c + source/mbed_gpio_irq.c + source/mbed_itm_api.c + source/mbed_lp_ticker_api.c + source/mbed_lp_ticker_wrapper.cpp + source/mbed_pinmap_common.c + source/mbed_pinmap_default.cpp + source/mbed_ticker_api.c + source/mbed_us_ticker_api.c + source/static_pinmap.cpp + + source/mpu/mbed_mpu_v7m.c + source/mpu/mbed_mpu_v8m.c +) diff --git a/hal/TARGET_FLASH_CMSIS_ALGO/CMakeLists.txt b/hal/TARGET_FLASH_CMSIS_ALGO/CMakeLists.txt new file mode 100644 index 00000000000..8a9fc13355e --- /dev/null +++ b/hal/TARGET_FLASH_CMSIS_ALGO/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + flash_common_algo.c +) diff --git a/hal/usb/CMakeLists.txt b/hal/usb/CMakeLists.txt new file mode 100644 index 00000000000..1215cf1d3f9 --- /dev/null +++ b/hal/usb/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + include + include/usb +) + +target_sources(mbed-core + INTERFACE + source/mbed_usb_phy.cpp +) diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt new file mode 100644 index 00000000000..69c499a53ac --- /dev/null +++ b/platform/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# List of all optional platform libraries available. +add_library(mbed-psa INTERFACE) + + +add_subdirectory(cxxsupport) +add_subdirectory(mbed-trace) +add_subdirectory(randlib) +add_subdirectory(source) + +target_include_directories(mbed-core + INTERFACE + include + include/platform + include/platform/internal +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt new file mode 100644 index 00000000000..c04124984fd --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("PSA" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(FEATURE_PSA) +endif() diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt new file mode 100644 index 00000000000..135ff80def9 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MBED_PSA_SRV" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MBED_PSA_SRV) +endif() + +if("TFM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM) +endif() + +target_include_directories(mbed-psa + INTERFACE + ./inc + ./inc/psa +) + +target_sources(mbed-psa + INTERFACE + src/psa_hrng.c +) + +target_link_libraries(mbed-psa + INTERFACE + mbed-mbedtls + mbed-storage-kvstore +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt new file mode 100644 index 00000000000..435c8527152 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(services) + +target_include_directories(mbed-psa + INTERFACE + ./inc + ./inc/psa + ./mbedtls + ./pal +) + +target_sources(mbed-psa + INTERFACE + mbedtls/psa_crypto.c + mbedtls/psa_crypto_se.c + mbedtls/psa_crypto_slot_management.c + mbedtls/psa_crypto_storage.c + mbedtls/psa_its_file.c + + pal/pal_attestation_eat.c + pal/pal_attestation_intf.c + pal/pal_client_api_empty_intf.c + pal/pal_client_api_intf.c + pal/pal_internal_trusted_storage_intf.c + pal/pal_protected_storage_intf.c + + src/client.c + src/default_random_seed.cpp +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt new file mode 100644 index 00000000000..67da20cf0fd --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(attestation) +add_subdirectory(storage) + +target_include_directories(mbed-psa + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/platform +) + +target_sources(mbed-psa + INTERFACE + platform/platform_emul.c + platform/platform_srv_impl.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt new file mode 100644 index 00000000000..6a5daf34e21 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/attestation/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-psa + INTERFACE + . + ./qcbor + ./qcbor/inc + ./qcbor/src + ./tfm_impl + ./tfm_impl/t_cose/inc + ./tfm_impl/t_cose/src +) + +target_sources(mbed-psa + INTERFACE + attest_boot_status_loader.c + attest_crypto.c + attest_crypto_keys.c + attest_iat_claims_loader.c + attestation_bootloader_data.c + psa_attest_inject_key.c + psa_attestation_stubs.c + psa_initial_attestation_api.c + psa_inject_attestation_key_impl.c + + qcbor/src/UsefulBuf.c + qcbor/src/ieee754.c + qcbor/src/qcbor_decode.c + qcbor/src/qcbor_encode.c + + tfm_impl/attest_token.c + tfm_impl/attestation_core.c + + tfm_impl/t_cose/src/t_cose_sign1_sign.c + tfm_impl/t_cose/src/t_cose_util.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt new file mode 100644 index 00000000000..291d2c4e43b --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV/services/storage/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-psa + INTERFACE + ./common + ./its +) + +target_sources(mbed-psa + INTERFACE + common/psa_storage_common_impl.cpp + + its/pits_impl.cpp + its/psa_prot_internal_storage.cpp + + ps/protected_storage.cpp +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt new file mode 100644 index 00000000000..0608fb1c94a --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("TFM_V1_0" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V1_0) +endif() + +if("TFM_V1_1" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V1_1) +endif() diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt new file mode 100644 index 00000000000..1ca948ade45 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("TFM_DUALCPU" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_DUALCPU) +endif() + +if("TFM_V8M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V8M) +endif() + +target_include_directories(mbed-psa + INTERFACE + ./include + ./include/psa + ./include/psa_manifest +) + +target_sources(mbed-psa + INTERFACE + src/tfm_crypto_ipc_api.c + src/tfm_initial_attestation_ipc_api.c + src/tfm_its_ipc_api.c + src/tfm_platform_ipc_api.c + src/tfm_sst_ipc_api.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt new file mode 100644 index 00000000000..81e5279024d --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_DUALCPU/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-psa + INTERFACE + src/platform_multicore.c + src/platform_ns_mailbox.c + src/tfm_mbed_boot.c + src/tfm_multi_core_api.c + src/tfm_multi_core_psa_ns_api.c + src/tfm_ns_mailbox.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt new file mode 100644 index 00000000000..30bf8112a17 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/TARGET_TFM_V8M/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-psa + INTERFACE + src/cmsis_nvic_virtual.c + src/tfm_mbed_boot.c + src/tfm_ns_interface.c + src/tfm_psa_ns_api.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt new file mode 100644 index 00000000000..ee43d7eb8d6 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("TFM_DUALCPU" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_DUALCPU) +endif() + +if("TFM_V8M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_TFM_V8M) +endif() + +target_include_directories(mbed-psa + INTERFACE + ./include + ./include/psa + ./include/psa_manifest +) + +target_sources(mbed-psa + INTERFACE + src/tfm_crypto_ipc_api.c + src/tfm_initial_attestation_ipc_api.c + src/tfm_its_ipc_api.c + src/tfm_platform_ipc_api.c + src/tfm_ps_ipc_api.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt new file mode 100644 index 00000000000..81e5279024d --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_DUALCPU/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-psa + INTERFACE + src/platform_multicore.c + src/platform_ns_mailbox.c + src/tfm_mbed_boot.c + src/tfm_multi_core_api.c + src/tfm_multi_core_psa_ns_api.c + src/tfm_ns_mailbox.c +) diff --git a/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt new file mode 100644 index 00000000000..30bf8112a17 --- /dev/null +++ b/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_1/TARGET_TFM_V8M/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-psa + INTERFACE + src/cmsis_nvic_virtual.c + src/tfm_mbed_boot.c + src/tfm_ns_interface.c + src/tfm_psa_ns_api.c +) diff --git a/platform/cxxsupport/CMakeLists.txt b/platform/cxxsupport/CMakeLists.txt new file mode 100644 index 00000000000..e631264961a --- /dev/null +++ b/platform/cxxsupport/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + mstd_mutex.cpp +) diff --git a/platform/mbed-trace/CMakeLists.txt b/platform/mbed-trace/CMakeLists.txt index 1b0db50b06b..8ce73855735 100644 --- a/platform/mbed-trace/CMakeLists.txt +++ b/platform/mbed-trace/CMakeLists.txt @@ -1,17 +1,15 @@ -INCLUDE(CMakeForceCompiler) +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required (VERSION 2.8) -SET(CMAKE_SYSTEM_NAME Generic) +add_subdirectory(source) -project(mbedTrace) +target_include_directories(mbed-core + INTERFACE + include + include/mbed-trace +) - -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mbed-trace/) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nanostack-libservice/mbed-client-libservice/) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../nanostack-libservice/) - -set (MBED_TRACE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/source/mbed_trace.c) - - -CREATE_LIBRARY(mbedTrace "${MBED_TRACE_SRC}" "") +target_sources(mbed-core + INTERFACE + source/mbed_trace.c +) diff --git a/platform/mbed-trace/source/CMakeLists.txt b/platform/mbed-trace/source/CMakeLists.txt index 7e7a0a08f45..b5facd3ae42 100644 --- a/platform/mbed-trace/source/CMakeLists.txt +++ b/platform/mbed-trace/source/CMakeLists.txt @@ -1,18 +1,18 @@ if(DEFINED TARGET_LIKE_X86_LINUX_NATIVE) - add_library( mbed-trace - mbed_trace.c - ) + # add_library( mbed-trace + # mbed_trace.c + # ) add_definitions("-g -O0 -fprofile-arcs -ftest-coverage") - target_link_libraries(mbed-trace gcov nanostack-libservice) + # target_link_libraries(mbed-trace gcov nanostack-libservice) elseif(DEFINED TARGET_LIKE_X86_OSX_NATIVE) - add_library( mbed-trace - mbed_trace.c - ) + # add_library( mbed-trace + # mbed_trace.c + # ) add_definitions("-g -O0") - target_link_libraries(mbed-trace nanostack-libservice) -else() - add_library( mbed-trace - mbed_trace.c - ) - target_link_libraries(mbed-trace nanostack-libservice) + # target_link_libraries(mbed-trace nanostack-libservice) +# else() + # add_library( mbed-trace + # mbed_trace.c + # ) + # target_link_libraries(mbed-trace nanostack-libservice) endif() diff --git a/platform/randlib/CMakeLists.txt b/platform/randlib/CMakeLists.txt new file mode 100644 index 00000000000..790b71df24d --- /dev/null +++ b/platform/randlib/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-randlib INTERFACE) + +target_include_directories(mbed-randlib + INTERFACE + include + include/mbed-client-randlib + include/mbed-client-randlib/platform +) + +target_sources(mbed-randlib + INTERFACE + source/randLIB.c +) + +target_link_libraries(mbed-randlib + INTERFACE + mbed-nanostack +) diff --git a/platform/source/CMakeLists.txt b/platform/source/CMakeLists.txt new file mode 100644 index 00000000000..90054d4cd4f --- /dev/null +++ b/platform/source/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("CORTEX_A" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_A) +elseif("CORTEX_M" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_CORTEX_M) +endif() + +add_subdirectory(minimal-printf) + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + ATCmdParser.cpp + CThunkBase.cpp + CriticalSectionLock.cpp + DeepSleepLock.cpp + FileBase.cpp + FileHandle.cpp + FilePath.cpp + FileSystemHandle.cpp + LocalFileSystem.cpp + Stream.cpp + SysTimer.cpp + mbed_alloc_wrappers.cpp + mbed_application.c + mbed_assert.c + mbed_atomic_impl.c + mbed_board.c + mbed_critical.c + mbed_error.c + mbed_error_hist.c + mbed_interface.c + mbed_mem_trace.cpp + mbed_mktime.c + mbed_mpu_mgmt.c + mbed_os_timer.cpp + mbed_poll.cpp + mbed_power_mgmt.c + mbed_retarget.cpp + mbed_rtc_time.cpp + mbed_sdk_boot.c + mbed_semihost_api.c + mbed_stats.c + mbed_thread.cpp + mbed_wait_api_no_rtos.c +) diff --git a/platform/source/TARGET_CORTEX_A/CMakeLists.txt b/platform/source/TARGET_CORTEX_A/CMakeLists.txt new file mode 100644 index 00000000000..07183f4ab78 --- /dev/null +++ b/platform/source/TARGET_CORTEX_A/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_system_init) + if(${MBED_TOOLCHAIN} STREQUAL "IAR") + target_sources(mbed-core PRIVATE TOOLCHAIN_IAR/cmain.S) + endif() +endfunction() + +_mbed_get_system_init() diff --git a/platform/source/TARGET_CORTEX_M/CMakeLists.txt b/platform/source/TARGET_CORTEX_M/CMakeLists.txt new file mode 100644 index 00000000000..3ae9a0b4e05 --- /dev/null +++ b/platform/source/TARGET_CORTEX_M/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +function(_mbed_set_assembly_source) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + target_sources(mbed-core INTERFACE TOOLCHAIN_ARM/except.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + target_sources(mbed-core + INTERFACE + TOOLCHAIN_IAR/except.S + TOOLCHAIN_IAR/cmain.S + ) + endif() +endfunction() + +_mbed_set_assembly_source() + +target_sources(mbed-core + INTERFACE + mbed_fault_handler.c +) diff --git a/platform/source/minimal-printf/CMakeLists.txt b/platform/source/minimal-printf/CMakeLists.txt new file mode 100644 index 00000000000..53deebac7d7 --- /dev/null +++ b/platform/source/minimal-printf/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + mbed_printf_armlink_overrides.c + mbed_printf_implementation.c + mbed_printf_wrapper.c +) diff --git a/rtos/CMakeLists.txt b/rtos/CMakeLists.txt new file mode 100644 index 00000000000..dbde39ce4a6 --- /dev/null +++ b/rtos/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/rtos + ${CMAKE_CURRENT_SOURCE_DIR}/include/rtos/internal + ${CMAKE_CURRENT_SOURCE_DIR}/source +) + +target_sources(mbed-core + INTERFACE + source/EventFlags.cpp + source/Kernel.cpp + source/Mutex.cpp + source/Semaphore.cpp + source/ThisThread.cpp + source/ConditionVariable.cpp + source/Thread.cpp +) + + +target_compile_definitions(mbed-core + INTERFACE + MBED_CONF_RTOS_API_PRESENT=1 +) diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt new file mode 100644 index 00000000000..77182d9c249 --- /dev/null +++ b/storage/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# List of all storage libraries available. +add_library(mbed-storage INTERFACE) + +add_library(mbed-storage-blockdevice INTERFACE) +add_library(mbed-storage-dataflash INTERFACE) +add_library(mbed-storage-flashiap INTERFACE) +add_library(mbed-storage-i2cee INTERFACE) +add_library(mbed-storage-qspif INTERFACE) +add_library(mbed-storage-sd INTERFACE) +add_library(mbed-storage-spif INTERFACE) + +add_library(mbed-storage-filesystem INTERFACE) +add_library(mbed-storage-littlefs-v2 INTERFACE) +add_library(mbed-storage-littlefs INTERFACE) +add_library(mbed-storage-fat INTERFACE) + +add_library(mbed-storage-kvstore INTERFACE) + + +add_subdirectory(blockdevice) +add_subdirectory(filesystem) +add_subdirectory(kvstore) +add_subdirectory(platform) + +target_include_directories(mbed-storage + INTERFACE + . +) + +target_compile_definitions(mbed-storage + INTERFACE + MBED_CONF_FILESYSTEM_PRESENT=1 +) diff --git a/storage/blockdevice/CMakeLists.txt b/storage/blockdevice/CMakeLists.txt new file mode 100644 index 00000000000..5e787507733 --- /dev/null +++ b/storage/blockdevice/CMakeLists.txt @@ -0,0 +1,48 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_DATAFLASH) +endif() + +if("FLASHIAP" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_FLASHIAP) +endif() + +if("I2CEE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_I2CEE) +endif() + +if("QSPIF" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_QSPIF) +endif() + +if("SD" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SD) +endif() + +if("SPIF" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(COMPONENT_SPIF) +endif() + + +target_include_directories(mbed-storage-blockdevice + INTERFACE + . + ./include + ./include/blockdevice +) + +target_sources(mbed-storage-blockdevice + INTERFACE + source/BufferedBlockDevice.cpp + source/ChainingBlockDevice.cpp + source/ExhaustibleBlockDevice.cpp + source/FlashSimBlockDevice.cpp + source/HeapBlockDevice.cpp + source/MBRBlockDevice.cpp + source/ObservingBlockDevice.cpp + source/ProfilingBlockDevice.cpp + source/ReadOnlyBlockDevice.cpp + source/SlicingBlockDevice.cpp +) diff --git a/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt b/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt new file mode 100644 index 00000000000..fb0eb3e43a0 --- /dev/null +++ b/storage/blockdevice/COMPONENT_DATAFLASH/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-storage-dataflash + INTERFACE + source/DataFlashBlockDevice.cpp +) + +target_include_directories(mbed-storage-dataflash + INTERFACE + include + include/DataFlash +) diff --git a/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt b/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt new file mode 100644 index 00000000000..c69d226e746 --- /dev/null +++ b/storage/blockdevice/COMPONENT_FLASHIAP/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-flashiap + INTERFACE + include + include/FlashIAP +) + +target_sources(mbed-storage-flashiap + INTERFACE + source/FlashIAPBlockDevice.cpp +) diff --git a/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt b/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt new file mode 100644 index 00000000000..27a67b534ce --- /dev/null +++ b/storage/blockdevice/COMPONENT_I2CEE/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-storage-i2cee + INTERFACE + source/I2CEEBlockDevice.cpp +) + +target_include_directories(mbed-storage-i2cee + INTERFACE + include + include/I2CEE +) diff --git a/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt b/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt new file mode 100644 index 00000000000..17ee0e28c75 --- /dev/null +++ b/storage/blockdevice/COMPONENT_QSPIF/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-qspif + INTERFACE + include + include/QSPIF +) + +target_sources(mbed-storage-qspif + INTERFACE + source/QSPIFBlockDevice.cpp +) diff --git a/storage/blockdevice/COMPONENT_SD/CMakeLists.txt b/storage/blockdevice/COMPONENT_SD/CMakeLists.txt new file mode 100644 index 00000000000..19f4986ffb5 --- /dev/null +++ b/storage/blockdevice/COMPONENT_SD/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-storage-sd + INTERFACE + source/SDBlockDevice.cpp +) + +target_include_directories(mbed-storage-sd + INTERFACE + include + include/SD +) diff --git a/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt b/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt new file mode 100644 index 00000000000..4623ce8cccf --- /dev/null +++ b/storage/blockdevice/COMPONENT_SPIF/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-storage-spif + INTERFACE + source/SPIFBlockDevice.cpp +) + +target_include_directories(mbed-storage-spif + INTERFACE + include + include/SPIF +) diff --git a/storage/filesystem/CMakeLists.txt b/storage/filesystem/CMakeLists.txt new file mode 100644 index 00000000000..da22133b2cc --- /dev/null +++ b/storage/filesystem/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(fat) +add_subdirectory(littlefs) +add_subdirectory(littlefsv2) + +target_include_directories(mbed-storage-filesystem + INTERFACE + . + ./include + ./include/filesystem +) + +target_sources(mbed-storage-filesystem + INTERFACE + source/Dir.cpp + source/File.cpp + source/FileSystem.cpp +) diff --git a/storage/filesystem/fat/CMakeLists.txt b/storage/filesystem/fat/CMakeLists.txt new file mode 100644 index 00000000000..c7d6cc169f7 --- /dev/null +++ b/storage/filesystem/fat/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-fat + INTERFACE + . + ./include + ./include/fat + ./ChaN +) + +target_sources(mbed-storage-fat + INTERFACE + source/FATFileSystem.cpp + + ChaN/ff.cpp + ChaN/ffunicode.cpp +) diff --git a/storage/filesystem/littlefs/CMakeLists.txt b/storage/filesystem/littlefs/CMakeLists.txt new file mode 100644 index 00000000000..fde273d39a7 --- /dev/null +++ b/storage/filesystem/littlefs/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-littlefs + INTERFACE + . + ./include + ./include/littlefs + ./littlefs +) + +target_sources(mbed-storage-littlefs + INTERFACE + source/LittleFileSystem.cpp + + littlefs/lfs.c + littlefs/lfs_util.c +) + +target_link_libraries(mbed-storage-littlefs + INTERFACE + mbed-storage-blockdevice + mbed-storage-filesystem +) diff --git a/storage/filesystem/littlefsv2/CMakeLists.txt b/storage/filesystem/littlefsv2/CMakeLists.txt new file mode 100644 index 00000000000..812c0056280 --- /dev/null +++ b/storage/filesystem/littlefsv2/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-littlefs-v2 + INTERFACE + . + ./include + ./include/littlefsv2 + ./littlefs +) + +target_sources(mbed-storage-littlefs-v2 + INTERFACE + source/LittleFileSystem2.cpp + + littlefs/lfs2.c + littlefs/lfs2_util.c +) + +target_link_libraries(mbed-storage-littlefs-v2 + INTERFACE + mbed-storage-blockdevice + mbed-storage-filesystem +) diff --git a/storage/kvstore/CMakeLists.txt b/storage/kvstore/CMakeLists.txt new file mode 100644 index 00000000000..ec4a58e4194 --- /dev/null +++ b/storage/kvstore/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(direct_access_devicekey) +add_subdirectory(kv_config) +add_subdirectory(securestore) + +target_include_directories(mbed-storage-kvstore + INTERFACE + . + ./include + ./include/kvstore +) + +target_sources(mbed-storage-kvstore + INTERFACE + source/FileSystemStore.cpp + source/KVMap.cpp + source/TDBStore.cpp + source/kvstore_global_api.cpp +) + +target_link_libraries(mbed-storage-kvstore + INTERFACE + mbed-device_key + mbed-storage-blockdevice + mbed-storage-filesystem + mbed-storage-fat + mbed-storage-littlefs + mbed-storage-flashiap + mbed-storage-sd +) diff --git a/storage/kvstore/direct_access_devicekey/CMakeLists.txt b/storage/kvstore/direct_access_devicekey/CMakeLists.txt new file mode 100644 index 00000000000..5f28f1e475a --- /dev/null +++ b/storage/kvstore/direct_access_devicekey/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-kvstore + INTERFACE + . + ./include + ./include/direct_access_devicekey +) + +target_sources(mbed-storage-kvstore + INTERFACE + source/DirectAccessDevicekey.cpp +) diff --git a/storage/kvstore/kv_config/CMakeLists.txt b/storage/kvstore/kv_config/CMakeLists.txt new file mode 100644 index 00000000000..0cb061f16c2 --- /dev/null +++ b/storage/kvstore/kv_config/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-kvstore + INTERFACE + . + ./include + ./include/kv_config +) + +target_sources(mbed-storage-kvstore + INTERFACE + source/kv_config.cpp +) diff --git a/storage/kvstore/securestore/CMakeLists.txt b/storage/kvstore/securestore/CMakeLists.txt new file mode 100644 index 00000000000..2e33c509c3a --- /dev/null +++ b/storage/kvstore/securestore/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-storage-kvstore + INTERFACE + . + ./include + ./include/securestore +) + +target_sources(mbed-storage-kvstore + INTERFACE + source/SecureStore.cpp +) diff --git a/storage/platform/CMakeLists.txt b/storage/platform/CMakeLists.txt new file mode 100644 index 00000000000..dbae27817db --- /dev/null +++ b/storage/platform/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-storage + INTERFACE + source/PlatformStorage.cpp +) + +list(APPEND mbed-storage-libs + mbed-storage-blockdevice + mbed-storage-filesystem + mbed-storage-fat + mbed-storage-littlefs +) + +if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-storage-libs mbed-storage-dataflash) +endif() + +if("FLASHIAP" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-storage-libs mbed-storage-flashiap) +endif() + +if("QSPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-storage-libs mbed-storage-qspif) +endif() + +if("SD" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-storage-libs mbed-storage-sd) +endif() + +if("SPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed-storage-libs mbed-storage-spif) +endif() + +target_link_libraries(mbed-storage + INTERFACE + ${mbed-storage-libs} +) diff --git a/targets/CMakeLists.txt b/targets/CMakeLists.txt new file mode 100644 index 00000000000..50fc59926ba --- /dev/null +++ b/targets/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("Freescale" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_Freescale) +elseif("NORDIC" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NORDIC) +elseif("STM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM) +endif() diff --git a/targets/TARGET_Freescale/CMakeLists.txt b/targets/TARGET_Freescale/CMakeLists.txt new file mode 100644 index 00000000000..b964dd0a007 --- /dev/null +++ b/targets/TARGET_Freescale/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MCUXpresso_MCUS" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCUXpresso_MCUS) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + USBPhy_Kinetis.cpp +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/CMakeLists.txt new file mode 100644 index 00000000000..03bd8fb97da --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("K66F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_K66F) +elseif("MCU_K64F" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_K64F) +endif() + +target_sources(mbed-core + INTERFACE + fsl_common.c + + api/analogin_api.c + api/analogout_api.c + api/dma_api.c + api/flash_api.c + api/gpio_api.c + api/gpio_irq_api.c + api/i2c_api.c + api/lp_ticker.c + api/pinmap.c + api/port_api.c + api/qspi_api.c + api/rtc_api.c + api/sleep.c +) + +target_include_directories(mbed-core + INTERFACE + api +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/CMakeLists.txt new file mode 100644 index 00000000000..1f8c973ff0e --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/CMakeLists.txt @@ -0,0 +1,67 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("FRDM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_FRDM) +endif() + +add_subdirectory(device) + +target_include_directories(mbed-core + INTERFACE + . + drivers +) + +target_sources(mbed-core + INTERFACE + pwmout_api.c + serial_api.c + spi_api.c + trng_api.c + us_ticker.c + + drivers/fsl_adc16.c + drivers/fsl_clock.c + drivers/fsl_cmp.c + drivers/fsl_cmt.c + drivers/fsl_crc.c + drivers/fsl_dac.c + drivers/fsl_dmamux.c + drivers/fsl_dspi.c + drivers/fsl_dspi_edma.c + drivers/fsl_edma.c + drivers/fsl_enet.c + drivers/fsl_ewm.c + drivers/fsl_flash.c + drivers/fsl_flexbus.c + drivers/fsl_flexcan.c + drivers/fsl_ftm.c + drivers/fsl_gpio.c + drivers/fsl_i2c.c + drivers/fsl_i2c_edma.c + drivers/fsl_llwu.c + drivers/fsl_lmem_cache.c + drivers/fsl_lptmr.c + drivers/fsl_lpuart.c + drivers/fsl_lpuart_edma.c + drivers/fsl_pdb.c + drivers/fsl_pit.c + drivers/fsl_pmc.c + drivers/fsl_rcm.c + drivers/fsl_rnga.c + drivers/fsl_rtc.c + drivers/fsl_sai.c + drivers/fsl_sai_edma.c + drivers/fsl_sdhc.c + drivers/fsl_sdramc.c + drivers/fsl_sim.c + drivers/fsl_smc.c + drivers/fsl_sysmpu.c + drivers/fsl_tpm.c + drivers/fsl_tsi_v4.c + drivers/fsl_uart.c + drivers/fsl_uart_edma.c + drivers/fsl_vref.c + drivers/fsl_wdog.c +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/CMakeLists.txt new file mode 100644 index 00000000000..8e0df173d1e --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/TARGET_FRDM/CMakeLists.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + crc.c + fsl_clock_config.c + fsl_phy.c + mbed_overrides.c +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/CMakeLists.txt new file mode 100644 index 00000000000..e457ca52aee --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_assembly_mk66f18) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_MK66F18.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM_STD/startup_MK66F18.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_MK66F18.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_mk66f18_linker_file) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/MK66FN2M0xxx18.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/MK66FN2M0xxx18.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_mk66f18() +_mbed_set_mk66f18_linker_file() + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + system_MK66F18.c +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct index 3ec5cd8f3a6..0c53d3426aa 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/device/TOOLCHAIN_ARM_STD/MK66FN2M0xxx18.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 /* ** ################################################################### ** Processors: MK66FN2M0VLQ18 diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/CMakeLists.txt new file mode 100644 index 00000000000..831a12beb78 --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/CMakeLists.txt @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(device) + +if("FRDM" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_FRDM) +elseif("HEXIWEAR" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_HEXIWEAR) +elseif("SDT64B" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SDT64B) +endif() + +target_sources(mbed-core + INTERFACE + mbed_crc_api.c + pwmout_api.c + reset_reason.c + serial_api.c + spi_api.c + trng_api.c + us_ticker.c + watchdog_api.c + + drivers/fsl_adc16.c + drivers/fsl_clock.c + drivers/fsl_cmp.c + drivers/fsl_cmt.c + drivers/fsl_crc.c + drivers/fsl_dac.c + drivers/fsl_dmamux.c + drivers/fsl_dspi.c + drivers/fsl_dspi_edma.c + drivers/fsl_edma.c + drivers/fsl_enet.c + drivers/fsl_ewm.c + drivers/fsl_flash.c + drivers/fsl_flexbus.c + drivers/fsl_flexcan.c + drivers/fsl_ftm.c + drivers/fsl_gpio.c + drivers/fsl_i2c.c + drivers/fsl_i2c_edma.c + drivers/fsl_llwu.c + drivers/fsl_lptmr.c + drivers/fsl_pdb.c + drivers/fsl_pit.c + drivers/fsl_pmc.c + drivers/fsl_rcm.c + drivers/fsl_rnga.c + drivers/fsl_rtc.c + drivers/fsl_sai.c + drivers/fsl_sai_edma.c + drivers/fsl_sdhc.c + drivers/fsl_sim.c + drivers/fsl_smc.c + drivers/fsl_sysmpu.c + drivers/fsl_uart.c + drivers/fsl_uart_edma.c + drivers/fsl_vref.c + drivers/fsl_wdog.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + drivers +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/CMakeLists.txt new file mode 100644 index 00000000000..f4b979eb9d5 --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/CMakeLists.txt @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-core + INTERFACE + crc.c + fsl_clock_config.c + fsl_phy.c + mbed_overrides.c + PeripheralPins.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/CMakeLists.txt b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/CMakeLists.txt new file mode 100644 index 00000000000..5ba2b77a85c --- /dev/null +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/CMakeLists.txt @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_assembly_k64f) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_MK64F12.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM_STD/startup_MK64F12.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_MK64F12.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_linker_file) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/MK64FN1M0xxx12.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/MK64FN1M0xxx12.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_k64f() +_mbed_set_linker_file() + +target_sources(mbed-core + INTERFACE + system_MK64F12.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct index e790bbcfe29..c81a7300320 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/device/TOOLCHAIN_ARM_STD/MK64FN1M0xxx12.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 /* ** ################################################################### ** Processors: MK64FN1M0CAJ12 diff --git a/targets/TARGET_NORDIC/CMakeLists.txt b/targets/TARGET_NORDIC/CMakeLists.txt new file mode 100644 index 00000000000..06f7190e68c --- /dev/null +++ b/targets/TARGET_NORDIC/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NRF5x" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NRF5x) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt new file mode 100644 index 00000000000..fd92ae6d1c2 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NRF52" IN_LIST MBED_TARGET_LABELS) + 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) + add_subdirectory(TARGET_SDK_15_0) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + lp_ticker.c + pinmap.c + port_api.c + qspi_api.c + rtc_api.c +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt new file mode 100644 index 00000000000..374cdaecb7a --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("MCU_NRF52840" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MCU_NRF52840) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + PeripheralPinsDefault.c + analogin_api.c + common_rtc.c + critical_section_api.c + flash_api.c + gpio_api.c + i2c_api.c + itm_api.c + object_owners.c + pinmap_ex.c + pwmout_api.c + reloc_vector_table.c + serial_api.c + sleep.c + spi_api.c + trng_api.c + us_ticker.c + watchdog_api.c +) 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 new file mode 100644 index 00000000000..6644d95a922 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt @@ -0,0 +1,20 @@ +# 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) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/config +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + USBPhy_Nordic.cpp +) + +add_subdirectory(device) 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 new file mode 100644 index 00000000000..cf038d61fd9 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_NRF52840_DK/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) 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 new file mode 100644 index 00000000000..e81255dea29 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/CMakeLists.txt @@ -0,0 +1,27 @@ +# 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_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct index 95080b7f7f5..0d7920daa3c 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.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) @@ -50,8 +50,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { .ANY (+RW +ZI) } - ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE + MBED_RAM_START - AlignExpr(ImageLimit(RW_IRAM1), 16)) { } - ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE EMPTY -Stack_Size { ; Stack region growing down + ARM_LIB_STACK MBED_RAM1_START + MBED_RAM1_SIZE EMPTY - Stack_Size { ; Stack region growing down } } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/CMakeLists.txt new file mode 100644 index 00000000000..424bc79ef0f --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("SOFTDEVICE_NONE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_SOFTDEVICE_NONE) +endif() + +add_subdirectory(components) +add_subdirectory(integration) +add_subdirectory(modules) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_COMMON/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_COMMON/CMakeLists.txt new file mode 100644 index 00000000000..0e238c77b88 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_COMMON/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/ble + ${CMAKE_CURRENT_SOURCE_DIR}/ble/ble_radio_notification + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/bootloader + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/bootloader/dfu + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage +) + +target_sources(mbed-core + INTERFACE + ble/ble_radio_notification/ble_radio_notification.c + + libraries/bootloader/dfu/nrf_dfu_mbr.c + + libraries/fstorage/nrf_fstorage_sd.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 new file mode 100644 index 00000000000..91e29e4d5d3 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_NONE/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/libraries + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage + ${CMAKE_CURRENT_SOURCE_DIR}/nrf_soc_nosd/ +) + +target_sources(mbed-core + INTERFACE + libraries/fstorage/nrf_fstorage_nvmc.c + + nrf_soc_nosd/nrf_nvic.c + nrf_soc_nosd/nrf_soc.c +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S112/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S112/CMakeLists.txt new file mode 100644 index 00000000000..920e2fdbe39 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S112/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/headers/nrf52 +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_FULL/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_FULL/CMakeLists.txt new file mode 100644 index 00000000000..920e2fdbe39 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_FULL/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/headers/nrf52 +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_MBR/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_MBR/CMakeLists.txt new file mode 100644 index 00000000000..a77ad76ed54 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_MBR/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/libraries + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage + ${CMAKE_CURRENT_SOURCE_DIR}/nrf_soc_nosd +) + +target_sources(mbed-core + INTERFACE + libraries/fstorage/nrf_fstorage_nvmc.c + nrf_soc_nosd/nrf_nvic.c + nrf_soc_nosd/nrf_soc.c +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_OTA/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_OTA/CMakeLists.txt new file mode 100644 index 00000000000..a77ad76ed54 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S132_OTA/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/libraries + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage + ${CMAKE_CURRENT_SOURCE_DIR}/nrf_soc_nosd +) + +target_sources(mbed-core + INTERFACE + libraries/fstorage/nrf_fstorage_nvmc.c + nrf_soc_nosd/nrf_nvic.c + nrf_soc_nosd/nrf_soc.c +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_FULL/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_FULL/CMakeLists.txt new file mode 100644 index 00000000000..920e2fdbe39 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_FULL/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/headers/nrf52 +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_MBR/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_MBR/CMakeLists.txt new file mode 100644 index 00000000000..a77ad76ed54 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_MBR/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/libraries + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage + ${CMAKE_CURRENT_SOURCE_DIR}/nrf_soc_nosd +) + +target_sources(mbed-core + INTERFACE + libraries/fstorage/nrf_fstorage_nvmc.c + nrf_soc_nosd/nrf_nvic.c + nrf_soc_nosd/nrf_soc.c +) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_OTA/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_OTA/CMakeLists.txt new file mode 100644 index 00000000000..920e2fdbe39 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/TARGET_SOFTDEVICE_S140_OTA/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/headers + ${CMAKE_CURRENT_SOURCE_DIR}/headers/nrf52 +) 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 new file mode 100644 index 00000000000..16c54d8b6ab --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/components/CMakeLists.txt @@ -0,0 +1,65 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/libraries + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/atomic + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/atomic_fifo + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/balloc + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/delay + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/experimental_log + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/experimental_log/src + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/experimental_memobj + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/experimental_section_vars + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fds + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/fstorage + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/queue + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/spi_mngr + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/strerror + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/twi_mngr + ${CMAKE_CURRENT_SOURCE_DIR}/libraries/util +) + +target_sources(mbed-core + INTERFACE + libraries/atomic/nrf_atomic.c + + libraries/atomic_fifo/nrf_atfifo.c + + libraries/balloc/nrf_balloc.c + + libraries/experimental_log/src/nrf_log_backend_flash.c + libraries/experimental_log/src/nrf_log_backend_rtt.c + libraries/experimental_log/src/nrf_log_backend_serial.c + libraries/experimental_log/src/nrf_log_backend_uart.c + libraries/experimental_log/src/nrf_log_default_backends.c + libraries/experimental_log/src/nrf_log_frontend.c + libraries/experimental_log/src/nrf_log_str_formatter.c + + libraries/experimental_memobj/nrf_memobj.c + + libraries/experimental_section_vars/nrf_section_iter.c + + libraries/fds/fds.c + + libraries/fstorage/nrf_fstorage.c + + libraries/queue/nrf_queue.c + + libraries/spi_mngr/nrf_spi_mngr.c + + libraries/strerror/nrf_strerror.c + + libraries/twi_mngr/nrf_twi_mngr.c + + libraries/util/app_error.c + libraries/util/app_error_handler_gcc.c + libraries/util/app_error_handler_iar.c + libraries/util/app_error_handler_keil.c + libraries/util/app_error_weak.c + libraries/util/app_util_platform.c + libraries/util/nrf_assert.c + libraries/util/sdk_mapped_flags.c +) 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 new file mode 100644 index 00000000000..1eb92b14469 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/integration/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/legacy + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/legacy/ble_flash +) + +target_sources(mbed-core + INTERFACE + nrfx/legacy/nrf_drv_rng.c + nrfx/legacy/nrf_drv_usbd.c + + nrfx/legacy/ble_flash/ble_flash.c +) 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 new file mode 100644 index 00000000000..47e29eff90a --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_15_0/modules/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/drivers + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/drivers/include + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/drivers/src + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/drivers/src/prs + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/hal + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/mdk + ${CMAKE_CURRENT_SOURCE_DIR}/nrfx/soc + ${CMAKE_CURRENT_SOURCE_DIR}/softdevice + ${CMAKE_CURRENT_SOURCE_DIR}/softdevice/common +) + +target_sources(mbed-core + INTERFACE + nrfx/drivers/src/nrfx_adc.c + nrfx/drivers/src/nrfx_clock.c + nrfx/drivers/src/nrfx_comp.c + nrfx/drivers/src/nrfx_gpiote.c + nrfx/drivers/src/nrfx_i2s.c + nrfx/drivers/src/nrfx_lpcomp.c + nrfx/drivers/src/nrfx_pdm.c + nrfx/drivers/src/nrfx_power.c + nrfx/drivers/src/nrfx_power_clock.c + nrfx/drivers/src/nrfx_ppi.c + nrfx/drivers/src/nrfx_pwm.c + nrfx/drivers/src/nrfx_qdec.c + nrfx/drivers/src/nrfx_qspi.c + nrfx/drivers/src/nrfx_rng.c + nrfx/drivers/src/nrfx_rtc.c + nrfx/drivers/src/nrfx_saadc.c + nrfx/drivers/src/nrfx_spi.c + nrfx/drivers/src/nrfx_spim.c + nrfx/drivers/src/nrfx_spis.c + nrfx/drivers/src/nrfx_swi.c + nrfx/drivers/src/nrfx_systick.c + nrfx/drivers/src/nrfx_timer.c + nrfx/drivers/src/nrfx_twi.c + nrfx/drivers/src/nrfx_twim.c + nrfx/drivers/src/nrfx_twis.c + nrfx/drivers/src/nrfx_uart.c + nrfx/drivers/src/nrfx_uarte.c + nrfx/drivers/src/nrfx_wdt.c + + nrfx/drivers/src/prs/nrfx_prs.c + + nrfx/hal/nrf_ecb.c + nrfx/hal/nrf_nvmc.c + + softdevice/common/nrf_sdh.c + softdevice/common/nrf_sdh_ant.c + softdevice/common/nrf_sdh_ble.c + softdevice/common/nrf_sdh_soc.c +) diff --git a/targets/TARGET_STM/CMakeLists.txt b/targets/TARGET_STM/CMakeLists.txt new file mode 100644 index 00000000000..24b67046d4a --- /dev/null +++ b/targets/TARGET_STM/CMakeLists.txt @@ -0,0 +1,42 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STM32F3" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F3) +elseif("STM32F4" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F4) +elseif("STM32L4" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L4) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_sources(mbed-core + INTERFACE + USBPhy_STM32.cpp + analogin_api.c + analogout_api.c + can_api.c + gpio_api.c + gpio_irq_api.c + hal_tick_overrides.c + i2c_api.c + lp_ticker.c + mbed_crc_api.c + mbed_overrides.c + pinmap.c + port_api.c + pwmout_api.c + qspi_api.c + reset_reason.c + rtc_api.c + serial_api.c + sleep.c + stm_spi_api.c + trng_api.c + us_ticker.c + watchdog_api.c +) diff --git a/targets/TARGET_STM/TARGET_STM32F3/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F3/CMakeLists.txt new file mode 100644 index 00000000000..0b9545d4f53 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STM32F303x8" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F303x8) +endif() + +add_subdirectory(device) + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + analogin_device.c + analogout_device.c + flash_api.c + gpio_irq_device.c + pwmout_device.c + serial_device.c + spi_api.c +) diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/CMakeLists.txt new file mode 100644 index 00000000000..0cdeb5f0e32 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("NUCLEO_F303K8" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F303K8) +endif() + +add_subdirectory(device) + +target_include_directories(mbed-core + INTERFACE + . +) diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/TARGET_NUCLEO_F303K8/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/TARGET_NUCLEO_F303K8/CMakeLists.txt new file mode 100644 index 00000000000..c4d3e2a096c --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/TARGET_NUCLEO_F303K8/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + system_clock.c +) diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/CMakeLists.txt new file mode 100644 index 00000000000..0a9ae7546df --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_assembly_stm32f303x8) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f303x8.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f303x8.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f303x8.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_linker_file) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F303X8.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f303x8.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f303x8.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_stm32f303x8() +_mbed_set_linker_file() + +target_include_directories(mbed-core + INTERFACE + . +) diff --git a/targets/TARGET_STM/TARGET_STM32F3/device/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F3/device/CMakeLists.txt new file mode 100644 index 00000000000..1e2dc34e8cc --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/device/CMakeLists.txt @@ -0,0 +1,78 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + stm32f3xx_hal.c + stm32f3xx_hal_adc.c + stm32f3xx_hal_adc_ex.c + stm32f3xx_hal_can.c + stm32f3xx_hal_cec.c + stm32f3xx_hal_comp.c + stm32f3xx_hal_cortex.c + stm32f3xx_hal_crc.c + stm32f3xx_hal_crc_ex.c + stm32f3xx_hal_dac.c + stm32f3xx_hal_dac_ex.c + stm32f3xx_hal_dma.c + stm32f3xx_hal_flash.c + stm32f3xx_hal_flash_ex.c + stm32f3xx_hal_gpio.c + stm32f3xx_hal_hrtim.c + stm32f3xx_hal_i2c.c + stm32f3xx_hal_i2c_ex.c + stm32f3xx_hal_i2s_ex.c + stm32f3xx_hal_irda.c + stm32f3xx_hal_iwdg.c + stm32f3xx_hal_nand.c + stm32f3xx_hal_nor.c + stm32f3xx_hal_opamp.c + stm32f3xx_hal_opamp_ex.c + stm32f3xx_hal_pccard.c + stm32f3xx_hal_pcd.c + stm32f3xx_hal_pcd_ex.c + stm32f3xx_hal_pwr.c + stm32f3xx_hal_pwr_ex.c + stm32f3xx_hal_rcc.c + stm32f3xx_hal_rcc_ex.c + stm32f3xx_hal_rtc.c + stm32f3xx_hal_rtc_ex.c + stm32f3xx_hal_sdadc.c + stm32f3xx_hal_smartcard.c + stm32f3xx_hal_smartcard_ex.c + stm32f3xx_hal_smbus.c + stm32f3xx_hal_spi.c + stm32f3xx_hal_spi_ex.c + stm32f3xx_hal_sram.c + stm32f3xx_hal_tim.c + stm32f3xx_hal_tim_ex.c + stm32f3xx_hal_tsc.c + stm32f3xx_hal_uart.c + stm32f3xx_hal_uart_ex.c + stm32f3xx_hal_usart.c + stm32f3xx_hal_wwdg.c + stm32f3xx_ll_adc.c + stm32f3xx_ll_comp.c + stm32f3xx_ll_crc.c + stm32f3xx_ll_dac.c + stm32f3xx_ll_dma.c + stm32f3xx_ll_exti.c + stm32f3xx_ll_fmc.c + stm32f3xx_ll_gpio.c + stm32f3xx_ll_hrtim.c + stm32f3xx_ll_i2c.c + stm32f3xx_ll_opamp.c + stm32f3xx_ll_pwr.c + stm32f3xx_ll_rcc.c + stm32f3xx_ll_rtc.c + stm32f3xx_ll_spi.c + stm32f3xx_ll_tim.c + stm32f3xx_ll_usart.c + stm32f3xx_ll_utils.c + system_stm32f3xx.c +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/CMakeLists.txt new file mode 100644 index 00000000000..25f7b886f74 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STM32F401xE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F401xE) +elseif("STM32F439xI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32F439xI) +endif() + +target_sources(mbed-core + INTERFACE + analogin_device.c + analogout_device.c + flash_api.c + gpio_irq_device.c + pwmout_device.c + serial_device.c + spi_api.c +) + +add_subdirectory(STM32Cube_FW) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/STM32Cube_FW + ${CMAKE_CURRENT_SOURCE_DIR}/STM32Cube_FW/CMSIS + ${CMAKE_CURRENT_SOURCE_DIR}/STM32Cube_FW/STM32F4xx_HAL_Driver + ${CMAKE_CURRENT_SOURCE_DIR}/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMSIS/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMSIS/CMakeLists.txt new file mode 100644 index 00000000000..cf038d61fd9 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMSIS/CMakeLists.txt @@ -0,0 +1,7 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMakeLists.txt new file mode 100644 index 00000000000..06dd99516ee --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(STM32F4xx_HAL_Driver) + +target_sources(mbed-core + INTERFACE + system_stm32f4xx.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/CMSIS +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/CMakeLists.txt new file mode 100644 index 00000000000..b6d5ceb99ed --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/CMakeLists.txt @@ -0,0 +1,102 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(Legacy) + +target_sources(mbed-core + INTERFACE + stm32f4xx_hal.c + stm32f4xx_hal_adc.c + stm32f4xx_hal_adc_ex.c + stm32f4xx_hal_can.c + stm32f4xx_hal_cec.c + stm32f4xx_hal_cortex.c + stm32f4xx_hal_crc.c + stm32f4xx_hal_cryp.c + stm32f4xx_hal_cryp_ex.c + stm32f4xx_hal_dac.c + stm32f4xx_hal_dac_ex.c + stm32f4xx_hal_dcmi.c + stm32f4xx_hal_dcmi_ex.c + stm32f4xx_hal_dfsdm.c + stm32f4xx_hal_dma.c + stm32f4xx_hal_dma2d.c + stm32f4xx_hal_dma_ex.c + stm32f4xx_hal_dsi.c + stm32f4xx_hal_eth.c + stm32f4xx_hal_exti.c + stm32f4xx_hal_flash.c + stm32f4xx_hal_flash_ex.c + stm32f4xx_hal_flash_ramfunc.c + stm32f4xx_hal_fmpi2c.c + stm32f4xx_hal_fmpi2c_ex.c + stm32f4xx_hal_fmpsmbus.c + stm32f4xx_hal_gpio.c + stm32f4xx_hal_hash.c + stm32f4xx_hal_hash_ex.c + stm32f4xx_hal_hcd.c + stm32f4xx_hal_i2c.c + stm32f4xx_hal_i2c_ex.c + stm32f4xx_hal_i2s.c + stm32f4xx_hal_i2s_ex.c + stm32f4xx_hal_irda.c + stm32f4xx_hal_iwdg.c + stm32f4xx_hal_lptim.c + stm32f4xx_hal_ltdc.c + stm32f4xx_hal_ltdc_ex.c + stm32f4xx_hal_mmc.c + stm32f4xx_hal_nand.c + stm32f4xx_hal_nor.c + stm32f4xx_hal_pccard.c + stm32f4xx_hal_pcd.c + stm32f4xx_hal_pcd_ex.c + stm32f4xx_hal_pwr.c + stm32f4xx_hal_pwr_ex.c + stm32f4xx_hal_qspi.c + stm32f4xx_hal_rcc.c + stm32f4xx_hal_rcc_ex.c + stm32f4xx_hal_rng.c + stm32f4xx_hal_rtc.c + stm32f4xx_hal_rtc_ex.c + stm32f4xx_hal_sai.c + stm32f4xx_hal_sai_ex.c + stm32f4xx_hal_sd.c + stm32f4xx_hal_sdram.c + stm32f4xx_hal_smartcard.c + stm32f4xx_hal_smbus.c + stm32f4xx_hal_spdifrx.c + stm32f4xx_hal_spi.c + stm32f4xx_hal_sram.c + stm32f4xx_hal_tim.c + stm32f4xx_hal_tim_ex.c + stm32f4xx_hal_uart.c + stm32f4xx_hal_usart.c + stm32f4xx_hal_wwdg.c + stm32f4xx_ll_adc.c + stm32f4xx_ll_crc.c + stm32f4xx_ll_dac.c + stm32f4xx_ll_dma.c + stm32f4xx_ll_dma2d.c + stm32f4xx_ll_exti.c + stm32f4xx_ll_fmc.c + stm32f4xx_ll_fmpi2c.c + stm32f4xx_ll_fsmc.c + stm32f4xx_ll_gpio.c + stm32f4xx_ll_i2c.c + stm32f4xx_ll_lptim.c + stm32f4xx_ll_pwr.c + stm32f4xx_ll_rcc.c + stm32f4xx_ll_rng.c + stm32f4xx_ll_rtc.c + stm32f4xx_ll_sdmmc.c + stm32f4xx_ll_spi.c + stm32f4xx_ll_tim.c + stm32f4xx_ll_usart.c + stm32f4xx_ll_usb.c + stm32f4xx_ll_utils.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy/CMakeLists.txt new file mode 100644 index 00000000000..4e360999e8c --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/STM32Cube_FW/STM32F4xx_HAL_Driver/Legacy/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-core + INTERFACE + stm32f4xx_hal_can_legacy.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/CMakeLists.txt new file mode 100644 index 00000000000..343048f39b3 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/CMakeLists.txt @@ -0,0 +1,36 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_assembly_stm32f401xe) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f401xe.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f401xe.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f401xe.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_linker_file) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F401XE.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f401xe.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f401xe.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_stm32f401xe() +_mbed_set_linker_file() + +if("NUCLEO_F401RE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F401RE) +endif() + +target_include_directories(mbed-core + INTERFACE + . +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/CMakeLists.txt new file mode 100644 index 00000000000..c4d3e2a096c --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + PeripheralPins.c + system_clock.c +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TOOLCHAIN_ARM/stm32f401xe.sct b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TOOLCHAIN_ARM/stm32f401xe.sct index 2768a6ee3ef..3a16f37bd49 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TOOLCHAIN_ARM/stm32f401xe.sct +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TOOLCHAIN_ARM/stm32f401xe.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ; Scatter-Loading Description File ; ; SPDX-License-Identifier: BSD-3-Clause diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/CMakeLists.txt new file mode 100644 index 00000000000..e0dfb9a3789 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +function(_mbed_get_assembly_stm32f439xi) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32f439xx.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32f439xx.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32f439xx.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_linker_file) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/STM32F439ZI.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32f439xx.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32f439xx_flash.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_stm32f439xi() +_mbed_set_linker_file() + +if("NUCLEO_F439ZI" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_NUCLEO_F439ZI) +elseif("WIO_3G" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_WIO_3G) +endif() + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt new file mode 100644 index 00000000000..af38c44777c --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-core + INTERFACE + ONBOARD_QUECTEL_UG96.cpp + PeripheralPins.c + PinNames.h + system_clock.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TOOLCHAIN_ARM/stm32f439xx.sct b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TOOLCHAIN_ARM/stm32f439xx.sct index 48d3f4613d6..61af5c9ea58 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TOOLCHAIN_ARM/stm32f439xx.sct +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TOOLCHAIN_ARM/stm32f439xx.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ; Scatter-Loading Description File ; ; SPDX-License-Identifier: BSD-3-Clause diff --git a/targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt new file mode 100644 index 00000000000..19e1b652216 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("STM32L475xG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_STM32L475xG) +endif() + +add_subdirectory(STM32Cube_FW) + +target_sources(mbed-core + INTERFACE + analogin_device.c + analogout_device.c + flash_api.c + gpio_irq_device.c + pwmout_device.c + serial_device.c + spi_api.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/CMakeLists.txt new file mode 100644 index 00000000000..0fa85c6d11c --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/CMakeLists.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(STM32L4xx_HAL_Driver) + +target_sources(mbed-core + INTERFACE + system_stm32l4xx.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} + CMSIS +) diff --git a/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/CMakeLists.txt new file mode 100644 index 00000000000..17999d4a977 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/CMakeLists.txt @@ -0,0 +1,116 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(Legacy) + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + stm32l4xx_hal_adc.c + stm32l4xx_hal_adc_ex.c + stm32l4xx_hal.c + stm32l4xx_hal_can.c + stm32l4xx_hal_comp.c + stm32l4xx_hal_cortex.c + stm32l4xx_hal_crc.c + stm32l4xx_hal_crc_ex.c + stm32l4xx_hal_cryp.c + stm32l4xx_hal_cryp_ex.c + stm32l4xx_hal_dac.c + stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dcmi.c + stm32l4xx_hal_dfsdm.c + stm32l4xx_hal_dfsdm_ex.c + stm32l4xx_hal_dma2d.c + stm32l4xx_hal_dma.c + stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dsi.c + stm32l4xx_hal_exti.c + stm32l4xx_hal_firewall.c + stm32l4xx_hal_flash.c + stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_gfxmmu.c + stm32l4xx_hal_gpio.c + stm32l4xx_hal_hash.c + stm32l4xx_hal_hash_ex.c + stm32l4xx_hal_hcd.c + stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_irda.c + stm32l4xx_hal_iwdg.c + stm32l4xx_hal_lcd.c + stm32l4xx_hal_lptim.c + stm32l4xx_hal_ltdc.c + stm32l4xx_hal_ltdc_ex.c + stm32l4xx_hal_mmc.c + stm32l4xx_hal_mmc_ex.c + stm32l4xx_hal_nand.c + stm32l4xx_hal_nor.c + stm32l4xx_hal_opamp.c + stm32l4xx_hal_opamp_ex.c + stm32l4xx_hal_ospi.c + stm32l4xx_hal_pcd.c + stm32l4xx_hal_pcd_ex.c + stm32l4xx_hal_pka.c + stm32l4xx_hal_pssi.c + stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_qspi.c + stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rng.c + stm32l4xx_hal_rng_ex.c + stm32l4xx_hal_rtc.c + stm32l4xx_hal_rtc_ex.c + stm32l4xx_hal_sai.c + stm32l4xx_hal_sai_ex.c + stm32l4xx_hal_sd.c + stm32l4xx_hal_sd_ex.c + stm32l4xx_hal_smartcard.c + stm32l4xx_hal_smartcard_ex.c + stm32l4xx_hal_smbus.c + stm32l4xx_hal_spi.c + stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_sram.c + stm32l4xx_hal_swpmi.c + stm32l4xx_hal_tim.c + stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tsc.c + stm32l4xx_hal_uart.c + stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_usart.c + stm32l4xx_hal_usart_ex.c + stm32l4xx_hal_wwdg.c + stm32l4xx_ll_adc.c + stm32l4xx_ll_comp.c + stm32l4xx_ll_crc.c + stm32l4xx_ll_crs.c + stm32l4xx_ll_dac.c + stm32l4xx_ll_dma2d.c + stm32l4xx_ll_dma.c + stm32l4xx_ll_exti.c + stm32l4xx_ll_fmc.c + stm32l4xx_ll_gpio.c + stm32l4xx_ll_i2c.c + stm32l4xx_ll_lptim.c + stm32l4xx_ll_lpuart.c + stm32l4xx_ll_opamp.c + stm32l4xx_ll_pka.c + stm32l4xx_ll_pwr.c + stm32l4xx_ll_rcc.c + stm32l4xx_ll_rng.c + stm32l4xx_ll_rtc.c + stm32l4xx_ll_sdmmc.c + stm32l4xx_ll_spi.c + stm32l4xx_ll_swpmi.c + stm32l4xx_ll_tim.c + stm32l4xx_ll_usart.c + stm32l4xx_ll_usb.c + stm32l4xx_ll_utils.c +) + diff --git a/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/Legacy/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/Legacy/CMakeLists.txt new file mode 100644 index 00000000000..1f8ddf3566b --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/STM32Cube_FW/STM32L4xx_HAL_Driver/Legacy/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + stm32l4xx_hal_can_legacy.c +) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/CMakeLists.txt new file mode 100644 index 00000000000..47903bfd0cf --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +if("DISCO_L475VG_IOT01A" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_DISCO_L475VG_IOT01A) +endif() + +function(_mbed_get_assembly_stm32l475xg) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l475xx.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l475xx.S) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32l475xx.S) + endif() + target_sources(mbed-core INTERFACE ${STARTUP_FILE}) +endfunction() + +function(_mbed_set_linker_file_stm32l475xg) + if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_GCC_ARM/stm32l475xg.ld) + elseif(${MBED_TOOLCHAIN} STREQUAL "ARM") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_ARM/stm32l475xg.sct) + elseif(${MBED_TOOLCHAIN} STREQUAL "IAR") + set(LINKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/TOOLCHAIN_IAR/stm32l475xg.icf) + endif() + set_property(GLOBAL PROPERTY MBED_TARGET_LINKER_FILE ${LINKER_FILE}) +endfunction() + +_mbed_get_assembly_stm32l475xg() +_mbed_set_linker_file_stm32l475xg() + +target_include_directories(mbed-core + INTERFACE + . +) + +target_sources(mbed-core + INTERFACE + system_clock.c +) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/CMakeLists.txt new file mode 100644 index 00000000000..7cf404809e5 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_sources(mbed-core + INTERFACE + PeripheralPins.c +) + +target_include_directories(mbed-core + INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TOOLCHAIN_ARM/stm32l475xg.sct b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TOOLCHAIN_ARM/stm32l475xg.sct index 4d3a2856074..e603ec44191 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TOOLCHAIN_ARM/stm32l475xg.sct +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TOOLCHAIN_ARM/stm32l475xg.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ; Scatter-Loading Description File ; ; SPDX-License-Identifier: BSD-3-Clause diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TOOLCHAIN_ARM/stm32l486xg.sct b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TOOLCHAIN_ARM/stm32l486xg.sct index 85301bcfde8..e1d23ce9029 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TOOLCHAIN_ARM/stm32l486xg.sct +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TOOLCHAIN_ARM/stm32l486xg.sct @@ -1,4 +1,4 @@ -#! armcc -E +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4 ; Scatter-Loading Description File ; ; SPDX-License-Identifier: BSD-3-Clause diff --git a/tools/cmake/README.md b/tools/cmake/README.md new file mode 100644 index 00000000000..c7db5bc9e5a --- /dev/null +++ b/tools/cmake/README.md @@ -0,0 +1,65 @@ +## CMake for Mbed OS + +In order to [replace the traditional Mbed tools](https://os.mbed.com/blog/entry/Introducing-the-new-Mbed-Tools/), we are adding CMake support to allow the generation of build systems instructions to build Mbed OS as a library. + +This is still at the experimental stage and still in development. It does not yet completely replace our current build tools. If you find a bug, please report it or raise a pull request as contributions are welcome! + +Mbed OS is built as collection of all core libraries. Application project executables can be linked with the `mbed-os` library (which includes the core libraries of Mbed OS) and optional `mbed-os-` prefixed libraries depending on the additional features required by the projects and supported by the Mbed target. + +The list of optional libraries for each component can be seen in the CMake input source file at the root of each component directory. + +The following features are not yet supported and will be progressively added: +* Application profile selection (`bare metal`) +* Features that require altering compiler/linker command line options (except for printf library and C selections) + +The full profile with the selected printf and C libraries. + +### Supported targets + +Only a limited set of targets is supported at the moment. + +The following targets are supported: +- DISCO_L475VG_IOT01A +- K64F +- K66F +- NRF52840_DK +- NUCLEO_F303K8 +- NUCLEO_F401RE +- WIO_3G + +### Supported toolchains + +Arm Compiler 6 and GNU Arm Embedded toolchains are supported. + +### Examples + +Supported examples can be identified by the presence of a top level `CMakelists.txt` input source file. + +### Known issues + +- Ninja: ARMClang6 response files require unix paths on Windows. Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21093. We disabled response files for Ninja on Windows until CMake is fixed. + +## How to build an application + +Prerequisities: +- CMake >=3.19.0 +- mbed-tools >=3.4.0 + +From the application root or wherever `mbed-os.lib` is found: +1. Run the following command to create the Mbed OS configuration CMake module: + + ``` + mbedtools configure -m -t + ``` + +1. Run the following command to create a build directory, generate the project configuration and build the project using `Ninja`: + + ``` + mkdir build && cd build && cmake .. -GNinja && cmake --build . + ``` + +The default build type is `Develop`. Use `CMAKE_BUILD_TYPE` to select `Develop`, `Release` or `Debug` as follows: + +``` +cmake .. -GNinja -DCMAKE_BUILD_TYPE= && cmake --build . +``` diff --git a/tools/cmake/app.cmake b/tools/cmake/app.cmake new file mode 100644 index 00000000000..9a3d5c26819 --- /dev/null +++ b/tools/cmake/app.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +find_program(CCACHE "ccache") +if(CCACHE) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) +endif() + +include(${MBED_CONFIG_PATH}/mbed_config.cmake) + +set(MBED_TOOLCHAIN_FILE_USED FALSE) + +# Set default toolchain file +if(NOT CMAKE_TOOLCHAIN_FILE) + set(MBED_TOOLCHAIN_FILE_USED TRUE) + + set(CMAKE_TOOLCHAIN_FILE "${MBED_PATH}/tools/cmake/toolchain.cmake" CACHE INTERNAL "") + + # Specify locations for toolchains and generic options + include(${MBED_PATH}/tools/cmake/toolchains/${MBED_TOOLCHAIN}.cmake) + + # Specify available build profiles and add options for the selected build profile + include(${MBED_PATH}/tools/cmake/profile.cmake) +endif() + +enable_language(C CXX ASM) diff --git a/tools/cmake/core.cmake b/tools/cmake/core.cmake new file mode 100644 index 00000000000..c206f1b38f6 --- /dev/null +++ b/tools/cmake/core.cmake @@ -0,0 +1,4 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +include(${MBED_PATH}/tools/cmake/cores/${MBED_CPU_CORE}.cmake) diff --git a/tools/cmake/cores/Cortex-A9.cmake b/tools/cmake/cores/Cortex-A9.cmake new file mode 100644 index 00000000000..f953c74878f --- /dev/null +++ b/tools/cmake/cores/Cortex-A9.cmake @@ -0,0 +1,54 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb-interwork" + "-marm" + "-march=armv7-a" + "-mfpu=vfpv3" + "-mfloat-abi=hard" + "-mno-unaligned-access" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-a9" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-A9> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-A9" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_A9 + ARM_MATH_CA9 + __FPU_PRESENT + __CMSIS_RTOS + __EVAL + __MBED_CMSIS_RTOS_CA9 + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M0+.cmake b/tools/cmake/cores/Cortex-M0+.cmake new file mode 100644 index 00000000000..4a3b62db612 --- /dev/null +++ b/tools/cmake/cores/Cortex-M0+.cmake @@ -0,0 +1,48 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mcpu=cortex-m0plus" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m0plus" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M0plus> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M0plus" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M0PLUS + ARM_MATH_CM0PLUS + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M0.cmake b/tools/cmake/cores/Cortex-M0.cmake new file mode 100644 index 00000000000..a6e376e4bbe --- /dev/null +++ b/tools/cmake/cores/Cortex-M0.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND options + "-mcpu=cortex-m0" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M0> + ) + + target_link_options(${target} + INTERFACE + "-cpu=Cortex-M0" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M0 + ARM_MATH_CM0 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M1.cmake b/tools/cmake/cores/Cortex-M1.cmake new file mode 100644 index 00000000000..46ac7da2ce2 --- /dev/null +++ b/tools/cmake/cores/Cortex-M1.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND options + "-mcpu=cortex-m1" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M1> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M1" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M3 + ARM_MATH_CM1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M23-NS.cmake b/tools/cmake/cores/Cortex-M23-NS.cmake new file mode 100644 index 00000000000..fcb043c33fd --- /dev/null +++ b/tools/cmake/cores/Cortex-M23-NS.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m23" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M23> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M23" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M23 + ARM_MATH_ARMV8MBL + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M23.cmake b/tools/cmake/cores/Cortex-M23.cmake new file mode 100644 index 00000000000..2383f8c27f2 --- /dev/null +++ b/tools/cmake/cores/Cortex-M23.cmake @@ -0,0 +1,48 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m23" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M23> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M23" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M23 + ARM_MATH_ARMV8MBL + DOMAIN_NS=1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M3.cmake b/tools/cmake/cores/Cortex-M3.cmake new file mode 100644 index 00000000000..ae01ccf6a1a --- /dev/null +++ b/tools/cmake/cores/Cortex-M3.cmake @@ -0,0 +1,47 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m3" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M3> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M3" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M3 + ARM_MATH_CM3 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33-NS.cmake b/tools/cmake/cores/Cortex-M33-NS.cmake new file mode 100644 index 00000000000..d8b8b696f70 --- /dev/null +++ b/tools/cmake/cores/Cortex-M33-NS.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-march=armv8-m.main" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33+nodsp" + "-mfpu=none" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33.no_dsp.no_fp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33.no_dsp.no_fp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33.cmake b/tools/cmake/cores/Cortex-M33.cmake new file mode 100644 index 00000000000..51d935a84df --- /dev/null +++ b/tools/cmake/cores/Cortex-M33.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + list(APPEND options) + + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-march=armv8-m.main" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33+nodsp" + "-mfpu=none" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33.no_dsp.no_fp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33.no_dsp.no_fp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + DOMAIN_NS=1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33F-NS.cmake b/tools/cmake/cores/Cortex-M33F-NS.cmake new file mode 100644 index 00000000000..657a0d54b88 --- /dev/null +++ b/tools/cmake/cores/Cortex-M33F-NS.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=softfp" + "-march=armv8-m.main" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33+nodsp" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=hard" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33.no_dsp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33.no_dsp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + __FPU_PRESENT=1U + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33F.cmake b/tools/cmake/cores/Cortex-M33F.cmake new file mode 100644 index 00000000000..583568793d9 --- /dev/null +++ b/tools/cmake/cores/Cortex-M33F.cmake @@ -0,0 +1,54 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=softfp" + "-march=armv8-m.main" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33+nodsp" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=hard" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33.no_dsp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33.no_dsp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + DOMAIN_NS=1 + __FPU_PRESENT=1U + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33FE-NS.cmake b/tools/cmake/cores/Cortex-M33FE-NS.cmake new file mode 100644 index 00000000000..a9381289b05 --- /dev/null +++ b/tools/cmake/cores/Cortex-M33FE-NS.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=softfp" + "-march=armv8-m.main+dsp" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + __FPU_PRESENT=1U + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + __DSP_PRESENT=1U + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M33FE.cmake b/tools/cmake/cores/Cortex-M33FE.cmake new file mode 100644 index 00000000000..aa3587271b4 --- /dev/null +++ b/tools/cmake/cores/Cortex-M33FE.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=softfp" + "-march=armv8-m.main+dsp" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m33" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M33> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M33" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M33 + ARM_MATH_ARMV8MML + DOMAIN_NS=1 + __FPU_PRESENT=1U + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + __DSP_PRESENT=1U + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M4.cmake b/tools/cmake/cores/Cortex-M4.cmake new file mode 100644 index 00000000000..d6058a2ebb5 --- /dev/null +++ b/tools/cmake/cores/Cortex-M4.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mcpu=cortex-m4" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m4" + "-mfpu=none" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M4.no_fp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M4.no_fp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M4 + ARM_MATH_CM4 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M4F.cmake b/tools/cmake/cores/Cortex-M4F.cmake new file mode 100644 index 00000000000..f064158bc99 --- /dev/null +++ b/tools/cmake/cores/Cortex-M4F.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mcpu=cortex-m4" + "-mfpu=fpv4-sp-d16" + "-mfloat-abi=softfp" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m4" + "-mfpu=fpv4-sp-d16" + "-mfloat-abi=hard" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M4> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M4" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M4 + ARM_MATH_CM4 + __FPU_PRESENT=1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M7.cmake b/tools/cmake/cores/Cortex-M7.cmake new file mode 100644 index 00000000000..8b4f3473cfa --- /dev/null +++ b/tools/cmake/cores/Cortex-M7.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mcpu=cortex-m7" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m7" + "-mfpu=none" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M7.no_fp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M7.no_fp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M7 + ARM_MATH_CM7 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M7F.cmake b/tools/cmake/cores/Cortex-M7F.cmake new file mode 100644 index 00000000000..660968f5cdd --- /dev/null +++ b/tools/cmake/cores/Cortex-M7F.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=softfp" + "-mcpu=cortex-m7" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m7" + "-mfpu=fpv5-sp-d16" + "-mfloat-abi=hard" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M7.fp.sp> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M7.fp.sp" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M7 + ARM_MATH_CM7 + __FPU_PRESENT=1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/cores/Cortex-M7FD.cmake b/tools/cmake/cores/Cortex-M7FD.cmake new file mode 100644 index 00000000000..18b8b3268cf --- /dev/null +++ b/tools/cmake/cores/Cortex-M7FD.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets cpu core options +function(mbed_set_cpu_core_options target mbed_toolchain) + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND common_toolchain_options + "-mthumb" + "-mfpu=fpv5-d16" + "-mfloat-abi=softfp" + "-mcpu=cortex-m7" + ) + + target_compile_options(${target} + INTERFACE + ${common_toolchain_options} + ) + + target_link_options(${target} + INTERFACE + ${common_toolchain_options} + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND compile_options + "-mcpu=cortex-m7" + "-mfpu=fpv5-d16" + "-mfloat-abi=hard" + ) + + target_compile_options(${target} + INTERFACE + $<$:${compile_options}> + $<$:${compile_options}> + $<$:-mcpu=Cortex-M7> + ) + + target_link_options(${target} + INTERFACE + "--cpu=Cortex-M7" + ) + endif() +endfunction() + +function(mbed_set_cpu_core_definitions target) + target_compile_definitions(${target} + INTERFACE + __CORTEX_M7 + ARM_MATH_CM7 + __FPU_PRESENT=1 + __CMSIS_RTOS + __MBED_CMSIS_RTOS_CM + ) +endfunction() diff --git a/tools/cmake/profile.cmake b/tools/cmake/profile.cmake new file mode 100644 index 00000000000..cbffbca2b2b --- /dev/null +++ b/tools/cmake/profile.cmake @@ -0,0 +1,32 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Set the default build type if none is specified +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Develop" CACHE + STRING "The build type" FORCE + ) +endif() + +set(MBED_BUILD_TYPES Debug Release Develop) + +# Force the build types to be case-insensitive for checking +set(LOWERCASE_MBED_BUILD_TYPES ${MBED_BUILD_TYPES}) +list(TRANSFORM LOWERCASE_MBED_BUILD_TYPES TOLOWER) +string(TOLOWER ${CMAKE_BUILD_TYPE} LOWERCASE_CMAKE_BUILD_TYPE) + +# Mapping CMAKE_BUILD_TYPE into MBED_BUILD_TYPES, as we understand only 3 profiles +get_property(multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(multi_config) + # Provide only a list as multi configuration generators do not support build type + set(CMAKE_CONFIGURATION_TYPES "${MBED_BUILD_TYPES}" CACHE STRING "List of supported build types" FORCE) +else() + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${MBED_BUILD_TYPES}") + + if(NOT LOWERCASE_CMAKE_BUILD_TYPE IN_LIST LOWERCASE_MBED_BUILD_TYPES) + message(FATAL_ERROR "Invalid build type '${CMAKE_BUILD_TYPE}'. Possible values:\n ${MBED_BUILD_TYPES}") + endif() +endif() + +include(${MBED_PATH}/tools/cmake/profiles/${LOWERCASE_CMAKE_BUILD_TYPE}.cmake) diff --git a/tools/cmake/profiles/debug.cmake b/tools/cmake/profiles/debug.cmake new file mode 100644 index 00000000000..3bef716a152 --- /dev/null +++ b/tools/cmake/profiles/debug.cmake @@ -0,0 +1,95 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets profile options +function(mbed_set_profile_options target mbed_toolchain) + list(APPEND link_options) + + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND c_compile_options + "-c" + "-Og" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-c" + "-fno-rtti" + "-Wvla" + "-Og" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND asm_compile_options + "-c" + "-x" "assembler-with-cpp" + ) + target_compile_options(${target} + INTERFACE + $<$:${asm_compile_options}> + ) + + list(APPEND link_options + "-Wl,--gc-sections" + "-Wl,--wrap,main" + "-Wl,--wrap,_malloc_r" + "-Wl,--wrap,_free_r" + "-Wl,--wrap,_realloc_r" + "-Wl,--wrap,_memalign_r" + "-Wl,--wrap,_calloc_r" + "-Wl,--wrap,exit" + "-Wl,--wrap,atexit" + "-Wl,-n" + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND c_compile_options + "-O1" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-fno-rtti" + "-fno-c++-static-destructors" + "-O1" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND link_options + "--verbose" + "--remove" + "--show_full_path" + "--legacyalign" + "--any_contingency" + "--keep=os_cb_sections" + ) + + target_compile_definitions(${target} + INTERFACE + __ASSERT_MSG + MULADDC_CANNOT_USE_R7 + ) + endif() + + target_compile_definitions(${target} + INTERFACE + MBED_DEBUG + MBED_TRAP_ERRORS_ENABLED=1 + ) + + target_link_options(${target} + INTERFACE + ${link_options} + ) +endfunction() diff --git a/tools/cmake/profiles/develop.cmake b/tools/cmake/profiles/develop.cmake new file mode 100644 index 00000000000..4ae3e05706c --- /dev/null +++ b/tools/cmake/profiles/develop.cmake @@ -0,0 +1,90 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets profile options +function(mbed_set_profile_options target mbed_toolchain) + list(APPEND link_options) + + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND c_compile_options + "-c" + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-fno-rtti" + "-Wvla" + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND asm_compile_options + "-x" "assembler-with-cpp" + ) + target_compile_options(${target} + INTERFACE + $<$:${asm_compile_options}> + ) + + list(APPEND link_options + "-Wl,--gc-sections" + "-Wl,--wrap,main" + "-Wl,--wrap,_malloc_r" + "-Wl,--wrap,_free_r" + "-Wl,--wrap,_realloc_r" + "-Wl,--wrap,_memalign_r" + "-Wl,--wrap,_calloc_r" + "-Wl,--wrap,exit" + "-Wl,--wrap,atexit" + "-Wl,-n" + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND c_compile_options + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-fno-rtti" + "-fno-c++-static-destructors" + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND link_options + "--show_full_path" + "--legacyalign" + "--inline" + "--any_contingency" + "--keep=os_cb_sections" + ) + + target_compile_definitions(${target} + INTERFACE + __ASSERT_MSG + ) + endif() + + target_compile_definitions(${target} + INTERFACE + MBED_TRAP_ERRORS_ENABLED=1 + ) + + target_link_options(${target} + INTERFACE + ${link_options} + ) +endfunction() diff --git a/tools/cmake/profiles/release.cmake b/tools/cmake/profiles/release.cmake new file mode 100644 index 00000000000..20327a635c3 --- /dev/null +++ b/tools/cmake/profiles/release.cmake @@ -0,0 +1,92 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Sets profile options +function(mbed_set_profile_options target mbed_toolchain) + list(APPEND link_options) + + if(${mbed_toolchain} STREQUAL "GCC_ARM") + list(APPEND c_compile_options + "-c" + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-c" + "-fno-rtti" + "-Wvla" + "-Os" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND asm_compile_options + "-c" + "-x" "assembler-with-cpp" + ) + target_compile_options(${target} + INTERFACE + $<$:${asm_compile_options}> + ) + + list(APPEND link_options + "-Wl,--gc-sections" + "-Wl,--wrap,main" + "-Wl,--wrap,_malloc_r" + "-Wl,--wrap,_free_r" + "-Wl,--wrap,_realloc_r" + "-Wl,--wrap,_memalign_r" + "-Wl,--wrap,_calloc_r" + "-Wl,--wrap,exit" + "-Wl,--wrap,atexit" + "-Wl,-n" + ) + elseif(${mbed_toolchain} STREQUAL "ARM") + list(APPEND c_compile_options + "-Oz" + ) + target_compile_options(${target} + INTERFACE + $<$:${c_compile_options}> + ) + + list(APPEND cxx_compile_options + "-fno-rtti" + "-fno-c++-static-destructors" + "-Oz" + ) + target_compile_options(${target} + INTERFACE + $<$:${cxx_compile_options}> + ) + + list(APPEND link_options + "--show_full_path" + "--legacyalign" + "--inline" + "--any_contingency" + "--keep=os_cb_sections" + ) + + target_compile_definitions(${target} + INTERFACE + __ASSERT_MSG + ) + endif() + + target_compile_definitions(${target} + INTERFACE + NDEBUG + ) + + target_link_options(${target} + INTERFACE + ${link_options} + ) +endfunction() diff --git a/tools/cmake/toolchain.cmake b/tools/cmake/toolchain.cmake new file mode 100644 index 00000000000..6f11d7a8541 --- /dev/null +++ b/tools/cmake/toolchain.cmake @@ -0,0 +1,91 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Set the system processor depending on the CPU core type +if (MBED_CPU_CORE STREQUAL Cortex-A9) + set(CMAKE_SYSTEM_PROCESSOR cortex-a9) +elseif (MBED_CPU_CORE STREQUAL Cortex-M0+) + set(CMAKE_SYSTEM_PROCESSOR cortex-m0plus) +elseif (MBED_CPU_CORE STREQUAL Cortex-M0) + set(CMAKE_SYSTEM_PROCESSOR cortex-m0) +elseif (MBED_CPU_CORE STREQUAL Cortex-M1) + set(CMAKE_SYSTEM_PROCESSOR cortex-m1) +elseif (MBED_CPU_CORE STREQUAL Cortex-M23-NS) + set(CMAKE_SYSTEM_PROCESSOR cortex-m23) +elseif (MBED_CPU_CORE STREQUAL Cortex-M23) + set(CMAKE_SYSTEM_PROCESSOR cortex-m23) +elseif (MBED_CPU_CORE STREQUAL Cortex-M3) + set(CMAKE_SYSTEM_PROCESSOR cortex-m3) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33-NS) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33F-NS) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33F) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33FE-NS) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M33FE) + set(CMAKE_SYSTEM_PROCESSOR cortex-m33) +elseif (MBED_CPU_CORE STREQUAL Cortex-M4) + set(CMAKE_SYSTEM_PROCESSOR cortex-m4) +elseif (MBED_CPU_CORE STREQUAL Cortex-M4F) + set(CMAKE_SYSTEM_PROCESSOR cortex-m4) +elseif (MBED_CPU_CORE STREQUAL Cortex-M7) + set(CMAKE_SYSTEM_PROCESSOR cortex-m7) +elseif (MBED_CPU_CORE STREQUAL Cortex-M7F) + set(CMAKE_SYSTEM_PROCESSOR cortex-m7) +elseif (MBED_CPU_CORE STREQUAL Cortex-M7FD) + set(CMAKE_SYSTEM_PROCESSOR cortex-m7) +endif() + +# Compiler setup +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_CXX_COMPILER_WORKS TRUE) + +# Set the language standard to use per target +function(mbed_set_language_standard target) + set_target_properties(${target} + PROPERTIES + C_STANDARD 11 + C_STANDARD_REQUIRED YES + C_EXTENSIONS YES + ) + + set_target_properties(${target} + PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS YES + ) +endfunction() + +# Clear toolchains options for all languages as Mbed OS uses +# different initialisation options (such as for optimization and debug symbols) +set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE) + +set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE) + +set(CMAKE_ASM_FLAGS_DEBUG "" CACHE STRING "" FORCE) +set(CMAKE_ASM_FLAGS_RELEASE "" CACHE STRING "" FORCE) +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "" CACHE STRING "" FORCE) + +# Use response files always +set(CMAKE_ASM_USE_RESPONSE_FILE_FOR_INCLUDES 1) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1) + +set(CMAKE_ASM_USE_RESPONSE_FILE_FOR_OBJECTS 1) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) + +set(CMAKE_ASM_USE_RESPONSE_FILE_FOR_LIBRARIES 1) +set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1) +set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1) diff --git a/tools/cmake/toolchains/ARM.cmake b/tools/cmake/toolchains/ARM.cmake new file mode 100644 index 00000000000..0ff9ea47723 --- /dev/null +++ b/tools/cmake/toolchains/ARM.cmake @@ -0,0 +1,92 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(CMAKE_ASM_COMPILER "armclang") +set(CMAKE_C_COMPILER "armclang") +set(CMAKE_CXX_COMPILER "armclang") +set(CMAKE_AR "armar") +set(ARM_ELF2BIN "fromelf") +set_property(GLOBAL PROPERTY ELF2BIN ${ARM_ELF2BIN}) + +option(MBEDIDE "Use Arm compiler from Mbed Studio" OFF) +if(MBEDIDE) + set_property(GLOBAL PROPERTY MBED_STUDIO_ARM_COMPILER "--ide=mbed") +endif() + +# Sets toolchain options +function(mbed_set_toolchain_options target) + get_property(mbed_studio_arm_compiler GLOBAL PROPERTY MBED_STUDIO_ARM_COMPILER) + list(APPEND common_options + "${mbed_studio_arm_compiler}" + "-c" + "--target=arm-arm-none-eabi" + "-mthumb" + "-Wno-armcc-pragma-push-pop" + "-Wno-armcc-pragma-anon-unions" + "-Wno-reserved-user-defined-literal" + "-Wno-deprecated-register" + "-fdata-sections" + "-fno-exceptions" + "-fshort-enums" + "-fshort-wchar" + ) + + target_compile_options(${target} + INTERFACE + $<$:${common_options}> + ) + + target_compile_options(${target} + INTERFACE + $<$:${common_options}> + ) + + target_compile_options(${target} + INTERFACE + $<$:--target=arm-arm-none-eabi -masm=auto> + $<$:${MBED_STUDIO_ARM_COMPILER}> + ) + + list(APPEND link_options + "${MBED_STUDIO_ARM_COMPILER}" + "--map" + ) + + # Add linking time preprocessor macro for TFM targets + if(MBED_CPU_CORE MATCHES "\-NS$") + list(APPEND link_options + "--predefine=\"-DDOMAIN_NS=0x1\"" + ) + endif() + + target_link_options(${target} + INTERFACE + ${link_options} + ) +endfunction() + +# Configure the toolchain to select the selected C library +function(mbed_set_c_lib target lib_type) + if (${lib_type} STREQUAL "small") + target_compile_definitions(${target} + INTERFACE + MBED_RTOS_SINGLE_THREAD + __MICROLIB + ) + + target_link_options(${target} + INTERFACE + "--library_type=microlib" + ) + endif() +endfunction() + +# Configure the toolchain to select the selected printf library +function(mbed_set_printf_lib target lib_type) + if (${lib_type} STREQUAL "minimal-printf") + target_compile_definitions(${target} + INTERFACE + MBED_MINIMAL_PRINTF + ) + endif() +endfunction() diff --git a/tools/cmake/toolchains/GCC_ARM.cmake b/tools/cmake/toolchains/GCC_ARM.cmake new file mode 100644 index 00000000000..1b2f111878e --- /dev/null +++ b/tools/cmake/toolchains/GCC_ARM.cmake @@ -0,0 +1,122 @@ +# Copyright (c) 2020 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") +set(CMAKE_C_COMPILER "arm-none-eabi-gcc") +set(CMAKE_CXX_COMPILER "arm-none-eabi-g++") +set(GCC_ELF2BIN "arm-none-eabi-objcopy") +set_property(GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN}) + +# Sets toolchain options +function(mbed_set_toolchain_options target) + list(APPEND link_options + "-Wl,--start-group" + "-lstdc++" + "-lsupc++" + "-lm" + "-lc" + "-lgcc" + "-lnosys" + "-Wl,--end-group" + "-specs=nosys.specs" + "-T" "${CMAKE_BINARY_DIR}/${APP_TARGET}.link_script.ld" + "-Wl,-Map=${CMAKE_BINARY_DIR}/${APP_TARGET}.map" + "-Wl,--cref" + ) + + # Add linking time preprocessor macro for TFM targets + if("TFM" IN_LIST MBED_TARGET_LABELS) + list(APPEND link_options + "-DDOMAIN_NS=1" + ) + endif() + + list(APPEND common_options + "-Wall" + "-Wextra" + "-Wno-unused-parameter" + "-Wno-missing-field-initializers" + "-fmessage-length=0" + "-fno-exceptions" + "-ffunction-sections" + "-fdata-sections" + "-funsigned-char" + "-MMD" + "-fomit-frame-pointer" + "-g3" + ) + + target_compile_options(${target} + INTERFACE + ${common_options} + ) + + target_link_options(${target} + INTERFACE + ${common_options} + ${link_options} + ) +endfunction() + +# Generate a file containing compile definitions +function(mbed_generate_gcc_options_for_linker target definitions_file) + set(_compile_definitions + "$" + ) + + # Remove macro definitions that contain spaces as the lack of escape sequences and quotation marks + # in the macro when retrieved using generator expressions causes linker errors. + # This includes string macros, array macros, and macros with operations. + # TODO CMake: Add escape sequences and quotation marks where necessary instead of removing these macros. + set(_compile_definitions + "$" + ) + + # Append -D to all macros as we pass these as response file to cxx compiler + set(_compile_definitions + "$<$:-D$>" + ) + file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/compile_time_defs.txt" CONTENT "${_compile_definitions}\n") + set(${definitions_file} @${CMAKE_BINARY_DIR}/compile_time_defs.txt PARENT_SCOPE) +endfunction() + +# Configure the toolchain to select the selected C library +function(mbed_set_c_lib target lib_type) + if (${lib_type} STREQUAL "small") + target_compile_definitions(${target} + INTERFACE + MBED_RTOS_SINGLE_THREAD + __NEWLIB_NANO + ) + + target_link_options(${target} + INTERFACE + "--specs=nano.specs" + ) + endif() +endfunction() + +# Configure the toolchain to select the selected printf library +function(mbed_set_printf_lib target lib_type) + if (${lib_type} STREQUAL "minimal-printf") + target_compile_definitions(${target} + INTERFACE + MBED_MINIMAL_PRINTF + ) + + list(APPEND link_options + "-Wl,--wrap,printf" + "-Wl,--wrap,sprintf" + "-Wl,--wrap,snprintf" + "-Wl,--wrap,vprintf" + "-Wl,--wrap,vsprintf" + "-Wl,--wrap,vsnprintf" + "-Wl,--wrap,fprintf" + "-Wl,--wrap,vfprintf" + ) + target_link_options(${target} + INTERFACE + ${link_options} + ) + endif() +endfunction() diff --git a/tools/test/examples/examples.py b/tools/test/examples/examples.py index a590915a1b3..8a87ff43893 100644 --- a/tools/test/examples/examples.py +++ b/tools/test/examples/examples.py @@ -80,11 +80,10 @@ def parse_args(): official_target_names, "MCU")), default=official_target_names) - compile_cmd.add_argument( - "--profiles", - nargs='+', - metavar="profile", - help="build profile(s)") + compile_cmd.add_argument("--profiles", + nargs='+', + metavar="profile", + help="build profile(s)") compile_cmd.add_argument("-j", "--jobs", dest='jobs', @@ -160,7 +159,7 @@ def do_deploy(_, config, examples): def do_compile(args, config, examples): """Do the compile step""" - results = lib.compile_repos(config, args.toolchains, args.mcu, args.profiles, args.verbose, examples, args.jobs) + results = lib.compile_repos(config, args.toolchains, args.mcu, args.profiles, args.verbose, examples, args.cmake, args.jobs) failures = lib.get_build_summary(results) return failures diff --git a/tools/test/examples/examples_cmake.json b/tools/test/examples/examples_cmake.json new file mode 100644 index 00000000000..47edbafd138 --- /dev/null +++ b/tools/test/examples/examples_cmake.json @@ -0,0 +1,150 @@ +{ + "examples": [ + { + "name": "mbed-os-example-blinky", + "github": "https://github.com/ARMmbed/mbed-os-example-blinky", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : [], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : false, + "baud_rate": 9600, + "auto-update" : true + }, + { + "name": "mbed-os-example-sockets", + "github":"https://github.com/ARMmbed/mbed-os-example-sockets", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : ["K64F", "K66F"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : true, + "baud_rate": 9600, + "compare_log": ["mbed-os-example-sockets/tests/sockets.log"], + "auto-update" : true + }, + { + "name": "mbed-os-example-cellular", + "github":"https://github.com/ARMmbed/mbed-os-example-cellular", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : ["WIO_3G"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : false, + "auto-update" : true + }, + { + "name": "mbed-os-example-lorawan", + "github":"https://github.com/ARMmbed/mbed-os-example-lorawan", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : ["K64F"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": false, + "test" : false, + "auto-update" : true + }, + { + "name": "mbed-os-example-devicekey", + "github":"https://github.com/ARMmbed/mbed-os-example-devicekey", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : ["K66F"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : true, + "baud_rate": 9600, + "compare_log": ["mbed-os-example-devicekey/tests/devicekey.log"], + "auto-update" : true + }, + { + "name": "mbed-os-example-mbed-crypto", + "github":"https://github.com/ARMmbed/mbed-os-example-mbed-crypto", + "sub-repo-example": true, + "subs": ["getting-started"], + "features" : [], + "targets" : ["K64F"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : true, + "baud_rate": 9600, + "compare_log": ["mbed-os-example-mbed-crypto/tests/getting-started.log"], + "auto-update" : true + }, + { + "name": "mbed-os-example-nfc", + "github": "https://github.com/ARMmbed/mbed-os-example-nfc", + "sub-repo-example": true, + "subs": [ + "NFC_EEPROM", + "NFC_SmartPoster" + ], + "features" : [], + "targets" : ["NUCLEO_F401RE"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : true, + "baud_rate": 9600, + "compare_log": [ + "mbed-os-example-nfc/tests/EEPROM.log", + "mbed-os-example-nfc/tests/SmartPoster_noShield.log" + ], + "auto-update" : true + }, + { + "name": "mbed-os-example-ble", + "github":"https://github.com/ARMmbed/mbed-os-example-ble", + "sub-repo-example": true, + "subs": [ + "BLE_LED" + + ], + "features" : [], + "targets" : ["NRF52840_DK", "DISCO_L475VG_IOT01A"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : false, + "auto-update" : true + }, + { + "name": "mbed-os-example-kvstore", + "github":"https://github.com/ARMmbed/mbed-os-example-kvstore", + "sub-repo-example": false, + "subs": [], + "features" : [], + "targets" : ["K64F", "DISCO_L475VG_IOT01A"], + "toolchains" : [], + "exporters": [], + "compile" : true, + "export": true, + "test" : true, + "baud_rate": 9600, + "compare_log": ["mbed-os-example-kvstore/tests/kvstore.log"], + "auto-update" : true + } + ] +} diff --git a/tools/test/examples/examples_lib.py b/tools/test/examples/examples_lib.py index b49964d4a9b..07d3526b09b 100644 --- a/tools/test/examples/examples_lib.py +++ b/tools/test/examples/examples_lib.py @@ -329,7 +329,7 @@ def export_repos(config, ides, targets, exp_filter): return results -def compile_repos(config, toolchains, targets, profiles, verbose, exp_filter, jobs=0): +def compile_repos(config, toolchains, targets, profiles, verbose, exp_filter, cmake=False ,jobs=0): """Compiles combinations of example programs, targets and compile chains. The results are returned in a [key: value] dictionary format: @@ -382,27 +382,36 @@ def compile_repos(config, toolchains, targets, profiles, verbose, exp_filter, jo summary_string = "%s %s %s" % (name, target, toolchain) logging.info("Compiling %s" % summary_string) - build_command = ["mbed-cli", "compile", "-t", toolchain, "-m", target, "-j", str(jobs)] + (['-vv'] if verbose else []) - if profiles: - for profile in profiles: - build_command.extend(["--profile", profile]) - - logging.info("Executing command '%s'..." % " ".join(build_command)) - proc = subprocess.Popen(build_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - std_out, std_err = proc.communicate() - std_out = std_out.decode() - std_err = std_err.decode() - print ("\n#### STDOUT ####\n%s\n#### STDERR ####\n%s\n#### End of STDOUT/STDERR ####\n" % (std_out,std_err)) - - if proc.returncode: - failures.append(example_summary) + if cmake: + build_command_seq = ["mbed-tools build -t {} -m {} -c".format(toolchain, target)] else: + build_command_seq = ["mbed-cli compile -t {} -m {} -j {} {}".format(toolchain, target, str(jobs), '-vv' if verbose else '') ] + if profiles: + for profile in profiles: + build_command_seq[0] += " --profile {}".format(profile) + + failed_flag = False + for build_command in build_command_seq: + logging.info("Executing command '%s'..." % build_command) + proc = subprocess.Popen(build_command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + std_out, std_err = proc.communicate() + std_out = std_out.decode() + std_err = std_err.decode() + print ("\n#### STDOUT ####\n%s\n#### STDERR ####\n%s\n#### End of STDOUT/STDERR ####\n" % (std_out,std_err)) + + if proc.returncode: + failures.append(example_summary) + failed_flag = True + break + + + if not failed_flag: if example['test']: log = example['compare_log'].pop(0) # example['compare_log'] is a list of log file/files, which matches each examples/sub-examples from same repo. # pop the log file out of list regardless the compilation for each example pass of fail - image = fetch_output_image(std_out) + image = fetch_output_image(std_out,cmake) if image: image_info = [{"binary_type": "bootable","path": normpath(join(name,image)),"compare_log":log}] test_group = "{}-{}-{}".format(target, toolchain, example['baud_rate']) @@ -450,9 +459,8 @@ def update_example_version(config, tag, exp_filter): """ print("\nUpdating example to version(branch) '%s'\n" % tag) for example in config['examples']: - if example['name'] not in exp_filter: - continue - for name in get_sub_examples_list(example): + name = example['name'] + if name in exp_filter: os.chdir(name) logging.info("In folder '%s'" % name) cmd = "git checkout -B %s origin/%s" %(tag, tag) @@ -484,17 +492,27 @@ def symlink_mbedos(config, path, exp_filter): else: logging.info("Creating Symbolic link '%s'->'mbed-os'" % path) os.symlink(path, "mbed-os") + #Cmake tool currently require 'mbed-os.lib' to be present to perform build. + #Add a empty 'mbed-os.lib' as a workaround + open('mbed-os.lib', 'a').close() os.chdir(CWD) return 0 -def fetch_output_image(output): +def fetch_output_image(output,cmake): """Find the build image from the last 30 lines of a given log""" lines = output.splitlines() last_index = -31 if len(lines)>29 else (-1 - len(lines)) for index in range(-1,last_index,-1): - if lines[index].startswith("Image:"): - image = lines[index][7:] - if os.path.isfile(image): - return image + if cmake: + if lines[index].startswith("-- built:") and lines[index].endswith(".bin"): + image = lines[index][10:] + print("IMAGE is " + image) + if os.path.isfile(image): + return os.path.relpath(image) + else: + if lines[index].startswith("Image:"): + image = lines[index][7:] + if os.path.isfile(image): + return image return False