diff options
| author | Dan Halbert <halbert@adafruit.com> | 2019-05-08 19:41:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-08 19:41:17 -0400 |
| commit | 019254a9d2903ee09aa6657b69ad263d23e60103 (patch) | |
| tree | 0f95d94a8a7688c5a194b51591d25101e8dbee27 | |
| parent | 839bac47d43105e81e9f3f92bf022686ca0ede5c (diff) | |
| parent | 9feb844b7ecba9d2b9892e3f5a10691615af7f32 (diff) | |
Merge pull request #1870 from tannewt/fix_nrf_internal_flash_crash
Fix crash in internal filesystem on nrf
| -rw-r--r-- | ports/nrf/supervisor/internal_flash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index 5713dea88..dcacd4d27 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -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. |
