Skip to content

Commit

Permalink
Merge pull request #773 from Daft-Freak/qspi-32-bytes-erratum
Browse files Browse the repository at this point in the history
stm32: work around QSPI failing to read the last 32 bytes
  • Loading branch information
Gadgetoid authored Aug 8, 2022
2 parents b656fa3 + bedf052 commit 6e516d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 32blit-stm32/Src/quadspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ void MX_QUADSPI_Init(void)
hqspi.Init.ClockPrescaler = 2;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = QSPI_FLASH_SIZE;

// Use a flash size 2x what we should to avoid "Memory-mapped read of last memory byte fails"
// (due to prefetch, it's actually the last 32 bytes)
hqspi.Init.FlashSize = QSPI_FLASH_SIZE + 1;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_3;
hqspi.Init.FlashID = QSPI_FLASH_ID_2;
Expand Down

0 comments on commit 6e516d7

Please sign in to comment.