Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32: work around QSPI failing to read the last 32 bytes #773

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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