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

nrf_fstorage_erase error

I try flash read, write and erase with flash_fstorage_example sdk 15 on nrf52 dk

On main.c i can write and read with nrf_fstorage functions.

When i try nrf_fstorage_erase function I take an error

    int pg_size = NRF_FICR->CODEPAGESIZE; 
    int pg_num = NRF_FICR->CODESIZE - 1; // Use last page in flash // Start address: addr = (uint32_t *)(pg_size* pg_num);


    uint32_t *addr = (uint32_t *)(pg_size* pg_num);

    rc = nrf_fstorage_erase(&fstorage, addr, 1, NULL);
    APP_ERROR_CHECK(rc);

It returns

\0x1b[20D\0x1b[J<error> nrf_fstorage: addr_is_within_bounds(p_fs, page_addr, (len * p_fs->p_flash_info->erase_unit)) check failed in nrf_fstorage_erase() with value 0x10.
\0x1b[20D\0x1b[J<error> app: Fatal error

Related