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

52833 write flash error

    #define SIZE 10
    int i;
    int8_t ret;
    int main_addr_buff,backup_addr_buff;
    int write_buff[SIZE];
    for(i=0;i<SIZE;i++){
        write_buff[i] = 10+i;
    }
    if((ret = nrf_fstorage_erase(&fstorage, 0x74000, 1, NULL)) != NRF_SUCCESS)
        SLOG_E("nrf_fstorage_erase error,%d",ret);
    waitForFlashReady(&fstorage);

    if((ret = nrf_fstorage_write(&fstorage, 0x74000, write_buff, sizeof(int)*SIZE, NULL)) != NRF_SUCCESS)
        SLOG_E("nrf_fstorage_write error,%d",ret);
    waitForFlashReady(&fstorage);

    for(i = 0;i < 1024;i++){
        nrf_fstorage_read(&fstorage, 0x74000+i*4, &main_addr_buff, sizeof(int));
        DLOG_I("main_addr=0x%x,main_addr_buff=0x%x",0x74000+i*4,main_addr_buff);
    }

i write 40bytes to flash 0x74000 and read 0x74000。i find it actually use 160bytes. I try to write a different number of bytes, it actually use 4*(write bytes)

this is jflash image

Thank you for your reply!!

Parents Reply Children
Related