fstorage erase is not working

Hi,

I am using fstorage functions in the ANT broadcast RX project.

I am doing the fstorage write function when the ANT device is connected (Inside RX EVENT of ANT event handler, only one write) and I am calling erase function during any button interrupt.

But I am having one problem:

Erase function is not happening if any write function has happened before.

If I reset the device and try only erase function, then it's happening.

And I am not getting any fstorage events.

Please provide us the solution for this issue.

Regards,

Aslam

Parents Reply Children
  • The issue is that fstorage only works with SOC events and not with ANT events. So when we have added nrf_fstorage_sd.c we have NRF_SDH_SOC_OBSERVER properly defined but this seems to be optimized away when you are using only nrf_sdh_ant.c.

    The solution is add nrf_sdh_soc.c also along with nrf_sdh_ant.c  in your project like this

    and all the below line in flash_placement.xml file

    	<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" />

    After that, I can compile the code and get fstorage events correctly.

    <info> app_timer: RTC: initialized.
    <info> app: --> Event received: erased 1 page from address 0x2C000.
    <info> app: --> Event received: wrote 4 bytes at address 0x2C000.
    <info> app: DUMMY READ : 69C5
    <info> app: device id read from the flash : 27077
    <info> app: ANT SLAVE LEV started.
    

  • Hi Susheel,

    Now, flash operations are working fine.

    Thanks for all the support.

    Regards,

    Aslam

Related