Hi all,
I have an issue when trying to use the fstorage without the SoftDevice. The documentation explains that it is possible to use the FStorage without SoftDevice if the NVMC api backend is used, that is what I do. I have no issue when reading data from flash but when I try to write something, there is absolutely no data written to flash. I used the example provided in the SDK15.
Here is my initialization code
/**
* @brief NRF fstorage definition
* @details Sets the fstorage event handler, start and end addresses.
*/
NRF_FSTORAGE_DEF(nrf_fstorage_t fstorage) =
{
/* Set a handler for fstorage events. */
.evt_handler = vFstorageEventHandler,
/* These below are the boundaries of the flash space assigned to this instance of fstorage.
* You must set these manually, even at runtime, before nrf_fstorage_init() is called.
* The function nrf5_flash_end_addr_get() can be used to retrieve the last address on the
* last page of flash available to write data. */
.start_addr = FLASH_STORAGE_START_ADDRESS,
.end_addr = FLASH_STORAGE_END_ADDRESS,
};
With :
FLASH_STORAGE_START_ADDRESS = 0x0007F000
FLASH_STORAGE_END_ADDRESS = 0x00080000
void vFlashConfig_Init( void )
{
ret_code_t rc;
/* Pointer the the Flash Storage api */
nrf_fstorage_api_t * p_fs_api;
/* Initialize an fstorage instance using the nrf_fstorage_nvmc backend.
* nrf_fstorage_nvmc uses the NVMC peripheral. This implementation can be used when the
* SoftDevice is disabled or not present.
*
* Using this implementation when the SoftDevice is enabled results in a hardfault. */
p_fs_api = &nrf_fstorage_nvmc;
/* Initialize Flash Storage driver */
APP_ERROR_CHECK( nrf_fstorage_init( &fstorage, p_fs_api, NULL ) );
}
And finally the dummy data write test
void vFlashConfig_WriteTest( void )
{
/* Table with dummy data */
uint8_t pu8TestTab[] = {0x01, 0x02, 0x03, 0x04};
/* Save main application configuration */
return_code = nrf_fstorage_write( &fstorage, 0x7F040, pu8TestTab, sizeof(pu8TestTab), NULL );
APP_ERROR_CHECK(return_code);
/* Wait during flash writing operations */
vWaitForFlashReady( &fstorage );
}
The event handler function is called as expected and gives the following message :
app: --> Event received: wrote 4 bytes at address 0x7F040.
I used the debugger to visualize the flash content, unfortunately no data written to the flash :

Thanks a lot for your help !
Regards,
Raphael