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

nRF51822 The access to the flash memory cause the program to fail.

Hi, everyone,

I am developing the project on nRF518522 and I must use the flash memory to save the data. The data must be saved while the device is conncted via BT with the master. For this purpose I use the procedure ble_flash_page_write(PG_NUM, p_out_array, p_word_count); where: the variables and constants are defined so:

#define PG_SIZE (NRF_FICR->CODEPAGESIZE)
#define PG_NUM  (BLE_FLASH_PAGE_END - 1)

uint32_t p_out_array[PG_SIZE];

in my case the p_word_count=7;

If I try to pass the code by step by step, the procedure (ble_flash_page_write) passes successfully, but during the running it caus the device to stop working and nothing in the flash is saved.

What is it possible to do?

Parents Reply
  • Of corse it is possible to prepair the block writings and erase the page only when it is full. During the connection it will solve the problem partialy because in this case during the connection will be only writings. BUT! When the page will be full, for writing the next block it will be needed to erase it for freeing the place. And independently if the module is connected or not, The page will have to be erased in any case. We are using the SDK version 12.3.0 because the newest one doesn't support the nrf51822 chip.

Children
No Data
Related