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

Flash write

Hello,

I'm trying to write value to a specified address with ble_flash_page_write .

I'm using ble_flash_page_write after ble disconnect event. I've tested different page address to be sure i'm not writing on application or s110 areas and page address are multiples of 4.

At execution, an Hard fault occur at the ble_flash_page_write line... Any idea about this error ? Is there others solutions to write values to a precise flash address ?

int32_t page = 200;
uint8_t word_count = 1;
uint32_t data_array[2]={0x81ABACAB};
data_array[1] = 0x81ABACAB;
		
err_code = ble_flash_page_write(page,(uint32_t *) &data_array,1);
APP_ERROR_CHECK(err_code);
Parents
  • Hi David,

    I would like to mention that pstorage implements a queue as SoftDevice permits only one flash access operation pending at a time. Hence issuing back to back erase is not a problem if you are receiving system events from SoftDevice and passing it on the pstorage module. It is on this event that the module pops next operation (if any) in its queue.

    Hence it is important that the procedures in the code snippet above are performed. Hope this helps!

    Regards, Krishna

Reply
  • Hi David,

    I would like to mention that pstorage implements a queue as SoftDevice permits only one flash access operation pending at a time. Hence issuing back to back erase is not a problem if you are receiving system events from SoftDevice and passing it on the pstorage module. It is on this event that the module pops next operation (if any) in its queue.

    Hence it is important that the procedures in the code snippet above are performed. Hope this helps!

    Regards, Krishna

Children
No Data
Related