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

Pstorage operation guild

I develop my BLE with SDK 8.1 and softdevice 8.0, and I want to restore some data(about 50 bytes) to flash, can anyone please help to provide me an example for the entire process of pstorage ?

Best regards, Billy Hu

Parents Reply Children
  • Now I can do pstorage store ,load and update ... But When I do pstorage store and update, each time i can only store of update 4 bytes data ? pstorage_handle_t handle; pstorage_module_param_t param; uint8_t source_data[4] = {0x00, 0x01, 0x02, 0x03}; uint8_t dest_data[4];

    retval = pstorage_init(); param.block_size = 16; //Select block size of 16 bytes param.block_count = 4; //Select 10 blocks, total of 160 bytes param.cb = example_cb_handler; //Set the pstorage callback handler

    retval = pstorage_register(&param, &handle);

    Only if when i set the source_data size to 4 bytes then i can restore it, and when i set it to 8 bytes or others, the pstorage_storage function will return NRF_ERROR_INVALID_ADDR.

Related