Skip to content
Commit 6aeb12d5 authored by Thomas Altenbach's avatar Thomas Altenbach Committed by Daniel DeGrasse
Browse files

drivers: flash: stm32_qspi: Fix flash not reset when in QPI mode



The reset commands were sent only in SPI mode, causing the device not to
be properly reset when in QPI mode. On the STM32H747I-DISCO boards, this
was causing the driver initialization to fail due to a bad SFDP magic
after flashing the external memory using STM32CubeProgrammer since the
external loader is configuring the flash memory in QPI mode.

The commands are sent in QPI mode first, then in SPI mode:
- If the flash memory was in QPI mode, the two first reset commands are
  processed and after reset, the flash memory is in SPI mode and
  correctly handles the SPI mode reset commands.
- If the flash memory was in SPI mode, for each QPI command the chip
  select signal will be released before the flash memory had the
  opportunity to receive a whole command (1 byte), so the partially
  received commands will be ignored and won't cause any harm. Then, the
  chip is reset by the commands sent in SPI mode.

Signed-off-by: default avatarThomas Altenbach <altenbach.thomas@gmail.com>
parent 00812070
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment