Skip to main content
YPark.5
Associate
August 23, 2021
Solved

STM32L4Q5VGTxP DMA why it doesn't work.

  • August 23, 2021
  • 2 replies
  • 1293 views
  • 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.
Best answer by TDK

Ensure MX_DMA_Init is called before MX_SPI_Init.

2 replies

TDK
TDKBest answer
August 23, 2021

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
August 24, 2021

Wow!

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

Really thankful.

It works normally now.