diff --git a/ion/src/device/external_flash.cpp b/ion/src/device/external_flash.cpp index 7b754a2ec..d39e084f8 100644 --- a/ion/src/device/external_flash.cpp +++ b/ion/src/device/external_flash.cpp @@ -199,6 +199,18 @@ void initChip() { wait(QUADSPI::CCR::OperatingMode::Single); send_command(Command::EnableQPI, QUADSPI::CCR::OperatingMode::Single); wait(); + if (ClockFrequencyDivisor == 1) { + class ReadParameters : Register8 { + public: + /* Parameters sent along with SetReadParameters instruction in order + * to configure the number of dummy cycles for the QPI Read instructions. */ + using Register8::Register8; + REGS_BOOL_FIELD_W(P5, 1); + }; + ReadParameters readParameters(0); + readParameters.setP5(true); + send_write_command(Command::SetReadParameters, reinterpret_cast(FlashAddressSpaceSize), reinterpret_cast(&readParameters), sizeof(readParameters)); + } } set_as_memory_mapped(); } diff --git a/ion/src/device/external_flash.h b/ion/src/device/external_flash.h index ff4d9e7b8..f05bcf476 100644 --- a/ion/src/device/external_flash.h +++ b/ion/src/device/external_flash.h @@ -60,6 +60,7 @@ enum class Command : uint8_t { // Erase the whole chip or a 64-Kbyte block as being "1" ChipErase = 0xC7, Erase64KbyteBlock = 0xD8, + SetReadParameters = 0xC0 }; constexpr static uint32_t QSPIBaseAddress = 0x90000000;