This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

using fstorage with ANT

I am struggling to get fstorage working with ANT, using S332 soft device.  I have tracked my problems down to the callback event not firing after flash write calls, and this is I think due to the fact that I was missing nrf_sdh_soc.c library.

If I try to add this library I get the following build error:

  Linking ant_hrm_tx_pca10040_s332.elf
    Output/ant_hrm_tx_pca10040_s332 Debug/Obj/nrf_sdh_soc.o:E:\Nordic_Semi\nRF5_SDK_15.2.0\components\softdevice\common/nrf_sdh_soc.c:64: undefined reference to `__start_sdh_soc_observers'
    Output/ant_hrm_tx_pca10040_s332 Debug/Obj/nrf_sdh_soc.o:(.rodata.sdh_soc_observers+0x4): undefined reference to `__stop_sdh_soc_observers'
    Output/ant_hrm_tx_pca10040_s332 Debug/Obj/nrf_sdh_soc.o: In function `nrf_sdh_soc_evts_poll':
    undefined reference to `__start_sdh_soc_observers'
Build failed

To simplify debugging I have tried adding the fstorage to the ant hrm example, and I get the same error with the nrf_sdh_soc.c library.  I have attached the project.

What am I doing wrong?

Parents
  • I found the problem, via a reply in a converstion from another post.

    __start_sdh_soc_observers has to be defined in the linker script, which in my case, using SES, is this line:

     <ProgramSection alignment="4" keep="Yes" load="Yes" name=".sdh_soc_observers" inputsections="*(SORT(.sdh_soc_observers*))" address_symbol="__start_sdh_soc_observers" end_symbol="__stop_sdh_soc_observers" />
        

  • Thanks for answering your own question. Just in case it still doesn't work correctly, the fs_data section used by fstorage, which I assume you have added already, need to be loaded to RAM on startup as well.

    In the RAM segment, make sure .fs_data_run is placed between .nrf_sections_run and .nrf_sections_run_end:

    Then make sure to build the project with INITIALIZE_USER_SECTIONS so the "nrf" sections get loaded to RAM.  

      

  • Hello,

    I have pretty same problem as you had. I have tried adding line you provided to flash_placement.xml and it compiles now with  nrf_sdh_soc.c without any problem, but app crashes after first flash write/update. I wonder whether location of line you provided in flash_placement.xml can affect it? I have pasted it right before sdh_stack_observers. Do you have any idea please?

    using S212

    Thank you,

    Pepam

Reply
  • Hello,

    I have pretty same problem as you had. I have tried adding line you provided to flash_placement.xml and it compiles now with  nrf_sdh_soc.c without any problem, but app crashes after first flash write/update. I wonder whether location of line you provided in flash_placement.xml can affect it? I have pasted it right before sdh_stack_observers. Do you have any idea please?

    using S212

    Thank you,

    Pepam

Children
No Data
Related