cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 SPI with DMA is not working, Transmit only used. stuck at HAL_SPI_STATE_BUSY_TX

JohnsAby
Associate II

I have done the implementation of 3 wire SPI using DMA and when I do SPI transfer using

HAL_SPI_Transmit_DMA(&SPIx_handle, (uint8_t *)TxBuffer, 8u); the HAL_SPI_GetState(&SPIx_handle) is stuck at HAL_SPI_STATE_BUSY_TX.

Not changing the state.

My configuration of SPI and DMA is similar to this query : STM32F405 SPI Transmit using DMA not working

Thanks in advance

Edit: First time posting query here, if anything needed additionally please comment

Edit 2: Earlier mentioned HAL_SPI_STATE_BUSY, updated to HAL_SPI_STATE_BUSY_TX

24 REPLIES 24
TDK
Guru

> Issue is when the NSS is high, Clock also present. 

The "NSS" signal on the STM32F4 is not a CS signal. It pulses at the end of each byte in TI mode, which is presumably what you have selected. You'll need to use a different method.

0693W00000GY2xbQAD.png 

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

> TI mode, which is presumably what you have selected

Nice catch, TDK!

Indeed, CR2 is 0x32 i.e. FRF is set.

In that case, also CR1.SSM is moot.

But this also implies that given pin is set as AF, rather than Out, in GPIO - is this the case?

JW

Hi TDK,

Thanks for the response

Closing this issues "STM32F4 SPI with DMA is not working, Transmit only used. stuck at HAL_SPI_STATE_BUSY_TX", since SPI with DMA in transmit mode is working fine. But second part is due to internal project issue, I will figure it out later.

I appreciate the time and effort you put, Thanks

Hi JW,

Thanks for the response

Closing this issues "STM32F4 SPI with DMA is not working, Transmit only used. stuck at HAL_SPI_STATE_BUSY_TX", since SPI with DMA in transmit mode is working fine. But second part is due to internal project issue, I will figure it out later.

I appreciate the time and effort you put, Thanks

Dude
Associate III

Check for peripheral conflicts, is anything competing for that DMA channel?