Skip to content

Commit 019254a

Browse files
authored
Merge pull request #1870 from tannewt/fix_nrf_internal_flash_crash
Fix crash in internal filesystem on nrf
2 parents 839bac4 + 9feb844 commit 019254a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/nrf/supervisor/internal_flash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32
9797
count = MIN(num_blocks, count);
9898

9999
if (page_addr != _flash_page_addr) {
100-
nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache);
100+
// Write out anything in cache before overwriting it.
101+
supervisor_flash_flush();
102+
101103
_flash_page_addr = page_addr;
102104

103105
// Copy the current contents of the entire page into the cache.

0 commit comments

Comments
 (0)