MaJerle / stm32-usart-uart-dma-rx-tx

STM32 examples for USART using DMA for efficient RX and TX transmission
MIT License
1.35k stars 338 forks source link

USART3 Not Found on F411 Nucleo Board #22

Closed djsg closed 2 years ago

djsg commented 2 years ago

Hi MaJerle,

I want to study your code, but I only have F411 Nucleo board. I found your code for F4 uses UART3 with PD8,9 and Tx/Rx pins. They are not available on my board. Yet, I want to try your code. Any suggestion?

MaJerle commented 2 years ago

That would be shortly.

djsg commented 2 years ago

I am studying your usart_rx_idle_line_irq code. There are 3 events when you try to copy out Rx buffer: half Rx done, full Rx done, and idle line. I wonder what triggers the idle line event. I didn't get a clear understanding from the reference manual.

Have you tested a case, in which you're expecting to receive a big chunk of data, and you need multiple full Rx events to fully receive? I wonder how not to lose any bytes. In your code, after trigger, MCU directly works on Rx buffer. There is no way to prevent DMA from updating the Rx buffer while MCU is working on it, is it?

MaJerle commented 2 years ago

I propose you read rradme of this repo.

Dma is write only to rx buffer, cpu is read only. So that can work.

djsg commented 2 years ago

that readme is very informative. Thx.