On the 32F407 is it possible to have DMA USART2 receive terminate on an idle line or say 20mS timeout?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-15 2:47 PM
I´ve read some MCUs support idle line events, but looking through the datasheet can´t see how to implement this.
I could DMA 3 bytes at a time, but best would be to have DMA completion triggered after idle or timeout.
- Labels:
-
DMA
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-15 3:02 PM
Not sure the F4 facilitates that at the U(S)ART level.
You could make a circular DMA RX FIFO, and service that on the 1 KHz / 1 ms tick, and dispatch a call-back, or whatever, via an inactivity counter.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-15 10:52 PM
Yes UART_CR1 has the IDLEIE bit you can set to enable
and the USART_SR register has the IDLE status bit you can check
If you use the HAL drivers you can use HAL_UARTEx_ReceiveToIdle_DMA and HAL_UARTEx_RxEventCallback
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-16 3:14 AM
I've inherited a 2016 project with HAL, the DMA idle functions are in the newer HAL for F407, but if I just drop in the updated HAL driver I get lots of errors.
Same with the CMSIS from 2016, which has moved to the thirdparty folder.
There doesn't seem to be much guidance on upgrading HAL to the newer version, and I don't have time to start a major revision of the code. A pain!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-16 3:15 AM
Thank you Kark, unfortunately this project's 2016 HAL lacks those functions, and ungrading HAL doesn't see a simple process. I tried by swapping in the newer HAL folders, but got 64 errors! Newer HAL doesn't seem to support legacy or I got something mixed up...
