Fail to build firmware-nordic-thingy53

Hi, I’m currently working on building the firmware code for thingy53 using nRF Connect v2.6.1 in VSCode (GitHub - edgeimpulse/firmware-nordic-thingy53: Official Edge Impulse firmware for Nordic Semiconductor Thingy:53).
I’m encountering the following error message:
“collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.”

[1041/1058] Linking CXX executable zephyr\zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/build/zephyr/zephyr_pre0.map
cmd.exe /C “cd . && D:\ncs\toolchains\cf2149caf2\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-g++.exe -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf && cmd.exe /C “cd /D D:\Edge_AI\Nordic_thingy53\firmware-nordic-thingy53-main\build\zephyr && D:\ncs\toolchains\cf2149caf2\opt\bin\cmake.exe -E true””
d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_inertial_sensor.cpp.obj): in function `ei_fusion_acc_read_data(int)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_inertial_sensor.cpp:105: undefined reference to `__device_dts_ord_147’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_inertial_sensor.cpp.obj): in function `ei_acc_init()':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_inertial_sensor.cpp:57: undefined reference to `__device_dts_ord_147’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_light_sensor.cpp.obj): in function `sensor_channel_get.constprop.0’:

D:/ncs/v2.6.1/zephyr/include/zephyr/drivers/sensor.h:863: undefined reference to `__device_dts_ord_136’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_light_sensor.cpp.obj): in function `ei_fusion_light_read_data(int)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_light_sensor.cpp:91: undefined reference to `__device_dts_ord_136’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_light_sensor.cpp.obj): in function `ei_lightsensor_init()':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_light_sensor.cpp:47: undefined reference to `__device_dts_ord_136’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_mag_sensor.cpp.obj): in function `ei_fusion_mag_read_data(int)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_mag_sensor.cpp:107: undefined reference to `__device_dts_ord_138’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_mag_sensor.cpp.obj): in function `ei_mag_init()':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_mag_sensor.cpp:58: undefined reference to `__device_dts_ord_138’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj): in function `inference_samples_callback(nrfx_pdm_evt_t const*)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:564: undefined reference to `nrfx_pdm_buffer_set’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj): in function `setup_nrf_pdm(void ()(nrfx_pdm_evt_t const))':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:658: undefined reference to `nrfx_pdm_init’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj): in function `ingestion_samples_callback(nrfx_pdm_evt_t const*)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:199: undefined reference to `nrfx_pdm_buffer_set’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj): in function `ei_microphone_sample_start()':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:307: undefined reference to `nrfx_pdm_uninit’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:316: undefined reference to `nrfx_pdm_start’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:381: undefined reference to `nrfx_pdm_stop’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj): in function `ei_microphone_inference_start(unsigned int, float)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:604: undefined reference to `nrfx_pdm_uninit’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/sensors/ei_microphone.cpp:609: undefined reference to `nrfx_pdm_start’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_microphone.cpp.obj):(.intList+0x8): undefined reference to `nrfx_pdm_irq_handler’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_device_thingy53.cpp.obj): in function `EiDeviceThingy53::set_state(EiState)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:305: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:306: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:307: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_device_thingy53.cpp.obj): in function `EiDeviceThingy53::EiDeviceThingy53(EiDeviceMemory*)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:196: undefined reference to `dk_leds_init’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_device_thingy53.cpp.obj): in function `led_work_handler(k_work*)':

D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:66: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:97: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:87: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:88: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:94: undefined reference to `dk_set_led’

d:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/…/lib/gcc/arm-zephyr-eabi/12.2.0/…/…/…/…/arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(ei_device_thingy53.cpp.obj):D:/Edge_AI/Nordic_thingy53/firmware-nordic-thingy53-main/src/ei_device_thingy53.cpp:92: more undefined references to `dk_set_led’ follow

collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: ‘D:\ncs\toolchains\cf2149caf2\opt\bin\cmake.EXE’ --build ‘d:\Edge_AI\Nordic_thingy53\firmware-nordic-thingy53-main\build’

Besides, I modified the original proj.conf by commenting out CONFIG_MCUBOOT_IMAGE_VERSION=“2.4.0+0” due to a compilation failure in v2.6.1.

I’d appreciate any suggestions to help me fix this issue.

1 Like

Hi @Angel.lai

I’m trying to reproduce but have you tried using NCS 2.4.0? it looks like there is something missing here, or it could just be the Zephyr environment isn’t set up correctly:

Step1: can you place back in the original.
CONFIG_MCU_IMAGE_VERSION= ...use here your chosen version

Step2: Zephyr Environment Variables

On Windows you may also need to explicitly set your Zephyr Env Vars -


export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=/path/to/zephyr-sdk
export NCS_TOOLCHAIN_VERSION=2.6.1
export ZEPHYR_BASE=/path/to/zephyr
export ZEPHYR_SDK_BASE=/path/to/ncs

For me on mac this was what worked previously:

set ZEPHYR_TOOLCHAIN_VARIANT=zephyr; set ZEPHYR_BASE=/opt/nordic/ncs/v1.9.1/zephyr/; set ZEPHYR_SDK_INSTALL_DIR=/opt/nordic/ncs/toolchains/v1.9.1/opt/zephyr-sdk/

If that works for your in the same command session then you will need to go to the Zephyr latest docs and set up your machine. Let me know if this works and we will report this as an issue and update in the docs for 2.6.1.

https://docs.zephyrproject.org/latest/develop/getting_started/index.html

Hopefully this will get you going @Angel.lai, if not please let us know too and any other customisations here or if you are using the additional NRF7002 add on board this may be a gap we are missing (trying to consider things that may have changed and that additional board is all I can think of).

Best

Eoin

Adding our resident experts here too for input:

@vojislav @mateusz

hi,

currently we support NCS 2.4.0 and advise to start building with that version of NCS and then try on a newer version.
There is no exact date yet, but we will update all the samples and deployment options to newer version of NCS.

best,
vojislav.

1 Like