Skip to main content
NA1
Associate
May 9, 2019
Question

DMA CubeMX enabling for HAL_SPI_TransmitReceive_DMA()?

  • May 9, 2019
  • 3 replies
  • 775 views

Hi there,

I am currently using the HAL_SPI_TransmitReceive() function for back-to-back read/write with a GPS modem as the slave. If i want to now implement the SPI coms with DMA, what is the correct DMA channel config in CubeMX?

Only one DMA channel is allowed (RX/TX) for the SPI master.

Thank you

This topic has been closed for replies.

3 replies

Nesrine.JLASSI
Visitor II
May 10, 2019

Hi @NA1​ 

There are several versions of DMA. To answer your question, i have to know which MCU and DMA do you use?

If DMA without DMAMUX => there is a mapping table in the reference manual

If DMA with DMAMUX => You can use any DMA channel and it works perfectly

Best regards,

Nesrine

NA1
NA1Author
Associate
May 10, 2019

HI Thank you for the response.

I am using the STM32L073RZTx, and am trying to implement HAL_SPI_TransmitReceive_DMA().

The DMA configuration in the SPI config in CubeMX is my question for the above implementation.

Thank you for the help once again, I really appreciate it!

Nesrine.JLASSI
Visitor II
May 10, 2019

You can do the configuration according to the mapping.

Look at this table: Summary of the DMA requests for each channel

0690X000008BWmSQAW.png

Best regards,

Nesrine.