sbrk.c: undefined reference to `end' in nrf connect SDK v2.4.0

Hi Team,

Earlier, we developed a library using nordic sdk v2.3.0 on nRF5340 TF-M secure environment. Now we planned to switch from nordic sdk v2.3.0 to v2.4.0.

While trying to compile our source code using nordic sdk v2.4.0, we observed the linker error (undefined reference to end) but this error is not observed in nordic sdk v2.3.0.

Linker Error:

c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: c:/ncs/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/lib/thumb/v8-m.main+fp/hard\libnosys.a(sbrk.o): in function `_sbrk':
sbrk.c:(.text._sbrk+0x1c): undefined reference to `end'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I could find the same problem in below link(ticket). But we are not using malloc or any Dynamic memory related functions anywhere in the code. But unable to understand why we are getting this error.

https://devzone.nordicsemi.com/f/nordic-q-a/101643/undefined-reference-to-end-with-nrf-connect-sdk-v2-4-0

After adding CONFIG_DEBUG=y, this error is resolved. As you suggested, we are unwilling to use this.

For v2.3.0, In CMakeLists.txt we were using below libs

 

For v2.4.0, we tried with below params

and 

Anything need to added in CMakeLists.txt or prj.conf to fix the error(undefined reference to end). Could you please point out if we missed anything.

Note: We are using attestation and key derivation APIs in code.

Parents
  • Hello,

    The developer I talked to suspects this is related to the cc3xx library. Please open the ncs/v2.4.0/ directory in a terminal and run "$ git status && git describe --tags" to verify that the 'nrfxlib' repo which contains this libary is on the v2.4.0 tag.

    Thanks,

    Vidar

  • Did you delete your reply? 

Reply Children
No Data