Closed beserge closed 2 years ago
1 files ±0 16 suites ±0 0s :stopwatch: ±0s 150 tests ±0 150 :heavy_check_mark: ±0 0 :zzz: ±0 0 :x: ±0
Results for commit 9dcd89f0. ± Comparison against base commit 3b0174e3.
:recycle: This comment has been updated with latest results.
I ran each of the examples/uart tests on the Daisy Patch. All RX examples were fed by a Field running the Blocking TX example. All TX was verified with my logic analyzer. If it's not mentioned here, it worked fine.
These examples are written with a simple dma flag to avoid the blocking call being interrupted by the dma call.
If you try to write it in a more normal manner
HAL_UART_STATE_BUSYRX/TX
I tried using the ScopedIrqBlocker in the BlockingTx/Rx to avoid being interrupted by the DMA. However, this causes the blocking call to get stuck forever. I think there's an internal cb which readies gets the blocking call ready which we're blocking in addition to the dma. Unless we have a good way to block the DMA cb, but not whatever HAL cb we need here, I think the flag based method I used in the tests is OK for now. This is sort of an edge case anyways.
I tried using the ScopedIrqBlocker in the BlockingTx/Rx to avoid being interrupted by the DMA. However, this causes the blocking call to get stuck forever.
This is because the blocking functions use HAL_Delay()
which waits for the SysTick variable to increment, and if IRQs are blocked, that will never increment.
I don't think it would be the worst to require that a peripheral use only one method-type (i.e. DMA or blocking) for both rx/tx since the peripheral is linked, but I am open to other solutions. That said, it seems like a limitation of how the HAL's state machine within the UART peripheral is configured.
Each of these was tested on USART_1
and USART_3
, along with concurrent audio passthrough.
Blocking_Receive
example. Data was sent from Blocking_Transmit
.Blocking_Transmit
example. Data was received by Dma_Receive
.Dma_Receive
example. Data was sent from Blocking_Transmit
.Dma_Fifo_Receive
example. Data was sent by the Dma_Transmit
example. I think this is quite a friendly way to interface with the UART. Definitely my favorite.Dma_Transmit
example. Data was sent received by the Dma_Receive
example, and its correctness verified over USB (it was very speedy)Blocking_Transmit_Dma_Receive
example, sent to a blocking passthrough program with different RX, TX buffers to verify.Dma_Transmit_Blocking_Receive
example, sent to a blocking passthrough program with different RX, TX buffers to verify.Blocking_Transmit_Fifo_Receive
example. This one was fun :).One notable issue that I don't think is mentioned anywhere is the USART_1 - USB conflict. It seems like any USB usage will prevent USART_1 from working as expected in rather unexpected ways. We should probably make a note of that somewhere in the documentation.
Overall, from my testing, it seems like the functionality is solid.
Just about ready to merge this
just two small things:
multi-pin, multi-peripheral support via the config structs and shared DMA