Hello
I developed a project based on the ble_thread_dyn_mtd_coap_cli_pca10056_s140 example (on the latest SDK version) with SEGGER Embeded Studio.
Now I would like to be able to automate the compilation of my code using CI (continuous integration) using a makefile.
To do this, I tried modifying the Makefile located in "examples\multiprotocol\ble_thread\ble_thread_dyn_mtd_coap_cli\pca10056\s140\armgcc" to suit my project.
I'm not familiar with Makefiles.so I don't know if I did the right thing but here's what I changed:
- I put my source files in "SRC_FILES"
- I put my headers folders in "INC_FOLDERS"
- I put my libraries in "LIB_FILES"
- additions to "CFLAGS" and "ASMFLAGS" my preprocessor definitions
Here is my Makefile:
PROJECT_NAME := BT840 TARGETS := nrf52840_xxaa OUTPUT_DIRECTORY := _build SDK_ROOT := ../../.. PROJ_DIR := ../.. LIBRARIES_DIR := $(SDK_ROOT)/Libraries SC_DIR := $(PROJ_DIR)/Source_codes $(OUTPUT_DIRECTORY)/nrf52840_xxaa.out: \ LINKER_SCRIPT := BT840.ld # Source files common to all targets SRC_FILES += \ $(LIBRARIES_DIR)/modules/nrfx/mdk/gcc_startup_nrf52840.S \ $(LIBRARIES_DIR)/components/libraries/log/src/nrf_log_backend_rtt.c \ $(LIBRARIES_DIR)/components/libraries/log/src/nrf_log_backend_serial.c \ $(LIBRARIES_DIR)/components/libraries/log/src/nrf_log_default_backends.c \ $(LIBRARIES_DIR)/components/libraries/log/src/nrf_log_frontend.c \ $(LIBRARIES_DIR)/components/libraries/log/src/nrf_log_str_formatter.c \ $(LIBRARIES_DIR)/components/libraries/button/app_button.c \ $(LIBRARIES_DIR)/components/libraries/util/app_error.c \ $(LIBRARIES_DIR)/components/libraries/util/app_error_handler_gcc.c \ $(LIBRARIES_DIR)/components/libraries/util/app_error_weak.c \ $(LIBRARIES_DIR)/components/libraries/fifo/app_fifo.c \ $(LIBRARIES_DIR)/components/libraries/scheduler/app_scheduler.c \ $(LIBRARIES_DIR)/components/libraries/timer/app_timer2.c \ $(LIBRARIES_DIR)/components/libraries/uart/app_uart_fifo.c \ $(LIBRARIES_DIR)/components/libraries/util/app_util_platform.c \ $(LIBRARIES_DIR)/components/libraries/assert/assert.c \ $(LIBRARIES_DIR)/components/libraries/timer/drv_rtc.c \ $(LIBRARIES_DIR)/components/libraries/hardfault/hardfault_implementation.c \ $(LIBRARIES_DIR)/components/libraries/mem_manager/mem_manager.c \ $(LIBRARIES_DIR)/components/libraries/util/nrf_assert.c \ $(LIBRARIES_DIR)/components/libraries/atomic_fifo/nrf_atfifo.c \ $(LIBRARIES_DIR)/components/libraries/atomic_flags/nrf_atflags.c \ $(LIBRARIES_DIR)/components/libraries/atomic/nrf_atomic.c \ $(LIBRARIES_DIR)/components/libraries/balloc/nrf_balloc.c \ $(LIBRARIES_DIR)/external/fprintf/nrf_fprintf.c \ $(LIBRARIES_DIR)/external/fprintf/nrf_fprintf_format.c \ $(LIBRARIES_DIR)/components/libraries/memobj/nrf_memobj.c \ $(LIBRARIES_DIR)/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c \ $(LIBRARIES_DIR)/components/libraries/ringbuf/nrf_ringbuf.c \ $(LIBRARIES_DIR)/components/libraries/experimental_section_vars/nrf_section_iter.c \ $(LIBRARIES_DIR)/components/libraries/sortlist/nrf_sortlist.c \ $(LIBRARIES_DIR)/components/libraries/strerror/nrf_strerror.c \ $(LIBRARIES_DIR)/components/libraries/uart/retarget.c \ $(LIBRARIES_DIR)/components/libraries/serial/nrf_serial.c \ $(LIBRARIES_DIR)/components/libraries/queue/nrf_queue.c \ $(LIBRARIES_DIR)/components/libraries/fstorage/nrf_fstorage.c \ $(LIBRARIES_DIR)/components/libraries/fstorage/nrf_fstorage_sd.c \ $(LIBRARIES_DIR)/components/libraries/fds/fds.c \ $(LIBRARIES_DIR)/components/libraries/ecc/ecc.c \ $(LIBRARIES_DIR)/components/libraries/crc16/crc16.c \ $(LIBRARIES_DIR)/components/libraries/libuarte/nrf_libuarte_async.c \ $(LIBRARIES_DIR)/components/libraries/libuarte/nrf_libuarte_drv.c \ #$(LIBRARIES_DIR)/modules/nrfx/mdk/ses_startup_nrf52840.s \ #$(LIBRARIES_DIR)/modules/nrfx/mdk/ses_startup_nrf_common.s \ $(LIBRARIES_DIR)/modules/nrfx/mdk/gcc_startup_nrf52840.s \ $(LIBRARIES_DIR)/modules/nrfx/mdk/system_nrf52840.c \ $(SC_DIR)/Utils/multiprotocol_802154_config.c \ $(LIBRARIES_DIR)/components/boards/boards.c \ $(LIBRARIES_DIR)/integration/nrfx/legacy/nrf_drv_clock.c \ $(LIBRARIES_DIR)/integration/nrfx/legacy/nrf_drv_uart.c \ $(LIBRARIES_DIR)/modules/nrfx/hal/nrf_nvmc.c \ $(LIBRARIES_DIR)/modules/nrfx/soc/nrfx_atomic.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_clock.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_gpiote.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_nvmc.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/prs/nrfx_prs.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_uart.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_uarte.c \ $(LIBRARIES_DIR)/external/openthread/project/openthread/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.c \ $(LIBRARIES_DIR)/external/openthread/project/openthread/third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_power.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_wdt.c \ $(LIBRARIES_DIR)/integration/nrfx/legacy/nrf_drv_rng.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_rng.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_ppi.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_rtc.c \ $(LIBRARIES_DIR)/modules/nrfx/drivers/src/nrfx_timer.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp_btn_ble.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp_thread.c \ $(SC_DIR)/main.c \ $(SC_DIR)/smartvalve.c \ $(SC_DIR)/BLE/ble_thread_diagnostic.c \ $(SC_DIR)/BLE/ble_utils.c \ $(SC_DIR)/Components/Flash/flashDataStorage.c \ $(SC_DIR)/Thread/Process/process_change_network_settings.c \ $(SC_DIR)/Thread/Process/process_get_routing_info.c \ $(SC_DIR)/Thread/Process/process_get_routing_info_from_neighbors.c \ $(SC_DIR)/Thread/Process/process_get_hydraulic_data.c \ $(SC_DIR)/Thread/Thread_ressources/hydraulicData_ressource.c \ $(SC_DIR)/Thread/Thread_ressources/light_ressource.c \ $(SC_DIR)/Thread/Thread_ressources/routingInfo_ressource.c \ $(SC_DIR)/Thread/Thread_ressources/uart_ressource.c \ $(SC_DIR)/Thread/com.c \ $(SC_DIR)/Thread/thread_network_utils.c \ $(SC_DIR)/UART/uart.c \ $(SC_DIR)/UART/uart_interpreter.c \ $(SC_DIR)/Utils/utils.c \ $(SC_DIR)/Utils/log.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp_btn_ble.c \ $(LIBRARIES_DIR)/components/libraries/bsp/bsp_thread.c \ $(LIBRARIES_DIR)/components/softdevice/common/nrf_sdh.c \ $(LIBRARIES_DIR)/components/softdevice/common/nrf_sdh_ble.c \ $(LIBRARIES_DIR)/components/softdevice/common/nrf_sdh_soc.c \ $(LIBRARIES_DIR)/external/segger_rtt/SEGGER_RTT.c \ $(LIBRARIES_DIR)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \ $(LIBRARIES_DIR)/external/segger_rtt/SEGGER_RTT_printf.c \ $(LIBRARIES_DIR)/components/ble/common/ble_advdata.c \ $(LIBRARIES_DIR)/components/ble/ble_advertising/ble_advertising.c \ $(LIBRARIES_DIR)/components/ble/common/ble_conn_params.c \ $(LIBRARIES_DIR)/components/ble/common/ble_conn_state.c \ $(LIBRARIES_DIR)/components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c \ $(LIBRARIES_DIR)/components/ble/common/ble_srv_common.c \ $(LIBRARIES_DIR)/components/ble/nrf_ble_gatt/nrf_ble_gatt.c \ $(LIBRARIES_DIR)/components/ble/nrf_ble_qwr/nrf_ble_qwr.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/auth_status_tracker.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/gatt_cache_manager.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/gatts_cache_manager.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/id_manager.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/nrf_ble_lesc.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/peer_data_storage.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/peer_database.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/peer_id.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/peer_manager.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/peer_manager_handler.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/pm_buffer.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/security_dispatcher.c \ $(LIBRARIES_DIR)/components/ble/peer_manager/security_manager.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_aead.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_aes.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_aes_shared.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_ecc.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_ecdh.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_ecdsa.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_eddsa.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_error.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_hash.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_hkdf.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_hmac.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_init.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_rng.c \ $(LIBRARIES_DIR)/components/libraries/crypto/nrf_crypto_shared.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_chacha_poly_aead.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_ecc.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_ecdh.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_ecdsa.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_eddsa.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_hash.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon/oberon_backend_hmac.c \ $(LIBRARIES_DIR)/components/ble/nrf_ble_scan/nrf_ble_scan.c \ $(LIBRARIES_DIR)/components/ble/ble_db_discovery/ble_db_discovery.c \ $(LIBRARIES_DIR)/components/ble/nrf_ble_gq/nrf_ble_gq.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/nrf_hw/nrf_hw_backend_init.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/nrf_hw/nrf_hw_backend_rng.c \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/nrf_hw/nrf_hw_backend_rng_mbedtls.c \ $(LIBRARIES_DIR)/external/utf_converter/utf.c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_dis/ble_dis.c \ $(LIBRARIES_DIR)/components/thread/utils/thread_utils.c \ $(PROJ_DIR)/Unit_tests/unitTests.c \ $(PROJ_DIR)/Unit_tests/test_utils.c \ $(PROJ_DIR)/Unit_tests/test_smartvalve.c \ $(PROJ_DIR)/Unit_tests/test_uart_interpreter.c \ $(PROJ_DIR)/Unit_tests/test_thread_network_utils.c \ $(PROJ_DIR)/Unit_tests/test_log.c \ # Include folders common to all targets INC_FOLDERS += \ ../config \ $(LIBRARIES_DIR)/components \ $(LIBRARIES_DIR)/components/ble/ble_advertising \ $(LIBRARIES_DIR)/components/ble/ble_dtm \ $(LIBRARIES_DIR)/components/ble/ble_link_ctx_manager \ $(LIBRARIES_DIR)/components/ble/ble_racp \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_ancs_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_ans_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_bas \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_bas_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_cscs \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_cts_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_dfu \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_dis \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_gls \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_hids \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_hrs \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_hrs_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_hts \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_ias \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_ias_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_lbs \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_lbs_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_lls \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_nus \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_nus_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_rscs \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_rscs_c \ $(LIBRARIES_DIR)/components/ble/ble_services/ble_tps \ $(LIBRARIES_DIR)/components/ble/common \ $(LIBRARIES_DIR)/components/ble/nrf_ble_gatt \ $(LIBRARIES_DIR)/components/ble/nrf_ble_gq \ $(LIBRARIES_DIR)/components/ble/nrf_ble_qwr \ $(LIBRARIES_DIR)/components/ble/peer_manager \ $(LIBRARIES_DIR)/components/boards \ $(LIBRARIES_DIR)/components/libraries/atomic \ $(LIBRARIES_DIR)/components/libraries/atomic_fifo \ $(LIBRARIES_DIR)/components/libraries/atomic_flags \ $(LIBRARIES_DIR)/components/libraries/balloc \ $(LIBRARIES_DIR)/components/libraries/bootloader \ $(LIBRARIES_DIR)/components/libraries/bootloader/ble_dfu \ $(LIBRARIES_DIR)/components/libraries/bsp \ $(LIBRARIES_DIR)/components/libraries/button \ $(LIBRARIES_DIR)/components/libraries/cli \ $(LIBRARIES_DIR)/components/libraries/crc16 \ $(LIBRARIES_DIR)/components/libraries/crc32 \ $(LIBRARIES_DIR)/components/libraries/crypto \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/cc310 \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/cc310_bl \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/cifra \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/mbedtls \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/micro_ecc \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/nrf_hw \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/nrf_sw \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/oberon \ $(LIBRARIES_DIR)/components/libraries/crypto/backend/optiga \ $(LIBRARIES_DIR)/components/libraries/csense \ $(LIBRARIES_DIR)/components/libraries/csense_drv \ $(LIBRARIES_DIR)/components/libraries/delay \ $(LIBRARIES_DIR)/components/libraries/ecc \ $(LIBRARIES_DIR)/components/libraries/experimental_section_vars \ $(LIBRARIES_DIR)/components/libraries/experimental_task_manager \ $(LIBRARIES_DIR)/components/libraries/fds \ $(LIBRARIES_DIR)/components/libraries/fifo \ $(LIBRARIES_DIR)/components/libraries/fstorage \ $(LIBRARIES_DIR)/components/libraries/gfx \ $(LIBRARIES_DIR)/components/libraries/gpiote \ $(LIBRARIES_DIR)/components/libraries/hardfault \ $(LIBRARIES_DIR)/components/libraries/hci \ $(LIBRARIES_DIR)/components/libraries/led_softblink \ $(LIBRARIES_DIR)/components/libraries/libuarte \ $(LIBRARIES_DIR)/components/libraries/log \ $(LIBRARIES_DIR)/components/libraries/log/src \ $(LIBRARIES_DIR)/components/libraries/low_power_pwm \ $(LIBRARIES_DIR)/components/libraries/mem_manager \ $(LIBRARIES_DIR)/components/libraries/memobj \ $(LIBRARIES_DIR)/components/libraries/mpu \ $(LIBRARIES_DIR)/components/libraries/mutex \ $(LIBRARIES_DIR)/components/libraries/pwm \ $(LIBRARIES_DIR)/components/libraries/pwr_mgmt \ $(LIBRARIES_DIR)/components/libraries/queue \ $(LIBRARIES_DIR)/components/libraries/ringbuf \ $(LIBRARIES_DIR)/components/libraries/scheduler \ $(LIBRARIES_DIR)/components/libraries/sdcard \ $(LIBRARIES_DIR)/components/libraries/serial \ $(LIBRARIES_DIR)/components/libraries/sha256 \ $(LIBRARIES_DIR)/components/libraries/slip \ $(LIBRARIES_DIR)/components/libraries/sortlist \ $(LIBRARIES_DIR)/components/libraries/spi_mngr \ $(LIBRARIES_DIR)/components/libraries/stack_guard \ $(LIBRARIES_DIR)/components/libraries/stack_info \ $(LIBRARIES_DIR)/components/libraries/strerror \ $(LIBRARIES_DIR)/components/libraries/svc \ $(LIBRARIES_DIR)/components/libraries/timer \ $(LIBRARIES_DIR)/components/libraries/twi_mngr \ $(LIBRARIES_DIR)/components/libraries/twi_sensor \ $(LIBRARIES_DIR)/components/libraries/uart \ $(LIBRARIES_DIR)/components/libraries/usbd \ $(LIBRARIES_DIR)/components/libraries/usbd/class/audio \ $(LIBRARIES_DIR)/components/libraries/usbd/class/cdc \ $(LIBRARIES_DIR)/components/libraries/usbd/class/cdc/acm \ $(LIBRARIES_DIR)/components/libraries/usbd/class/hid \ $(LIBRARIES_DIR)/components/libraries/usbd/class/hid/generic \ $(LIBRARIES_DIR)/components/libraries/usbd/class/hid/kbd \ $(LIBRARIES_DIR)/components/libraries/usbd/class/hid/mouse \ $(LIBRARIES_DIR)/components/libraries/usbd/class/msc \ $(LIBRARIES_DIR)/components/libraries/util \ $(LIBRARIES_DIR)/components/softdevice/common \ $(LIBRARIES_DIR)/components/softdevice/mbr/headers \ $(LIBRARIES_DIR)/components/softdevice/s140/headers \ $(LIBRARIES_DIR)/components/softdevice/s140/headers/nrf52 \ $(LIBRARIES_DIR)/components/thread/utils \ $(LIBRARIES_DIR)/components/toolchain/cmsis/include \ $(LIBRARIES_DIR)/external/fprintf \ $(LIBRARIES_DIR)/external/micro-ecc/micro-ecc \ $(LIBRARIES_DIR)/external/nrf_cc310/include \ $(LIBRARIES_DIR)/external/nrf_cc310_bl/include \ $(LIBRARIES_DIR)/external/nRF-IEEE-802.15.4-radio-driver/src \ $(LIBRARIES_DIR)/external/nRF-IEEE-802.15.4-radio-driver/src/fem \ $(LIBRARIES_DIR)/external/nRF-IEEE-802.15.4-radio-driver/src/fem/three_pin_gpio \ $(LIBRARIES_DIR)/external/nRF-IEEE-802.15.4-radio-driver/src/rsch/raal/softdevice \ $(LIBRARIES_DIR)/external/nrf_oberon \ $(LIBRARIES_DIR)/external/nrf_oberon/include \ $(LIBRARIES_DIR)/external/openthread/include \ $(LIBRARIES_DIR)/external/openthread/include/openthread \ $(LIBRARIES_DIR)/external/openthread/nrf_security/config \ $(LIBRARIES_DIR)/external/openthread/nrf_security/include \ $(LIBRARIES_DIR)/external/openthread/nrf_security/mbedtls_plat_config \ $(LIBRARIES_DIR)/external/openthread/nrf_security/nrf_cc310_plat/include \ $(LIBRARIES_DIR)/external/openthread/project/config \ $(LIBRARIES_DIR)/external/openthread/project/nrf52840 \ $(LIBRARIES_DIR)/external/openthread/project/openthread/third_party/NordicSemiconductor/drivers/power \ $(LIBRARIES_DIR)/external/openthread/project/openthread/third_party/NordicSemiconductor/nrfx/drivers/src \ $(LIBRARIES_DIR)/external/segger_rtt \ $(LIBRARIES_DIR)/external/utf_converter \ $(LIBRARIES_DIR)/integration/nrfx \ $(LIBRARIES_DIR)/integration/nrfx/legacy \ $(LIBRARIES_DIR)/modules/nrfx \ $(LIBRARIES_DIR)/modules/nrfx/drivers/include \ $(LIBRARIES_DIR)/modules/nrfx/hal \ $(LIBRARIES_DIR)/modules/nrfx/mdk \ $(SC_DIR) \ $(SC_DIR)/Thread \ $(SC_DIR)/Thread/Thread_ressources \ $(SC_DIR)/Thread/Process \ $(SC_DIR)/BLE \ $(SC_DIR)/Components/Flash \ $(SC_DIR)/UART \ $(SC_DIR)/Utils \ $(PROJ_DIR)/Unit_tests \ External_libs \ # Libraries common to all targets LIB_FILES += \ $(LIBRARIES_DIR)/external/openthread/lib/nrf52840/gcc/libopenthread-platform-utils.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedcrypto_glue.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedcrypto_glue_cc310.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedcrypto_glue_vanilla.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedcrypto_cc310_backend.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedcrypto_vanilla_backend.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedtls_base_vanilla.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedtls_tls_vanilla.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libmbedtls_x509_vanilla.a \ $(LIBRARIES_DIR)/external/openthread/nrf_security/lib/libnrf_cc310_platform_0.9.1.a \ $(LIBRARIES_DIR)/external/openthread/lib/nrf52840/gcc/libnordicsemi-nrf52840-radio-driver-softdevice.a \ $(LIBRARIES_DIR)/external/openthread/project/nrf52840/openthread_nrf52840/softdevice/uart/armgcc/libopenthread-nrf52840-softdevice-sdk.a \ $(LIBRARIES_DIR)/external/openthread/lib/nrf52840/gcc/libopenthread-cli-ftd.a \ $(LIBRARIES_DIR)/external/openthread/lib/nrf52840/gcc/libopenthread-ftd.a \ $(LIBRARIES_DIR)/external/nrf_oberon/lib/cortex-m4/hard-float/liboberon_3.0.3.a \ # Optimization flags OPT = -O3 -g3 # Uncomment the line below to enable link time optimization #OPT += -flto # C flags common to all targets CFLAGS += $(OPT) CFLAGS += -DAPP_TIMER_V2 CFLAGS += -DAPP_TIMER_V2_RTC1_ENABLED CFLAGS += -DAPP_UART_DRIVER_INSTANCE=1 CFLAGS += -DBOARD_PCA10056 CFLAGS += -DCONFIG_GPIO_AS_PINRESET CFLAGS += -DENABLE_FEM CFLAGS += -DFLOAT_ABI_HARD CFLAGS += -DINITIALIZE_USER_SECTIONS CFLAGS += -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" CFLAGS += -DMBEDTLS_USER_CONFIG_FILE=\"nrf52840-mbedtls-config.h\" CFLAGS += -DMULTIPROTOCOL_802154_CONFIG_PRESENT CFLAGS += -DNO_VTOR_CONFIG CFLAGS += -DNRF52840_XXAA CFLAGS += -DNRF_SD_BLE_API_VERSION=7 CFLAGS += -DOPENTHREAD_CONFIG_COAP_API_ENABLE CFLAGS += -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0 CFLAGS += -DOPENTHREAD_CONFIG_FILE=\"openthread-config-wrap.h\" CFLAGS += -DOPENTHREAD_FTD=1 CFLAGS += -DS140 CFLAGS += -DSOFTDEVICE_PRESENT CFLAGS += -DNRFX_CLOCK_CONFIG_LF_SRC=0 CFLAGS += -DCLOCK_CONFIG_LF_SRC=0 CFLAGS += -DNRF_SDH_CLOCK_LF_SRC=0 CFLAGS += -DNRF_SDH_CLOCK_LF_RC_CTIV=16 CFLAGS += -DNRF_SDH_CLOCK_LF_RC_TEMP_CTIV=2 CFLAGS += -DNRF_SDH_CLOCK_LF_ACCURACY=1 CFLAGS += -DUART1_ENABLED=1 CFLAGS += -DPOWER_ENABLED=1 CFLAGS += -mcpu=cortex-m4 CFLAGS += -mthumb -mabi=aapcs CFLAGS += -Wall -Werror CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 # keep every function in a separate section, this allows linker to discard unused ones CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing CFLAGS += -fno-builtin -fshort-enums # C++ flags common to all targets CXXFLAGS += $(OPT) # Assembler flags common to all targets ASMFLAGS += -g3 ASMFLAGS += -mcpu=cortex-m4 ASMFLAGS += -mthumb -mabi=aapcs ASMFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 ASMFLAGS += -DAPP_TIMER_V2 ASMFLAGS += -DAPP_TIMER_V2_RTC1_ENABLED ASMFLAGS += -DAPP_UART_DRIVER_INSTANCE=1 ASMFLAGS += -DBOARD_PCA10056 ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET ASMFLAGS += -DENABLE_FEM ASMFLAGS += -DFLOAT_ABI_HARD ASMFLAGS += -DINITIALIZE_USER_SECTIONS ASMFLAGS += -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" ASMFLAGS += -DMBEDTLS_USER_CONFIG_FILE=\"nrf52840-mbedtls-config.h\" ASMFLAGS += -DMULTIPROTOCOL_802154_CONFIG_PRESENT ASMFLAGS += -DNO_VTOR_CONFIG ASMFLAGS += -DNRF52840_XXAA ASMFLAGS += -DNRF_SD_BLE_API_VERSION=7 ASMFLAGS += -DOPENTHREAD_CONFIG_COAP_API_ENABLE ASMFLAGS += -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0 ASMFLAGS += -DOPENTHREAD_CONFIG_FILE=\"openthread-config-wrap.h\" ASMFLAGS += -DOPENTHREAD_FTD=1 ASMFLAGS += -DS140 ASMFLAGS += -DSOFTDEVICE_PRESENT ASMFLAGS += -DNRFX_CLOCK_CONFIG_LF_SRC=0 ASMFLAGS += -DCLOCK_CONFIG_LF_SRC=0 ASMFLAGS += -DNRF_SDH_CLOCK_LF_SRC=0 ASMFLAGS += -DNRF_SDH_CLOCK_LF_RC_CTIV=16 ASMFLAGS += -DNRF_SDH_CLOCK_LF_RC_TEMP_CTIV=2 ASMFLAGS += -DNRF_SDH_CLOCK_LF_ACCURACY=1 ASMFLAGS += -DUART1_ENABLED=1 ASMFLAGS += -DPOWER_ENABLED=1 # Linker flags LDFLAGS += $(OPT) LDFLAGS += -mthumb -mabi=aapcs -L$(LIBRARIES_DIR)/modules/nrfx/mdk -T$(LINKER_SCRIPT) LDFLAGS += -mcpu=cortex-m4 LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 # let linker dump unused sections LDFLAGS += -Wl,--gc-sections # use newlib in nano version LDFLAGS += --specs=nano.specs nrf52840_xxaa: CFLAGS += -D__HEAP_SIZE=1024 nrf52840_xxaa: CFLAGS += -D__STACK_SIZE=8192 nrf52840_xxaa: ASMFLAGS += -D__HEAP_SIZE=1024 nrf52840_xxaa: ASMFLAGS += -D__STACK_SIZE=8192 # Add standard libraries at the very end of the linker input, after all objects # that may need symbols provided by these libraries. LIB_FILES += -lc -lnosys -lm -lstdc++ .PHONY: default help # Default target - first one defined default: nrf52840_xxaa # Print all targets that can be built help: @echo following targets are available: @echo nrf52840_xxaa @echo flash_softdevice @echo sdk_config - starting external tool for editing sdk_config.h @echo flash - flashing binary TEMPLATE_PATH := $(LIBRARIES_DIR)/components/toolchain/gcc include $(TEMPLATE_PATH)/Makefile.common $(foreach target, $(TARGETS), $(call define_target, $(target))) .PHONY: flash flash_softdevice erase # Flash the program flash: default @echo Flashing: $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex nrfjprog -f nrf52 --program $(OUTPUT_DIRECTORY)/nrf52840_xxaa.hex --sectorerase nrfjprog -f nrf52 --reset # Flash softdevice flash_softdevice: @echo Flashing: s140_nrf52_7.0.1_softdevice.hex nrfjprog -f nrf52 --program $(LIBRARIES_DIR)/components/softdevice/s140/hex/s140_nrf52_7.2.0_softdevice.hex --sectorerase nrfjprog -f nrf52 --reset erase: nrfjprog -f nrf52 --eraseall SDK_CONFIG_FILE := ../config/sdk_config.h CMSIS_CONFIG_TOOL := $(LIBRARIES_DIR)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar sdk_config: java -jar $(CMSIS_CONFIG_TOOL) $(SDK_CONFIG_FILE)
And here is the error I get:
C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc>make -C C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc Assembling file: gcc_startup_nrf52840.S make: Entering directory `/c/DocTA/Soft/ble-thread/BT840/Embedded/Application/Project/armgcc' Compiling file: nrf_log_backend_rtt.c Compiling file: nrf_log_backend_serial.c Compiling file: nrf_log_default_backends.c Compiling file: nrf_log_frontend.c Compiling file: nrf_log_str_formatter.c Compiling file: app_button.c Compiling file: app_error.c Compiling file: app_error_handler_gcc.c Compiling file: app_error_weak.c Compiling file: app_fifo.c Compiling file: app_scheduler.c Compiling file: app_timer2.c Compiling file: app_uart_fifo.c Compiling file: app_util_platform.c Compiling file: assert.c Compiling file: drv_rtc.c Compiling file: hardfault_implementation.c Compiling file: mem_manager.c Compiling file: nrf_assert.c Compiling file: nrf_atfifo.c Compiling file: nrf_atflags.c Compiling file: nrf_atomic.c Compiling file: nrf_balloc.c Compiling file: nrf_fprintf.c Compiling file: nrf_fprintf_format.c Compiling file: nrf_memobj.c Compiling file: nrf_pwr_mgmt.c Compiling file: nrf_ringbuf.c Compiling file: nrf_section_iter.c Compiling file: nrf_sortlist.c Compiling file: nrf_strerror.c Compiling file: retarget.c Compiling file: nrf_serial.c Compiling file: nrf_queue.c Compiling file: nrf_fstorage.c Compiling file: nrf_fstorage_sd.c Compiling file: fds.c Compiling file: ecc.c Compiling file: crc16.c Compiling file: nrf_libuarte_async.c Compiling file: nrf_libuarte_drv.c Linking target: _build/nrf52840_xxaa.out c:/program files (x86)/gnu tools arm embedded/7 2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: _build/nrf52840_xxaa.out section `.fini' will not fit in region `UNPLACED_SECTIONS' c:/program files (x86)/gnu tools arm embedded/7 2018-q2-update/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: region `UNPLACED_SECTIONS' overflowed by 5 bytes _build/nrf52840_xxaa/nrf_log_backend_rtt.c.o: In function `serial_tx': C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc/../../../Libraries/components/libraries/log/src/nrf_log_backend_rtt.c:68: undefined reference to `SEGGER_RTT_WriteNoLock' _build/nrf52840_xxaa/nrf_fstorage_sd.c.o: In function `nrf_fstorage_sys_evt_handler': C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc/../../../Libraries/components/libraries/fstorage/nrf_fstorage_sd.c:577: undefined reference to `nrf_sdh_request_continue' C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc/../../../Libraries/components/libraries/fstorage/nrf_fstorage_sd.c:577: undefined reference to `nrf_sdh_request_continue' C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc/../../../Libraries/components/libraries/fstorage/nrf_fstorage_sd.c:577: undefined reference to `nrf_sdh_request_continue' collect2.exe: error: ld returned 1 exit status make: *** [_build/nrf52840_xxaa.out] Error 1 make: Leaving directory `/c/DocTA/Soft/ble-thread/BT840/Embedded/Application/Project/armgcc' C:\DocTA\Soft\ble-thread\BT840\Embedded\Application\Project\armgcc>
Here is my .ld file:
BT840.ld
Do you have an idea why I have this error ?
Thank you