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

Why I can not erasing the flash ?

6.1.4 Erasing a page in code region 1 When erase is enabled, the NVM can be erased page by page using the ERASEPAGE register or the ERASEPCR1 register. After erasing a NVM page all bits in the page are set to '1'. The time it takes to erase a page is specified by tPAGEERASE in the product specification. The CPU is halted while the NVMC performs the erase operation. See UICR chapter for more information.

I can write a data to flash only once, and can read it ok.

but I can not erasing the flash page, so I can not write some other data to the same flash address again.

I do it as that:

NRF_NVMC->ERASEPAGE=254; NRF_NVMC->ERASEPCR1=254; NRF_NVMC->ERASEUICR=1; while(NRF_NVMC->READY==0); //NRF_NVMC->ERASEALL=1; NRF_NVMC->CONFIG=2;//FOR DEL while(NRF_NVMC->READY==0);

I read the FICR ,and know that CODEPAGESIZE is 1024 CODESIZE is 256

and I know that region 0 is 108k ID=0X0087 region 1 is base 0x1b000, and is 148k . and I want to erasing the last 2 pages.

I try some times , somes the NRF_NVMC->ERASEPAGE is set before the NRF_NVMC->CONFIG=2;//FOR DEL somes the NRF_NVMC->ERASEPAGE is set after the NRF_NVMC->CONFIG=2;//FOR DEL and somes the NRF_NVMC->ERASEPAGE set before the NRF_NVMC->CONFIG=2;//FOR DEL, and set again after NRF_NVMC->CONFIG=2;//FOR DEL.

the result is same, when I use nRFgo Studio erase all, the firt time is all ok. the next time , I cannot write data to flash, but I can read it ok.

so, I think that I can not erasing the flash page, in the function.

Parents Reply Children
No Data
Related