[ion] Flash: between data write operations or accesses to FLASH_CR, issue a DSB instruction to guarantee the completion of the operation

This commit is contained in:
Émilie Feral
2019-03-19 11:56:11 +01:00
parent 1ac6167420
commit 2ba1a053a5

View File

@@ -1,4 +1,5 @@
#include "flash.h"
#include <drivers/cache.h>
#include <assert.h>
namespace Ion {
@@ -8,6 +9,9 @@ namespace Flash {
using namespace Regs;
static inline void wait() {
/* Issue a DSB instruction to guarantee the completion of a previous access
* to FLASH_CR register or data write operation. (RM0431) */
Cache::dsb();
// Wait for pending Flash operations to complete
while (FLASH.SR()->getBSY()) {
}