-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
WIP: driver: uart: stm32: implement async api #14916
Conversation
All checks are passing now. Review history of this comment for details about previous failed status. |
@StefJar Please review. Thanks! RX is working well. TX still has some issues. |
62186f0
to
5726f64
Compare
71015e6
to
cc1f3fe
Compare
Enable UART DMA configurations for all STM32F4 SoCs. Signed-off-by: Jun Li <jun.r.li@intel.com>
enable two dmas to support async uart. Signed-off-by: Jun Li <jun.r.li@intel.com>
Implement asycn UART APIs by enabling DMA transmission between UART and the data buffer. * Enabled replacing RX buffer * If the replacing buffer is same as the current one, no replacement * Fixed RX buffer counter issue * Reformatted event function names. * Make sure the buffer replacement happens only when the current one is full. * Use an inline `async_timer_start` to do timer starting job. * rebased with c99 types Signed-off-by: Jun Li <jun.r.li@intel.com>
Define UART_DEV_NAME as "UART_6" if the board nucleo_f429zi is selected. Signed-off-by: Jun Li <jun.r.li@intel.com>
chained read buffer needs to rotate. Signed-off-by: Jun Li <jun.r.li@intel.com>
Signed-off-by: Jun Li <jun.r.li@intel.com>
Hello @jli157
Here I tried to add some info in the prints. Lines with "DMA" report id=5 max_streams=7 source_periph=0 (mem) busy=0 src_size=dst_size=1; the RX lines print data that don't seem real. |
For testing purpose, it could be removed after the PR is finished. Signed-off-by: Jun Li <jun.r.li@intel.com>
Hi The loopback test is conducted actually on the same port of the same board. You need to connect the TX pin to the RX pin of the same UART port before running the tests. Anyway, this PR has not fully gone through the uart async test cases. Some cases fails without obvious reasons. Another test it could be helpful to you is the newest patch I just uploaded (7e1609f): you can use a FTDI USB-UART cable to connect your computer and the board, and run the python script inside the test directory to see if it works. |
Hi @jli157
I'm investigating on these points and in parallel I'm going now to remove the HW flow control to test a simplified setup. |
Hi @jli157 |
@giansta Thanks for the findings! Yes, please upload your branch so that I can take a look. And sorry for late reply. Got busy on other stuffs recently. |
Hi @jli157 |
@jli157
I changed it into PERIPHERAL_TO_MEMORY and my test were running the same, most probably because source_burst_length or dest_burst_length are normally the same in my use cases. Anyway, it would be nice if you could confirm that it's not breaking the test in your platform. |
Thank you! I'll take a look at your patches? Can I merge parts of them (or maybe full) into this PR if they do fix the same issues on F4 as well? I'd like to ask you to be the co-authors of this PR. |
It would be perfect, please merge and/or amend them if needed. Thanks! |
@jli157 I have rebased my branch and added some commits. Now six tests of eight are passing on our platform. I rather tried to use again the Circular buffer mode. Another point is the errors handling. Now our board is using the HW flow control and everything seems to work fine. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
By using DMA transfer, implement UART Async API for STM32F4 boards. So far, it is still under development and some issues still exist:
/tests/drivers/uart/uart_async_api
So, the current one is just for review and to get suggestions.
The test vehicle is a NUCLEO F429ZI board.
The PR is trying to resolve the issue: #13955, and base on PR #25459 and #25492
Also, parts of the implementation referred to the implementation from @StefJar.