HI,all!
I recently using pstorage to store data
and the pstorage_store(); funtion always returns NRF_SUCCESS, but never triggle the cb_handler, is that normal?
by the way, i just sucessfully store the data once and never success again.(the loaded data is 0xff)
Can someone points out the problems? Thank you very much!
here is my code:
void mypstorage_init(void)
{
uint16_t block=0;
uint8_t flash2[16]={16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
uint16_t size=16;
uint16_t offset=0;
pstorage_handle_t p_block_id;
cb_init mycbinit;
pstorage_module_param_t p_example_param;
// Setup pstorage with 60blocks of 16byte in each.
p_example_param.block_size = 0x10; // recommended to be >= 4 byte
p_example_param.block_count = 60;//60
p_example_param.cb = mycbinit.example_cb_handler;
pstorage_init();
pstorage_register(&p_example_param, &m_p_example_id);
pstorage_block_identifier_get(&m_p_example_id, block, &p_block_id);
pstorage_store(&p_block_id,flash2,size,offset);
pstorage_load(myflash2,&p_block_id,size,offset);
}
typedef struct
{
pstorage_ntf_cb_t example_cb_handler;
} cb_init;
void example_cb_handler(pstorage_handle_t * p_handle,
uint8_t op_code,
uint32_t result,
uint8_t * p_data,
uint32_t data_len)
{
;
}