Internal Flash Page Erase is not working for nrf 52840 using nrf connect sdk

We have made 2 partition of Internal flash. One is for running Application and Other for storing some configuration. I am trying to erase the page of 2nd partition, and it is not working properly.

2nd partition Id is storage.

flash_area_open(FLASH_AREA_ID(storage), &fa);
flash_area_read(fa,3840,array,256);
flash_area_erase(fa, 3840, 256); //erasing only one page of the storage sector
flash_area_write(fa,3840,array1,256);
Is the above steps are correct?. As I am not able to erase the page properly and working only first time.
Parents Reply Children
Related