DMA on QSPI write only works when single stepping through the code
I'm using BL-475E-IOTA2 board (STM32L475) which comes with MX25R6435F Flash chip. I'm trying to using Quad SPI to write and read to/from the flash chip.
With free running the code(release mode):
- If I don't use DMA when writing to the flash chip, it can read/write with free running (running in release mode) fine.
- If I use DMA, it always fails when I send a write enable command to the flash chip:
in stm32l4xx_hal_qspi.c, HAL_QSPI_Command() returns HAL_BUSY.
With single stepping through the code, with DMA or no DMA, it writes and reads the flash chip fine.
I tried QSPI clock prescaler of 1,2,3 but it didn't help. Sys clk and HCLK (to DMA) is 80MHz
I also tried adding a 1s delay before and after writing the write enable command to the flash, but it still failed the same way.
What could cause this problem?
