8000 stm32/qspi.c: Workaround for SR set immediately after setting AR. · micropython/micropython@96444d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96444d5

Browse files
committed
stm32/qspi.c: Workaround for SR set immediately after setting AR.
* See issue #5441. * This issue is now reproducible with upstream Micropython on the Arduino Portenta H747, QSPI flash PN MX25L12833F.
1 parent f5cdd83 commit 96444d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/stm32/qspi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ STATIC void qspi_read_cmd_qaddr_qdata(void *self_in, uint8_t cmd, uint32_t addr,
350350
QUADSPI->ABR = 0; // alternate byte: disable continuous read mode
351351
QUADSPI->AR = addr; // address to read from
352352

353+
#if defined(STM32H7)
354+
// Workaround for SR getting set immediately after setting the address.
355+
if (QUADSPI->SR & 0x01) {
356+
QUADSPI->FCR |= QUADSPI_FCR_CTEF;
357+
QUADSPI->AR = addr; // address to read from
358+
}
359+
#endif
360+
353361
// Read in the data 4 bytes at a time if dest is aligned
354362
if (((uintptr_t)dest & 3) == 0) {
355363
while (len >= 4) {

0 commit comments

Comments
 (0)
0