cancel
Showing results for 
Search instead for 
Did you mean: 

receive data uart with DMA

LOnGr.1
Associate III

I am trying to receive data over usart using dma with LL. I'm stuck with this for one week. I need help please.

11 REPLIES 11

Which STM32?

What are the symptoms? Can you receive from the same pin using polling? Are clocks of DMA, USART, GPIO enabled in RCC?

Read out and check/post content of USART, DMA and relevant GPIO registers' content.

JW

Pavel A.
Evangelist III

Hi! Thank you for replying. I tried to send some text using the LL_USART_TransmitData8 and it works fine. Same for receiving with LL_USART_ReceiveData8.

As for the clocks, they're enabled in the clock file

Which STM32?

Read out and check/post content of USART, DMA and relevant GPIO registers' content.

JW

stm32 f407

I don't know if the image is clear, but all the registers are empty


_legacyfs_online_stmicro_images_0693W00000bhvkAQAQ.png

I put the USART2_DMA_RX inside the while loop in the main file and now the red led (transfer complete interrupt) turns on but only when I reset or flash the microcontroller. I tried to do the same for transmission with DMA and it is working fine

Being all zero suggests the clocks aren't enabled when looking at them.

F​or RX make sure all noise, framing, parity errors etc are cleared first.

C​heck that polled RX works, has to be properly receiving.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yes it works with polling and transmission with DMA also works. All the clocks are enabled, I checked. I even took the configuration of pins from a working code using registers and as always, TX works fine, RX does not

If all the UART registers are zero, Tx can't work. It means, you've read out the registers content while UART and DMA were not set up yet - just after reset, perhaps? That's not useful.

Read out the registers after they've been set up, and then again after some characters have been sent to Rx; check, compare, post.

JW