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

Missing Softdevice call to nrf_fstorage_sys_evt_handler

Hi to all,

we are developing an application nrf52832 that use BLE and internal flash as storage.

The problem, as I wrote in the subject, is the write operation is never terminated with a callback. Checking the flash content the operation success, what I miss is just the app know the partition ended. I can confirm that also because I try to put a switch on of a led in the nrf_fstorage_sys_evt_handler and it didn't chow anything.

We are developing using SDK 16.0.0 and softdevice 132 7.0.1.

We use gcc as compiler and, what make found the problem difficult, we use Contiki. That means we don't have a simple c application but it is spread in different C and makefile divided for platform/cpu, modules and applications.

I already see some post talking about missing nrf_sdh.c or similar file and all of them are compiled and used.

Also I'm sure we use nrf_fstorage_sd as backend.

Others had problem with busy-wait loop waiting the callback, but again is not our case: as examples we call sd_wait_event() to wait next time an interrupt or event happens.

Can anybody point me to a tutorial that give steps to use fstorage wit softdevice? Not examples but a step by step how to?

Also anby suggestion on how to find the problem will be appreciated.

We also worried if the problem is on linker script. There is something we can check on that too?

Thanks in advance.

Davide

Parents Reply
  • Hi,

    I didn't do the test but I found the reason.

    Inspired by this: https://devzone.nordicsemi.com/f/nordic-q-a/29137/fds-not-able-to-write-in-sdk-14

    I add this to <sdk_path>/components/softdevice/common/nrf_sdh_soc.c:

    void
    workaround_init() {}
    

    And call that function from my code where I initialize the memory.
    That solve my problem,

    More in general the problem is in final elf file (the one that I convert to IHEX and than flash on device are missing all objects (variable/struct/function) from the file above. I check that using:

    arm-none-eabi-nm main.elf | grep sdh_soc

    Going further I found they are present in an intermediate file nrf52832.a but where removed when linked with the rest of my code.

    While the workaround I report above above force last step of compiler/linker to include them.

    I'll going to investigate if there is an option or a parameter to put in Makefile that force the copy of those object.

    Any suggestion still welcome Slight smile

    BR,
    Davide

Children
No Data
Related