From 5ccf8d6b972be025befee344e873c492191e75ae Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 25 Mar 2021 16:41:05 +0100 Subject: [PATCH] [ion/device/external_flash] Add dsb instruction in method wait This mimics the behavior of InternalFlash::wait, and fixes a bug found on the bench when reading the flashed firmware. --- ion/src/device/shared/drivers/external_flash.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ion/src/device/shared/drivers/external_flash.cpp b/ion/src/device/shared/drivers/external_flash.cpp index 65b6bcdb3..8e8886421 100644 --- a/ion/src/device/shared/drivers/external_flash.cpp +++ b/ion/src/device/shared/drivers/external_flash.cpp @@ -1,4 +1,5 @@ #include "external_flash.h" +#include #include #include #include @@ -179,6 +180,7 @@ static inline void send_read_command(Command c, uint8_t * address, uint8_t * dat } static inline void wait() { + Cache::dsb(); ExternalFlashStatusRegister::StatusRegister1 statusRegister1(0); do { send_read_command(Command::ReadStatusRegister1, reinterpret_cast(FlashAddressSpaceSize), reinterpret_cast(&statusRegister1), sizeof(statusRegister1));