Skip to main content
YPark.5
Associate
Aug 23, 2021 1:33 PM UTC
Solved

STM32L4Q5VGTxP DMA why it doesn't work.

  • STM32L4Q5VGTxP I use the board I made.

FUNC 1) HAL_SPI_Transmit(ILI9341_SPI_Handle,&data,1,100);

The output waveform is observed with SCLK / MOSI PIN.

FUNC 2) HAL_SPI_Transmit_DMA(ILI9341_SPI_Handle,&data,1);

Output waveform does not appear with SCLK / MOSI PIN.

After executing HAL_SPI_Transmit_DMA once

(check function)

HAL_SPI_StateTypeDef err;

err = HAL_SPI_GetState(ILI9341_SPI_Handle);

while(err != HAL_SPI_STATE_READY){

err = HAL_SPI_GetState(&hspi1);

}

The result continues to return err (HAL_SPI_STATE_BUSY_TX).

Below is a picture of CUMEMX setup.0693W00000Dq6c2QAB.png0693W00000Dq6bxQAB.png 

0693W00000Dq6beQAB.png 

//======================== PS

HAL_ADC_Start_DMA(&hadc1,&adc_dma_buffer[0], 4);

Also, it doesn't work.

What did I miss, where did I go wrong?

This topic has been closed for replies.
TDK
TDKBest answer
Aug 23, 2021 5:19 PM UTC

Ensure MX_DMA_Init is called before MX_SPI_Init.

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Aug 23, 2021 5:19 PM UTC

Ensure MX_DMA_Init is called before MX_SPI_Init.

"If you feel a post has answered your question, please click ""Accept as Solution""."
YPark.5
YPark.5Author
Associate
Aug 24, 2021 4:53 AM UTC

Wow!

Previously, the project was applied in order in hal, but as TDK said, it was changed.

Really thankful.

It works normally now.