cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 QSPI & MDMA data split into 4bit packets

regjoe
Senior

Hello,

I configured QSPI and MDMA in CubeMx and generated the initialization code. I merged the flash demo code, 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:

flash_write_qspi_mdma_4bit_packets.png

In my understanding the command/address/dummy bytes are sent as expected.

But then the following data is split into 4 bit chunks. 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;

 

BTW: In most SPI demo DMA is used but QSPI is using MDMA. Why?

 

 

1 REPLY 1

>>In most SPI demo DMA is used but QSPI is using MDMA. Why?

Usually a function of which bus the peripherals on, and the bus-matrix furnishing connectivity between memory and peripheral. I'm sure there's a diagram in the RM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..