Fix crash in internal filesystem on nrf

Fixes #1842
This commit is contained in:
Scott Shawcroft 2019-05-08 15:43:18 -07:00
parent bec84f20ab
commit 9feb844b7e
No known key found for this signature in database
GPG Key ID: FD0EDC4B6C53CA59

View File

@ -97,7 +97,9 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32
count = MIN(num_blocks, count);
if (page_addr != _flash_page_addr) {
nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache);
// Write out anything in cache before overwriting it.
supervisor_flash_flush();
_flash_page_addr = page_addr;
// Copy the current contents of the entire page into the cache.