stm32/qspi: Workaround for SR set immediately after setting AR.

See issue #5441.  This issue is now reproducible on the Arduino Portenta
H747, QSPI flash PN MX25L12833F.
pull/7989/merge
iabdalkader 2022-04-13 12:41:28 +02:00 zatwierdzone przez Damien George
rodzic 5974ac256b
commit 32914c53ef
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -354,6 +354,14 @@ STATIC void qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr,
QUADSPI->ABR = 0; // alternate byte: disable continuous read mode
QUADSPI->AR = addr; // address to read from
#if defined(STM32H7)
// Workaround for SR getting set immediately after setting the address.
if (QUADSPI->SR & 0x01) {
QUADSPI->FCR |= QUADSPI_FCR_CTEF;
QUADSPI->AR = addr; // address to read from
}
#endif
// Read in the data 4 bytes at a time if dest is aligned
if (((uintptr_t)dest & 3) == 0) {
while (len >= 4) {