I am trying to use sd_flash_write() to write data into memory, but after calling this function, my chip reboot. I am using softdevice s132 v6.1 and SDK 15.2. it used works fine in sdk14.2
I am trying to use sd_flash_write() to write data into memory, but after calling this function, my chip reboot. I am using softdevice s132 v6.1 and SDK 15.2. it used works fine in sdk14.2
A few possible things:
1) When you call sd_flash_write(), the SoftDevice will trigger an interrupt to signal when the flash write has completed. You need to have an event handler installed which calls sd_evt_get() to capture the result.
2) The 'size' argument passed to sd_flash_write() is actually the number of 32-bit words you want to update, not the number of bytes. Make sure you're calculating it correctly. I implemented support for sd_flash_write() in my project and got this wrong by mistake, and as I recall it made my target reset too. I *think* that due to the mixup I was mistakenly trying to tell sd_flash_write() to write past the end of the flash.
3) You may need to erase before you flash.