-
Notifications
You must be signed in to change notification settings - Fork 7.3k
STM32 UART DRIVER : add support for buffer circular mode #80921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32 UART DRIVER : add support for buffer circular mode #80921
Conversation
5528a3b
to
69501cb
Compare
I have not analyzed the PR in detail, but saw some fragments of code that could possibly touching a solution to discussion in: |
69501cb
to
947391d
Compare
28188de
to
0c00ab2
Compare
b2f4f3c
to
3e3832b
Compare
57ac9d1
to
1ed34bc
Compare
samples/boards/st/uart/circular_dma/boards/nucleo_c031c6.overlay
Outdated
Show resolved
Hide resolved
1ed34bc
to
98d3974
Compare
samples/boards/st/uart/circular_dma/boards/nucleo_c031c6.overlay
Outdated
Show resolved
Hide resolved
samples/boards/st/uart/circular_dma/boards/nucleo_f091rc.overlay
Outdated
Show resolved
Hide resolved
f10dc6c
to
74b3e52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
samples/boards/st/uart/circular_dma/boards/nucleo_c031c6.overlay
Outdated
Show resolved
Hide resolved
samples/boards/st/uart/circular_dma/boards/nucleo_f091rc.overlay
Outdated
Show resolved
Hide resolved
samples/boards/st/uart/circular_dma/boards/nucleo_g071rb.overlay
Outdated
Show resolved
Hide resolved
7887fbe
to
4d136e6
Compare
This macro will help us to enable the 5th bit CIRC on the DMA_CCRx register for all stm32 series having this configuration. Thus the DMA will be able to handle the circular buffers. Signed-off-by: Fabrice DJIATSA <[email protected]> co-authored-by: Cyril Fougeray <[email protected]>
the following implementations are added: - set cyclic variable to handle circular/normal mode : enable dest/source_reload_en variable to set CIRC bit to 1 for RX or TX. - DMA_STATUS_COMPLETE(0), DMA_STATUS_BLOCK(1) macros to handle half and full irq - add ASYNC_UART_STATUS_TIMEOUT(3) macro to work with default mode - add status input in uart_stm32_dma_rx_flush function to handle async events depending on the mode we are in. Signed-off-by: Fabrice DJIATSA <[email protected]> co-authored-by: Cyril Fougeray <[email protected]>
This code example will demonstrate how to use uart circular mode on STM32 boards. Signed-off-by: Fabrice DJIATSA <[email protected]>
4d136e6
to
9936356
Compare
will try that hopefully today! EDIT: works first try by using same DTS as in overlay :) |
This PR introduces the implementation of the circular mode in the uart communication on the stm32 driver.
It is inspired by this commit 7275280#diff-54bdff4ff3a16e194201b66e24cada279fdfdd40dfd66b1df3df3a99d0f65cd0R1007 made by @fouge
The cyclic mode will be configured from the devicetree and will also have the management of the dma buffer with the integration of the half full and full irq .
This implementation is compatible with all STM32 series that have the CIRC bit at the 5th position of the DMA_CCRx register.
A sample driver has been made available and tested on the C0, F0 and G0 series with communication speeds reaching up to 500kbps.
Fixes #79831