Pstorage


Pstorage I use it in nrf51822, feel that sometimes back to cause Bluetooth abnormal, I don't know what is the reason. Especially when calling uint32_t erase_inner_flash(pstorage_handle_t base_handle, uint32_t data_size, pstorage_size_t block_num)
{
pstorage_handle_t block_handle;
uint32_t err_code;

err_code = pstorage_block_identifier_get(&base_handle, block_num, &block_handle);
if (err_code == NRF_SUCCESS)
{
return err_code = pstorage_clear(&block_handle,data_size);
}
return err_code;
When},

Bluetooth will be abnormal, and the data of the sensor can be read only once through SPI. Why is that? There is also a one-second delay in the life of accessing data and reading data. After running for a period of time, it will also be abnormal, what is the reason? 

Parents Reply
  • Hi,

    I see. I assume you are using pstorage.c (which is compatible with the SoftDevice) and not pstorage_nosd.c? That is requiered for Bluetooth application that use the SoftDevice. As long as you do, flash operations should be sheduled in between SoftDevice operations, but there is a possibility that there will be problems if the SoftDevice does not have time to schedule everything (flash erase operations while maintaining connection with low connection interval, for instace).

    PS: As you write you are using a very old SDK, so unless this is for maintaing an existing product, I woudl strongly recommend migrating to a newer SDK (and also a newer SoC).

Children
No Data
Related