cancel
Showing results for 
Search instead for 
Did you mean: 

SPI1 With DMA stuck after sending the first transaction on "STM32L476G-EVAL" target

KhalilAzouz
Associate

Hi All,

I have two Questions,

The first one is:

I was trying to use one of the SPI examples provided by ST SDK, but the "STM32L476G-EVAL" target doesn't have an SPI example, so I used the NUCLEO-L476RG SPI_FullDuplex_ComDMA example as a reference.

I was trying to use the SPI1 with DMA1, but the code got stuck after calling "HAL_SPI_Transmit_DMA", And when I used a logic analyzer, I saw the transaction was done successfully. 

The second question is:

I used two DMA1 channels for tx and rx, used channel 3 for TX and channel 2 for RX, like the "SPI_FullDuplex_ComDMA" example; as I said before, the code got stuck after sending the first transaction, but when I used another channel for TX, The transaction didn't occur.

So, Is there something I'm missing? Must SPI1 work with DMA1channel3, and if so, Why did the code get stuck after the first transaction?

1 ACCEPTED SOLUTION

Accepted Solutions
KhalilAzouz
Associate

Thank you for your quick reply,

I figured out the issue; I commented some lines in DMA_handler by mistake.

after reverting it, it works fine with me

Thank you

View solution in original post

3 REPLIES 3
gbm
Lead III

What code?

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

> code got stuck after calling "HAL_SPI_Transmit_DMA"

What is "code got stuck"? Where does the program counter point in disasm window?

> Must SPI1 work with DMA1channel3

waclawekjan_0-1687726729444.png

JW

KhalilAzouz
Associate

Thank you for your quick reply,

I figured out the issue; I commented some lines in DMA_handler by mistake.

after reverting it, it works fine with me

Thank you