Hi,
I am developing using nRF52820 / SDK 17.0.2
In order to store data in FDS, the handlers were registered and initialized as follows.
void BLE_Init(void)
{
ble_stack_init();
gap_params_init();
gatt_init();
advertising_init();
services_init();
conn_params_init();
peer_manager_init();
return;
}
static void FDS_Event_handler( fds_evt_t const * p_evt )
{
SEGGER_RTT_printf(0, "FDS_Event_handler id : %d / result : %d\n", p_evt->id, p_evt->result);
switch (p_evt->id)
{
case FDS_EVT_INIT:
case FDS_EVT_GC:
case FDS_EVT_WRITE:
case FDS_EVT_DEL_RECORD:
case FDS_EVT_UPDATE:
break;
}
}
int main( void )
{
fds_record_desc_t desc = {0};
fds_find_token_t tok = {0};
fds_record_t RecordData;
RecordData.file_id = DATA_FILE_ID;
RecordData.key = DEFAULT_RKEY;
RecordData.data.p_data = pData;
RecordData.data.length_words = DATA_FILE_SIZE;
.....
BLE_Init();
fds_register(FDS_Event_handler);
.....
if( fds_record_find( RecordData.file_id, RecordData.key, &desc, &tok ) == NRF_SUCCESS )
{
if( fds_record_update( &desc, &RecordData ) == FDS_ERR_NO_SPACE_IN_FLASH )
{
fds_gc(); // run garbage collection
fds_record_update ( &desc, &RecordData );
}
}
.....
}
FDS_Event_handler does not occur after fds_record_update().
Why the event is not occurring?
An event occurs when garbage collection is executed, but an event does not occur when FDS update.
And how can I check that the update is completed in queue process after the update?
I would like to know that the FDS update is complete without using a event handler if possible.