Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SES Setup Advice Breaks Examples: undefined reference to `__fs_data_load_start__', etc

This blog describes how to set up SES (Segger Embedded Studio) for use with nRF SDK:

https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide

The following modification is suggested in thumb_crt0.s - so that fstorage works:

ldr r2, =__tdata_end__
bl memory_copy
# ADD HERE ... 
ldr r0, =__fs_data_load_start__
ldr r1, =__fs_data_start__
ldr r2, =__fs_data_end__
bl memory_copy
# TO HERE ...

But this will break any example which does not use fstorage; eg the LED Softblink example:

undefined reference to `__fs_data_load_start__'
undefined reference to `__fs_data_start__'
undefined reference to `__fs_data_end__'

Is there a way to make this conditional on the use of fstorage?

Otherwise, I guess we'll just have to have two versions of thumb_crt0.s  ?

Parents
  • Hi,

     

    I can start with explaining what we do in newer SDKs that support SES. Here we have individual sections for several modules, like nrf_pwr_mgmt, nrf_log, softdevice/ble helper libraries etc.

    All the sections in your project are wrapped inside one large "dynamic" section, named ".nrf_sections" (with provided __start / __end / __load symbols as well), which is handled in ses_nRF_Startup.s.

    Is there a way to make this conditional on the use of fstorage?

     

    Otherwise, I guess we'll just have to have two versions of thumb_crt0.s  ?

    Unfortunately, I do not have a quick solution for fixing this issue.

    You could port the handling to C, then guard it with #if NRF_FSTORAGE_ENABLED, but then the question is: in which file does this initialization belong? I suspect having two .s files is the lesser of two evils.

     

    Best regards,

    Håkon

Reply
  • Hi,

     

    I can start with explaining what we do in newer SDKs that support SES. Here we have individual sections for several modules, like nrf_pwr_mgmt, nrf_log, softdevice/ble helper libraries etc.

    All the sections in your project are wrapped inside one large "dynamic" section, named ".nrf_sections" (with provided __start / __end / __load symbols as well), which is handled in ses_nRF_Startup.s.

    Is there a way to make this conditional on the use of fstorage?

     

    Otherwise, I guess we'll just have to have two versions of thumb_crt0.s  ?

    Unfortunately, I do not have a quick solution for fixing this issue.

    You could port the handling to C, then guard it with #if NRF_FSTORAGE_ENABLED, but then the question is: in which file does this initialization belong? I suspect having two .s files is the lesser of two evils.

     

    Best regards,

    Håkon

Children
Related