This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

failing while doing the flashwrite example

hello, i am doing flash read and write in nrf51.for which i have used the C:\nRF5_SDK_12.2.0_f012efa\examples\peripheral\flashwrite\pca10028\blank\arm4 this exampl. but while doing this my nrf51-DK borad stopped response and it showing errors while programming

i have just executed this code , void main() { uint32_t * addr; uint8_t patwr; uint8_t patrd; uint8_t patold; uint32_t i; uint32_t pg_size; uint32_t pg_num;

uint32_t err_code;

err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);

NRF_LOG_INFO("Flashwrite example\r\n");
patold  = 0;
pg_size = NRF_FICR->CODEPAGESIZE;
pg_num  = NRF_FICR->CODESIZE - 1;  // Use last page in flash

while (true)
{
    // Start address:
    addr = (uint32_t *)(pg_size * pg_num);
    // Erase page:
    flash_page_erase(addr);
    i = 0;
    NRF_LOG_INFO("'%p' is the address",(unsigned int)addr);
		  NRF_LOG_INFO("'%d' is the page size",pg_size);
			NRF_LOG_INFO("'%d' is the page number",pg_num);

}} after that it shows the errors can not write on address 0x4000..

can anyone please tell me from which address i have to write data on the flash the default starting page mentioned is 255 and the comment is given in example use last page. i want to ask what pages i can use for saving the data on the flash?

Parents Reply Children
No Data
Related