cancel
Showing results for 
Search instead for 
Did you mean: 

DMA CubeMX enabling for HAL_SPI_TransmitReceive_DMA()?

NA1
Associate II

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

3 REPLIES 3

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
Associate II

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!

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.