STM32H7 QSPI & MDMA data split into 4bit packets
Hello,
I configured QSPI and MDMA in CubeMx and generated the initialization code. I merged the flash demo code (QSPI_ReadWriteDual_DMA), available for the H743 evaluation board, into my project.
Regarding the QSPI waveform I'm puzzled whats going on during the flash read and programming sequence. This is the QSPI transmit / flash program (command 0x32) waveform:

This is the QSPI receive / flash page read (command 0x6b) waveform:

In my understanding the command/address/dummy bytes are sent as expected.
But then the following data is split into 4 bit chunks during transmit and 8 bit chunks during receive. I have no clue why and which parameter is to blame here.
Here is the initialization code. H753 clock is 400MHz, QSPI clock is 40MHz.
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 4;
hqspi.Init.FifoThreshold = 1;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = 24;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_3_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.DualFlash = QSPI_DUALFLASH_ENABLE;
hqspi.Init.FlashID = QSPI_FLASH_ID_2;
hmdma_quadspi_fifo_th.Instance = MDMA_Channel1;
hmdma_quadspi_fifo_th.Init.Request = MDMA_REQUEST_QUADSPI_FIFO_TH;
hmdma_quadspi_fifo_th.Init.TransferTriggerMode = MDMA_BUFFER_TRANSFER;
hmdma_quadspi_fifo_th.Init.Priority = MDMA_PRIORITY_HIGH;
hmdma_quadspi_fifo_th.Init.Endianness = MDMA_LITTLE_ENDIANNESS_PRESERVE;
hmdma_quadspi_fifo_th.Init.SourceInc = MDMA_SRC_INC_BYTE;
hmdma_quadspi_fifo_th.Init.DestinationInc = MDMA_DEST_INC_DISABLE;
hmdma_quadspi_fifo_th.Init.SourceDataSize = MDMA_SRC_DATASIZE_BYTE;
hmdma_quadspi_fifo_th.Init.DestDataSize = MDMA_DEST_DATASIZE_BYTE;
hmdma_quadspi_fifo_th.Init.DataAlignment = MDMA_DATAALIGN_PACKENABLE;
hmdma_quadspi_fifo_th.Init.BufferTransferLength = 1;
hmdma_quadspi_fifo_th.Init.SourceBurst = MDMA_SOURCE_BURST_SINGLE;
hmdma_quadspi_fifo_th.Init.DestBurst = MDMA_DEST_BURST_SINGLE;
hmdma_quadspi_fifo_th.Init.SourceBlockAddressOffset = 0;
hmdma_quadspi_fifo_th.Init.DestBlockAddressOffset = 0;
For DMA transmit/receive these HAL functions are used in the demo:
HAL_StatusTypeDef HAL_QSPI_Transmit_DMA(QSPI_HandleTypeDef *hqspi, uint8_t *pData)
HAL_StatusTypeDef HAL_QSPI_Receive_DMA(QSPI_HandleTypeDef *hqspi, uint8_t *pData)Looks to me the DMA is not fast enough to feed the QSPI?
BTW: In most SPI demo DMA is used but QSPI is using MDMA. Why?
