Hello everyone
I'm developing a software which should use the latest OpenThread version and if possible in the form of prebuilt libraries. I followed the tipps and instructions of the Nordic Infocenter related to "nRF-SDK for Thread and ZigBee 4.1.0", they are a little outdated, but i think the steps should still apply. Building the software works fine until the linker jumps in, then i get these error messages:
arm-none-eabi-gcc -O3 -g3 -mthumb -mabi=aapcs -Lnrf52840/ -T./nrf52840/nrf52840.ld -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections build/gcc_startup_nrf52840.S.o build/boards.c.o build/nrf_log_backend_rtt.c.o build/nrf_log_backend_serial.c.o build/nrf_log_default_backends.c.o build/nrf_log_frontend.c.o build/nrf_log_str_formatter.c.o build/app_error.c.o build/app_error_handler_gcc.c.o build/app_error_weak.c.o build/app_scheduler.c.o build/app_timer2.c.o build/app_util_platform.c.o build/assert.c.o build/drv_rtc.c.o build/mem_manager.c.o build/nrf_assert.c.o build/nrf_atfifo.c.o build/nrf_atomic.c.o build/nrf_balloc.c.o build/nrf_fprintf.c.o build/nrf_fprintf_format.c.o build/nrf_memobj.c.o build/nrf_pwr_mgmt.c.o build/nrf_ringbuf.c.o build/nrf_section_iter.c.o build/nrf_sortlist.c.o build/nrf_strerror.c.o build/nrf_drv_clock.c.o build/nrf_nvic.c.o build/nrf_nvmc.c.o build/nrf_soc.c.o build/nrfx_atomic.c.o build/nrfx_clock.c.o build/nrfx_gpiote.c.o build/cJSON.c.o build/cJSON_iot_hooks.c.o build/SEGGER_RTT.c.o build/SEGGER_RTT_Syscalls_GCC.c.o build/SEGGER_RTT_printf.c.o build/system_nrf52840.c.o build/coap.c.o build/energy_scan.c.o build/thread.c.o build/dig_manipulation.c.o build/nrf_util.c.o build/app.c.o build/main.c.o ./third_party/openthread/output/nrf52840/lib/libopenthread-mtd.a ./third_party/openthread/output/nrf52840/lib/libopenthread-cli-mtd.a ./third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a ./third_party/openthread/output/nrf52840/lib/libopenthread-platform-utils.a ./third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-sdk.a ./third_party/openthread/output/nrf52840/lib/libnordicsemi-nrf52840-sdk.a ./third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a ./third_party/openthread/output/nrf52840/lib/libnordicsemi-nrf52840-radio-driver.a ./third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a ./third_party/openthread/output/nrf52840/lib/libopenthread-platform-utils.a ./third_party/openthread/output/nrf52840/lib/libopenthread-cli-mtd.a ./third_party/openthread/output/nrf52840/lib/libopenthread-mtd.a -lc -lnosys -lm -lstdc++ -lgcc -Wl,-Map=./output/nrf52840_xxaa_sed.map -o ./output/nrf52840_xxaa_sed /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `ssl_calc_finished_tls_sha384': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3249: undefined reference to `mbedtls_sha512_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3253: undefined reference to `mbedtls_sha512_clone' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3266: undefined reference to `mbedtls_sha512_finish_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3267: undefined reference to `mbedtls_sha512_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `ssl_calc_verify_tls_sha384': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:1840: undefined reference to `mbedtls_sha512_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:1844: undefined reference to `mbedtls_sha512_clone' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:1845: undefined reference to `mbedtls_sha512_finish_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:1852: undefined reference to `mbedtls_sha512_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `ssl_update_checksum_sha384': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:2979: undefined reference to `mbedtls_sha512_update_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `ssl_update_checksum_start': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:2943: undefined reference to `mbedtls_sha512_update_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `mbedtls_ssl_reset_checksum': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:2917: undefined reference to `mbedtls_sha512_starts_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `mbedtls_ssl_handshake_free': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:5885: undefined reference to `mbedtls_sha512_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a(ssl_tls.c.obj): in function `ssl_handshake_params_init': /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3598: undefined reference to `mbedtls_sha512_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/ssl_tls.c:3599: undefined reference to `mbedtls_sha512_starts_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher.c.obj): in function `mbedtls_cipher_set_iv': /home/map5/repo/ncs/mbedtls/library/cipher.c:415: undefined reference to `mbedtls_chacha20_starts' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher.c.obj): in function `mbedtls_cipher_update': /home/map5/repo/ncs/mbedtls/library/cipher.c:564: undefined reference to `mbedtls_chachapoly_update' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher.c.obj): in function `mbedtls_cipher_auth_encrypt': /home/map5/repo/ncs/mbedtls/library/cipher.c:1359: undefined reference to `mbedtls_ccm_encrypt_and_tag' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/cipher.c:1375: undefined reference to `mbedtls_chachapoly_encrypt_and_tag' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher.c.obj): in function `mbedtls_cipher_auth_decrypt': /home/map5/repo/ncs/mbedtls/library/cipher.c:1472: undefined reference to `mbedtls_ccm_auth_decrypt' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/cipher.c:1495: undefined reference to `mbedtls_chachapoly_auth_decrypt' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chachapoly_ctx_free': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:2016: undefined reference to `mbedtls_chachapoly_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chachapoly_ctx_alloc': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:2009: undefined reference to `mbedtls_chachapoly_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chachapoly_setkey_wrap': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:1995: undefined reference to `mbedtls_chachapoly_setkey' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chacha20_ctx_free': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:1944: undefined reference to `mbedtls_chacha20_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chacha20_ctx_alloc': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:1937: undefined reference to `mbedtls_chacha20_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chacha20_setkey_wrap': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:1910: undefined reference to `mbedtls_chacha20_setkey' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `chacha20_stream_wrap': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:1922: undefined reference to `mbedtls_chacha20_update' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `ccm_ctx_free': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:126: undefined reference to `mbedtls_ccm_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `ccm_ctx_alloc': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:119: undefined reference to `mbedtls_ccm_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(cipher_wrap.c.obj): in function `ccm_aes_setkey_wrap': /home/map5/repo/ncs/mbedtls/library/cipher_wrap.c:593: undefined reference to `mbedtls_ccm_setkey' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(entropy.c.obj): in function `entropy_update': /home/map5/repo/ncs/mbedtls/library/entropy.c:196: undefined reference to `mbedtls_sha256_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(entropy.c.obj): in function `mbedtls_entropy_init': /home/map5/repo/ncs/mbedtls/library/entropy.c:121: undefined reference to `mbedtls_hardware_poll' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(entropy.c.obj): in function `mbedtls_entropy_func': /home/map5/repo/ncs/mbedtls/library/entropy.c:428: undefined reference to `mbedtls_sha256_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_free': /home/map5/repo/ncs/mbedtls/library/md.c:307: undefined reference to `mbedtls_sha1_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:321: undefined reference to `mbedtls_sha512_free' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_setup': /home/map5/repo/ncs/mbedtls/library/md.c:444: undefined reference to `mbedtls_sha1_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:458: undefined reference to `mbedtls_sha512_init' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_starts': /home/map5/repo/ncs/mbedtls/library/md.c:506: undefined reference to `mbedtls_sha1_starts_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:520: undefined reference to `mbedtls_sha512_starts_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_update': /home/map5/repo/ncs/mbedtls/library/md.c:552: undefined reference to `mbedtls_sha1_update_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:564: undefined reference to `mbedtls_sha512_update_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_finish': /home/map5/repo/ncs/mbedtls/library/md.c:596: undefined reference to `mbedtls_sha1_finish_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:608: undefined reference to `mbedtls_sha512_finish_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md': /home/map5/repo/ncs/mbedtls/library/md.c:641: undefined reference to `mbedtls_sha1_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:647: undefined reference to `mbedtls_sha256_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:655: undefined reference to `mbedtls_sha512_ret' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: ./third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a(md.c.obj): in function `mbedtls_md_process': /home/map5/repo/ncs/mbedtls/library/md.c:851: undefined reference to `mbedtls_internal_sha1_process' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /home/map5/repo/ncs/mbedtls/library/md.c:863: undefined reference to `mbedtls_internal_sha512_process' collect2: error: ld returned 1 exit status make: *** [Makefile:382: build] Fehler 1 "make all" terminated with exit code 2. Build might be incomplete.
Here are some parts of my makefile (It's my first time writing a makefile, so please be gracious ;)):
.............................................. # Nordic files NORDIC_SRC_FILES += \ $(NORDIC_ROOT)/modules/nrfx/mdk/gcc_startup_nrf52840.S \ $(NORDIC_ROOT)/components/boards/boards.c \ $(NORDIC_ROOT)/components/libraries/log/src/nrf_log_backend_rtt.c \ $(NORDIC_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \ $(NORDIC_ROOT)/components/libraries/log/src/nrf_log_default_backends.c \ $(NORDIC_ROOT)/components/libraries/log/src/nrf_log_frontend.c \ $(NORDIC_ROOT)/components/libraries/log/src/nrf_log_str_formatter.c \ $(NORDIC_ROOT)/components/libraries/util/app_error.c \ $(NORDIC_ROOT)/components/libraries/util/app_error_handler_gcc.c \ $(NORDIC_ROOT)/components/libraries/util/app_error_weak.c \ $(NORDIC_ROOT)/components/libraries/scheduler/app_scheduler.c \ $(NORDIC_ROOT)/components/libraries/timer/app_timer2.c \ $(NORDIC_ROOT)/components/libraries/util/app_util_platform.c \ $(NORDIC_ROOT)/components/libraries/assert/assert.c \ $(NORDIC_ROOT)/components/libraries/timer/drv_rtc.c \ $(NORDIC_ROOT)/components/libraries/mem_manager/mem_manager.c \ $(NORDIC_ROOT)/components/libraries/util/nrf_assert.c \ $(NORDIC_ROOT)/components/libraries/atomic_fifo/nrf_atfifo.c \ $(NORDIC_ROOT)/components/libraries/atomic/nrf_atomic.c \ $(NORDIC_ROOT)/components/libraries/balloc/nrf_balloc.c \ $(NORDIC_ROOT)/external/fprintf/nrf_fprintf.c \ $(NORDIC_ROOT)/external/fprintf/nrf_fprintf_format.c \ $(NORDIC_ROOT)/components/libraries/memobj/nrf_memobj.c \ $(NORDIC_ROOT)/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c \ $(NORDIC_ROOT)/components/libraries/ringbuf/nrf_ringbuf.c \ $(NORDIC_ROOT)/components/libraries/experimental_section_vars/nrf_section_iter.c \ $(NORDIC_ROOT)/components/libraries/sortlist/nrf_sortlist.c \ $(NORDIC_ROOT)/components/libraries/strerror/nrf_strerror.c \ $(NORDIC_ROOT)/integration/nrfx/legacy/nrf_drv_clock.c \ $(NORDIC_ROOT)/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c \ $(NORDIC_ROOT)/modules/nrfx/hal/nrf_nvmc.c \ $(NORDIC_ROOT)/components/drivers_nrf/nrf_soc_nosd/nrf_soc.c \ $(NORDIC_ROOT)/modules/nrfx/soc/nrfx_atomic.c \ $(NORDIC_ROOT)/modules/nrfx/drivers/src/nrfx_clock.c \ $(NORDIC_ROOT)/modules/nrfx/drivers/src/nrfx_gpiote.c \ $(NORDIC_ROOT)/external/cJSON/cJSON.c \ $(NORDIC_ROOT)/external/cJSON/cJSON_iot_hooks.c \ $(NORDIC_ROOT)/external/segger_rtt/SEGGER_RTT.c \ $(NORDIC_ROOT)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \ $(NORDIC_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \ $(NORDIC_ROOT)/modules/nrfx/mdk/system_nrf52840.c \ NORDIC_HEADER_FILES += \ -I$(NORDIC_ROOT)/components \ -I$(NORDIC_ROOT)/external/nRF-IEEE-802.15.4-radio-driver/src/fem \ -I$(NORDIC_ROOT)/modules/nrfx/mdk \ -I$(NORDIC_ROOT)/components/libraries/scheduler \ -I$(NORDIC_ROOT)/components/libraries/pwr_mgmt \ -I$(NORDIC_ROOT)/external/nRF-IEEE-802.15.4-radio-driver/src/fem/three_pin_gpio \ -I$(NORDIC_ROOT)/components/boards \ -I$(NORDIC_ROOT)/components/libraries/strerror \ -I$(NORDIC_ROOT)/components/toolchain/cmsis/include \ -I$(NORDIC_ROOT)/components/libraries/timer \ -I$(NORDIC_ROOT)/components/libraries/util \ -I$(NORDIC_ROOT)/config/nrf52840/config \ -I$(NORDIC_ROOT)/components/libraries/balloc \ -I$(NORDIC_ROOT)/components/libraries/mem_manager \ -I$(NORDIC_ROOT)/components/libraries/ringbuf \ -I$(NORDIC_ROOT)/external/openthread/project/config \ -I$(NORDIC_ROOT)/components/libraries/log \ -I$(NORDIC_ROOT)/modules/nrfx \ -I$(NORDIC_ROOT)/components/libraries/experimental_section_vars \ -I$(NORDIC_ROOT)/integration/nrfx/legacy \ -I$(NORDIC_ROOT)/components/libraries/mutex \ -I$(NORDIC_ROOT)/components/libraries/delay \ -I$(NORDIC_ROOT)/external/cJSON \ -I$(NORDIC_ROOT)/external/segger_rtt \ -I$(NORDIC_ROOT)/config/nrf52840/config \ -I$(NORDIC_ROOT)/components/libraries/atomic_fifo \ -I$(NORDIC_ROOT)/components/drivers_nrf/nrf_soc_nosd \ -I$(NORDIC_ROOT)/components/libraries/atomic \ -I$(NORDIC_ROOT)/components/libraries/sortlist \ -I$(NORDIC_ROOT)/components/libraries/memobj \ -I$(NORDIC_ROOT)/integration/nrfx \ -I$(NORDIC_ROOT)/external/openthread/project/nrf52840 \ -I$(NORDIC_ROOT)/modules/nrfx/drivers/include \ -I$(NORDIC_ROOT)/modules/nrfx/hal \ -I$(NORDIC_ROOT)/external/fprintf \ -I$(NORDIC_ROOT)/components/libraries/log/src \ -I$(PROJ_DIR)/include \ -I$(PROJ_DIR)/include/config \ -I$(LIB_OT_ROOT) \ # OpenThread header files OT_HEADER_FILES += \ $(PROJ_DIR)/include/openthread/cli.h \ $(PROJ_DIR)/include/openthread/coap.h \ $(PROJ_DIR)/include/openthread/dataset_ftd.h \ $(PROJ_DIR)/include/openthread/dataset.h \ $(PROJ_DIR)/include/openthread/diag.h \ $(PROJ_DIR)/include/openthread/dns.h \ $(PROJ_DIR)/include/openthread/error.h \ $(PROJ_DIR)/include/openthread/heap.h \ $(PROJ_DIR)/include/openthread/icmp6.h \ $(PROJ_DIR)/include/openthread/instance.h \ $(PROJ_DIR)/include/openthread/ip6.h \ $(PROJ_DIR)/include/openthread/jam_detection.h \ $(PROJ_DIR)/include/openthread/joiner.h \ $(PROJ_DIR)/include/openthread/link_raw.h \ $(PROJ_DIR)/include/openthread/link.h \ $(PROJ_DIR)/include/openthread/logging.h \ $(PROJ_DIR)/include/openthread/message.h \ $(PROJ_DIR)/include/openthread/netdata.h \ $(PROJ_DIR)/include/openthread/netdiag.h \ $(PROJ_DIR)/include/openthread/network_time.h \ $(PROJ_DIR)/include/openthread/random_noncrypto.h \ $(PROJ_DIR)/include/openthread/server.h \ $(PROJ_DIR)/include/openthread/sntp.h \ $(PROJ_DIR)/include/openthread/tasklet.h \ $(PROJ_DIR)/include/openthread/thread_ftd.h \ $(PROJ_DIR)/include/openthread/thread.h \ $(PROJ_DIR)/include/openthread/udp.h \ $(PROJ_DIR)/include/openthread/platform/alarm-micro.h \ $(PROJ_DIR)/include/openthread/platform/alarm-milli.h \ $(PROJ_DIR)/include/openthread/platform/diag.h \ $(PROJ_DIR)/include/openthread/platform/flash.h \ $(PROJ_DIR)/include/openthread/platform/logging.h \ $(PROJ_DIR)/include/openthread/platform/messagepool.h \ $(PROJ_DIR)/include/openthread/platform/memory.h \ $(PROJ_DIR)/include/openthread/platform/misc.h \ $(PROJ_DIR)/include/openthread/platform/otns.h \ $(PROJ_DIR)/include/openthread/platform/platform-fem.h \ $(PROJ_DIR)/include/openthread/platform/platform-config.h \ $(PROJ_DIR)/include/openthread/platform/radio.h \ $(PROJ_DIR)/include/openthread/platform/settings.h \ $(PROJ_DIR)/include/openthread/platform/spi-slave.h \ $(PROJ_DIR)/include/openthread/platform/time.h \ $(PROJ_DIR)/include/openthread/platform/uart.h \ MBEDTLS_HEADER_FILES += -I$(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_platform_config MBEDTLS_HEADER_FILES += -I$(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/include MBEDTLS_HEADER_FILES += -I$(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/config MBEDTLS_HEADER_FILES += -I$(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_platform/include ifeq ($(ROUTER),1) LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-ftd.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-cli-ftd.a else LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-mtd.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-cli-mtd.a endif LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-platform-utils.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-sdk.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libnordicsemi-nrf52840-sdk.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libnordicsemi-nrf52840-radio-driver.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-nrf52840-transport.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-platform-utils.a ifeq ($(ROUTER),1) LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-cli-ftd.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-ftd.a else LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-cli-mtd.a LIB_FILES += $(PROJ_DIR)/third_party/openthread/output/nrf52840/lib/libopenthread-mtd.a endif # 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++ -lgcc ### Options # Optimize for size OPT += -Os # Include debugging symbols OPT += -g ### C-Compiler flags # ISO C-Standard 99 CFLAGS += -std=c99 # Adds a phony target for each dependency other than the main file, causing each to depend on nothing. # Works around errors 'make' gives if you remove header files without updating the Makefile to match. #CFLAGS += -MP # Compile or assemble the source files but do not link #PRE_CFLAGS += -c # Output #PRE_CFLAGS += -o CFLAGS += $(OPT) CFLAGS += -DAPP_TIMER_V2 CFLAGS += -DAPP_TIMER_V2_RTC1_ENABLED CFLAGS += -DBOARD_PCA10056 CFLAGS += -DCONFIG_GPIO_AS_PINRESET CFLAGS += -DENABLE_FEM CFLAGS += -DFLOAT_ABI_HARD CFLAGS += -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" CFLAGS += -DMBEDTLS_USER_CONFIG_FILE=\"nrf52840-mbedtls-config.h\" CFLAGS += -DNRF52840_XXAA CFLAGS += -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_SRP_CLIENT_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_SRP_SERVER_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0 CFLAGS += -DOPENTHREAD_CONFIG_DISABLE_BUILTIN_MBEDTLS=1 CFLAGS += -DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=0 CFLAGS += -DOPENTHREAD_CONFIG_FILE=\"openthread-config-wrap.h\" CFLAGS += -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='"openthread-core-nrf52840-config.h"' CFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='"openthread-core-nrf52840-config-check.h"' ifeq ($(ROUTER),1) CFLAGS += -DOPENTHREAD_FTD=1 CFLAGS += -DOPENTHREAD_MTD=0 else CFLAGS += -DOPENTHREAD_MTD=1 CFLAGS += -DOPENTHREAD_FTD=0 endif CFLAGS += -DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG CFLAGS += -DOPENTHREAD_CONFIG_LOG_API=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_ARP=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_CLI=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_COAP=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_ICMP=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_IP6=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_MAC=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_MEM=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_MLE=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_NETDATA=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_NETDIAG=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_PKT_DUMP=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_PLATFORM=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1 CFLAGS += -DOPENTHREAD_CONFIG_LOG_PREPEND_REGION=1 CFLAGS += -DUART0_ENABLED=0 # CPU architecture CFLAGS += -mcpu=cortex-m4 # Generate code that executes in Thumb state CFLAGS += -mthumb # Generate code for ARM Architecture Procedure Call Standard Application (AAPCS) Binary Interface (ABI) CFLAGS += -mabi=aapcs # Enable warnings about questionable constructions CFLAGS += -Wall # Make all warnings into hard errors CFLAGS += -Werror # Define "Unused function" errors as warnings CFLAGS += -Wno-error=unused-function # Allows generation of floating-point instructions and uses FPU.specific calling conventions CFLAGS += -mfloat-abi=hard # Specifies what floating-point hardware is available on the target CFLAGS += -mfpu=fpv4-sp-d16 # Place each function and data item into its own section in the output file CFLAGS += -ffunction-sections CFLAGS += -fdata-sections CFLAGS += -fno-strict-aliasing CFLAGS += -fno-builtin CFLAGS += -fshort-enums CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -D__STACK_SIZE=8192 ### Linker flags LDFLAGS += $(OPT) # Print names of input files LDFLAGS += --trace LDFLAGS += -mthumb LDFLAGS += -mabi=aapcs LDFLAGS += -Lnrf52840/ # Define linker script to use LDFLAGS += -T$(LINKER_SCRIPT) LDFLAGS += -mcpu=cortex-m4 LDFLAGS += -mfloat-abi=hard LDFLAGS += -mfpu=fpv4-sp-d16 LDFLAGS += -Wl,--gc-sections LDFLAGS += --specs=nano.specs # Define that the following terms are targets .PHONY: all test build outdir clean flash # Define object files _OBJ += $(addsuffix .o,$(NORDIC_SRC_FILES)) _OBJ += $(addsuffix .o,$(APP_SRC_FILES)) OBJ = $(notdir $(_OBJ)) all: outdir build hex SRC_FILES += $(APP_SRC_FILES) SRC_FILES += $(NORDIC_SRC_FILES) $(BUILD_DIRECTORY)/%.S.o: $(CC) $(CFLAGS) $(NORDIC_HEADER_FILES) $(MBEDTLS_HEADER_FILES) $(shell find $(SRC_FILES) -name $(notdir $*).S) -c -o $@ $(BUILD_DIRECTORY)/%.c.o: $(CC) $(CFLAGS) $(NORDIC_HEADER_FILES) $(MBEDTLS_HEADER_FILES) $(shell find $(SRC_FILES) -name $(notdir $*).c) -c -o $@ ifeq ($(ROUTER),1) build: $(addprefix $(BUILD_DIRECTORY)/,$(OBJ)) $(CC) -O3 -g3 -mthumb -mabi=aapcs -Lnrf52840/ -T$(LINKER_SCRIPT) -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections $^ $(LIB_FILES) -Wl,-Map=$(OUTPUT_DIRECTORY)/nrf52840_xxaa_router.map -o $(OUTPUT_DIRECTORY)/nrf52840_xxaa_router else build: $(addprefix $(BUILD_DIRECTORY)/,$(OBJ)) $(CC) -O3 -g3 -mthumb -mabi=aapcs -Lnrf52840/ -T$(LINKER_SCRIPT) -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections $^ $(LIB_FILES) -Wl,-Map=$(OUTPUT_DIRECTORY)/nrf52840_xxaa_sed.map -o $(OUTPUT_DIRECTORY)/nrf52840_xxaa_sed endif
I've built the OpenThread libraries with the following command:
make -f examples/Makefile-nrf52840 BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 \
DISABLE_BUILTIN_MBEDTLS=1 DNS_CLIENT=1 DIAGNOSTIC=1 \
JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 \
SERVICE=1 UDP_FORWARD=1 ECDSA=1 SNTP_CLIENT=1 COAPS=1 \
DHCP6_SERVER=1 DHCP6_CLIENT=1 COAP_BLOCK=1 COAP_OBSERVE=1 \
COAPS=1 SRP_CLIENT=1 SRP_SERVER=1 FULL_LOGS=1
Also, because the linker is reporting the error, here is the linker script (I've copied it from the OpenThread repo):
/* Linker script to configure memory regions. */
SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)
MEMORY
{
FLASH (rx) : ORIGIN = 0x0, LENGTH = 0xfc000
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000
ot_flash_data (r) : ORIGIN = 0xfc000, LENGTH = 0x4000
}
SECTIONS
{
. = ALIGN(4);
.ot_flash_data :
{
PROVIDE(__start_ot_flash_data = ORIGIN(ot_flash_data));
KEEP(*(SORT(.ot_flash_data*)))
PROVIDE(__stop_ot_flash_data = ORIGIN(ot_flash_data) + LENGTH(ot_flash_data));
} > ot_flash_data
}
SECTIONS
{
. = ALIGN(4);
.mem_section_dummy_ram :
{
}
.log_dynamic_data :
{
PROVIDE(__start_log_dynamic_data = .);
KEEP(*(SORT(.log_dynamic_data*)))
PROVIDE(__stop_log_dynamic_data = .);
} > RAM
.log_filter_data :
{
PROVIDE(__start_log_filter_data = .);
KEEP(*(SORT(.log_filter_data*)))
PROVIDE(__stop_log_filter_data = .);
} > RAM
} INSERT AFTER .data;
SECTIONS
{
.mem_section_dummy_rom :
{
}
.pwr_mgmt_data :
{
PROVIDE(__start_pwr_mgmt_data = .);
KEEP(*(SORT(.pwr_mgmt_data*)))
PROVIDE(__stop_pwr_mgmt_data = .);
} > FLASH
.log_const_data :
{
PROVIDE(__start_log_const_data = .);
KEEP(*(SORT(.log_const_data*)))
PROVIDE(__stop_log_const_data = .);
} > FLASH
.log_backends :
{
PROVIDE(__start_log_backends = .);
KEEP(*(SORT(.log_backends*)))
PROVIDE(__stop_log_backends = .);
} > FLASH
.nrf_balloc :
{
PROVIDE(__start_nrf_balloc = .);
KEEP(*(.nrf_balloc))
PROVIDE(__stop_nrf_balloc = .);
} > FLASH
} INSERT AFTER .text
ASSERT(__start_ot_flash_data > __etext, "Section ot_flash_data overlaps text section")
INCLUDE "nrf_common.ld"
The software is for a nRF52840, my OS is Ubuntu 20.04.2 LTS.
Here the tools with version:
arm-none-eabi-gcc (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
GNU Make 4.2.1 Built for x86_64-pc-linux-gnu
arm-none-eabi-ld GNU ld (GNU Arm Embedded Toolchain 9-2020-q2-update) 2.34.0.20200428
Thanks in advance for responding.