hi, everyone!
I have a question for pstorage, when i use pstorage_store,it was failed, return error code :15 how to solve it. Below is my code
void custom_flash_init(void)
{
uint32_t retval;
pstorage_handle_t base_handle;
pstorage_module_param_t param;
param.block_size = 1024;
param.block_count = 1;
param.cb = flash_cb_handler;
retval = pstorage_init();
if(retval == NRF_SUCCESS)
SEGGER_RTT_printf(0,"------pstorage init success:%d ------ \r\n", retval);
else
SEGGER_RTT_printf(0,"------pstorage init failed:%d ------ \r\n", retval);
retval = pstorage_register(¶m, &base_handle);
if (retval == NRF_SUCCESS)
SEGGER_RTT_printf(0,"------Registration successful.------ \r\n");
else
SEGGER_RTT_printf(0,"------Failed to register, take corrective action.------ \r\n");
}
enter code here
pstorage_handle_t dest_block_id;
uint8_t test_buf[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
uint8_t read_buf[8];
pstorage_store(&dest_block_id, test_buf, 8, 0);
pstorage_load( read_buf, &dest_block_id, 8, 0);