embassy
embassy copied to clipboard
Issue 2059 ringbuffers on gpdma
I still need to do some additional testing on the STM32U545 and STM32F429 before this is ready to merge.
Everything is working on STM32U545. Need to check STM32F429 before merging.
Tested and working on STM32F429 also (with dma). Not tested with BDMA but that has the same API as DMA. The only thing this adds to BDMA is the async stop and the write_immediate to pre-fill the buffer.
Should be ready for review and to merge.
@xoviat @Dirbaio
Please let me know if this needs anything else.
This PR has quite a bit of unrelated things mixed:
- GPDMA ringbuffer support.
- New APIs
stopandwrite_immediate. - U5 RCC support for PLLP/Q
- SAI changes
Could you split them all in separate PRs, so we can discuss/review them independently?
Also, please rebase so you don't add merge commits to the history.
Additionally, now that this adds ringbuffers on GPDMA, we should enable the ringbuffered uart test for it. Could you do it?
- Remove this https://github.com/embassy-rs/embassy/blob/main/tests/stm32/src/bin/usart_rx_ringbuffered.rs#L1
- Remove all mentions to
not-gpdmain Cargo.toml https://github.com/embassy-rs/embassy/blob/main/tests/stm32/Cargo.toml - Run
gen_test.py
@Dirbaio,
Sounds good. I will work on that.
STM32 U5 changes moved to: https://github.com/embassy-rs/embassy/pull/2396 Add write_immediate() function: https://github.com/embassy-rs/embassy/pull/2397 Add stop() function: https://github.com/embassy-rs/embassy/pull/2399
I will create another MR with the GPDMA ring buffers once the above are merged. Then one more MR to address the tweaks to the SAI driver that add the write_immediate() and stop() functions.
@tyler-gilbert Interested in this as well, what is holding it back at the moment? I can test on STM32H5 and H7 and maybe contribute something.
Bump. @tyler-gilbert is there any other PR blocking this yet? Can I help in any way?
I have broken this PR into several different PRs. This PR won't get merged. Awhile back I merged some supporting PRs but didn't get the GPDMA piece in.
This branch had a working implementation of the GPDMA circular buffer: https://github.com/tyler-gilbert/embassy/blob/issue-2059-ringbuffers-on-gpdma/embassy-stm32/src/dma/gpdma.rs. The solution is stale now. The DMA modules have been cleaned up but it doesn't look like major differences.
@Luctins I was testing on the SAI driver. I never did any work with the UART. The UART might need another feature where the idle line is used to trigger data received (https://blog.stratifylabs.dev/device/2021-12-30-UART-FIFO-with-DMA-on-STM32/).
The project driving this got put on the back burner, but I am finally getting to a place where I can start working on it again. Best case scenario, is I can get a new PR in the next few weeks.
@tyler-gilbert Ah, yes that makes sense.
I'm going to see if I can make the GPDMA work with the new modules then, thanks for the directions.
@Luctins I was testing on the SAI driver. I never did any work with the UART. The UART might need another feature where the idle line is used to trigger data received (https://blog.stratifylabs.dev/device/2021-12-30-UART-FIFO-with-DMA-on-STM32/).
My bad, I mixed up GpdmaRingubuffer support in general with the RigbufferedUart. (but that is my intended target for this)
Maybe you should close this PR, since it's not going to get merged?
This PR is stale. Some changes have already been merged. Others (including GPDMA circular transfers) will have to come in a later PR.