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

how to use sd_flash_write? SDK13

I want to write at the end of memory ROM data in address 0x7FFFF

uint8_t tst_arr[1] = {6};
sd_flash_write((uint32_t*)0x7FFFF, (uint32_t*) &tst_arr, 1);

Is it correct?

But if I made it, in a memory watch I can't see any changes from 0xFF to my data (6).

Parents
  • No you cannot do it like this, flash writes should be 32-bit aligned. So if you want to write 8-bits to address 0x7FFFF then you should read 24-bits from address 0x7FFFC, concatenate it with your 8-bits and write resulting 32-bits back to address 0x7FFFC. Alternatively you can skip reading and put 0xFFFFFF at the beginning if you are sure that flash is erased before your write (or if you simply don't care about these preceding 3 bytes).

  • while ((sd_flash_write((uint32_t*)0x7FFFC, tst_arr, 1)) != NRF_SUCCESS);

    doesn't return error. After this function I step next. Therefore sd_flash_write return success. But In the memory window without any differents. 0x7FFFC = 0xFF and nex 3 bytes = 0xFF. I readed Your link but no progress. I don't have any idea why doesn,t work.

Reply Children
No Data
Related