diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-16 00:54:04 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-16 00:54:04 +0300 |
commit | bf9b6d50e0285a253e2806c3c694149751475b19 (patch) | |
tree | d19fd2857735e9305f6f71eddbfe9062c61e00bf | |
parent | c65a7797c2fc05334b41584c70583f50d3161ba6 (diff) |
Disable cache while writing data to user signature
-rw-r--r-- | src/Hardware/NonVolatileMemory.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Hardware/NonVolatileMemory.cpp b/src/Hardware/NonVolatileMemory.cpp index 72b91bd5..d0534821 100644 --- a/src/Hardware/NonVolatileMemory.cpp +++ b/src/Hardware/NonVolatileMemory.cpp @@ -75,7 +75,12 @@ void NonVolatileMemory::EnsureWritten() noexcept if (state == NvmState::writeNeeded) { # if SAM4E || SAM4S || SAME70 + const bool cacheEnabled = Cache::Disable(); flash_write_user_signature(reinterpret_cast<const uint32_t*>(&buffer)); + if (cacheEnabled) + { + Cache::Enable(); + } # elif defined(__LPC17xx__) LPC_WriteSoftwareResetData(slot, buffer, sizeof(buffer)); # else |