Skip to content

Commit

Permalink
stm32: work around QSPI failing to read the last 32 bytes
Browse files Browse the repository at this point in the history
Locking up everything including debugging...
  • Loading branch information
Daft-Freak committed Jun 11, 2022
1 parent 203bb9c commit bedf052
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 bedf052

Please sign in to comment.