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

nRF51822 Problem with Garbage Collection

Hello,

I am using SDK12.3 and have problem with garbage collection (FDS module).

My apllication depends on timeslot, so that FDS is supposed to run together with Bluetooth and ESB.Besides, I use scheduler, APP timer and ADC module.

R/W record, deleting record are functional, but garbage collection does not.

What happens is the following:

The problem uccurs when I keep on updating one record with function fds_record_update. After many times of updating, the storage becomes full and the error code FDS_ERR_NO_SPACE_IN_FLASH is returned.

As soon as I receive this error, I call the function fds_gc() to start a garbage collection. 

However, after calling fds_gc(), something in softdevice goes wrong and the function softdevice_fault_handler(uint32_t id, uint32_t pc, uint32_t info) is called, with id = 0x00000001, pc = 0x000104AE, info = 0.

The error handler app_error_save_and_stop does not give any valid file name, but only a line number, which is line 1984.

Can anyone help me to understand what this means?  How can I locate the problem?

Parents Reply Children
  • I can check with the softdevice team. How frequently are you running garbage collection on average? I was just thinking that if it's indeed a softdevice issue, whether it was possible for you to close BLE and ESB activity before running garbage collection.

  • Thanks for the reply. My application uses FDS to save user configurations for ESB and Bluetooth, so I cannot turn off Bluetooth, otherwise the device will disconnect. It is possible to turn off ESB during the saving process.

    Garbage collection is not carried out often, just once per day or in several days in real application, dependent on how often the user changes his configuration. I now only carry out garbage collection when the storage is full and after the error FDS_ERR_NO_SPACE_IN_FLASH is returned when saving something.

  • Have tried to look into this, but the only thing we can't think of is some kind of stack overflow that overwrite the stack in the softdevice, and then this issue occur pretty much by accident. Then the issue should not be consistent, is the same assert (pc) always occurring, same time, is it reproducible, how long have the programming been running etc.?

    Maybe you can try to run fds_gc() after a fixed number of fds_record_update() before FDS_ERR_NO_SPACE_IN_FLASH occurs.

    Best regards,
    Kenneth

Related