embassy icon indicating copy to clipboard operation
embassy copied to clipboard

Issue 2059 ringbuffers on gpdma

Open tyler-gilbert opened this issue 1 year ago • 12 comments

tyler-gilbert avatar Dec 18 '23 00:12 tyler-gilbert

I still need to do some additional testing on the STM32U545 and STM32F429 before this is ready to merge.

tyler-gilbert avatar Dec 18 '23 02:12 tyler-gilbert

Everything is working on STM32U545. Need to check STM32F429 before merging.

tyler-gilbert avatar Dec 18 '23 03:12 tyler-gilbert

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.

tyler-gilbert avatar Dec 24 '23 04:12 tyler-gilbert

Should be ready for review and to merge.

tyler-gilbert avatar Dec 24 '23 04:12 tyler-gilbert

@xoviat @Dirbaio

Please let me know if this needs anything else.

tyler-gilbert avatar Dec 31 '23 00:12 tyler-gilbert

This PR has quite a bit of unrelated things mixed:

  • GPDMA ringbuffer support.
  • New APIs stop and write_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-gpdma in Cargo.toml https://github.com/embassy-rs/embassy/blob/main/tests/stm32/Cargo.toml
  • Run gen_test.py

Dirbaio avatar Jan 01 '24 21:01 Dirbaio

@Dirbaio,

Sounds good. I will work on that.

tyler-gilbert avatar Jan 01 '24 22:01 tyler-gilbert

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 avatar Jan 03 '24 17:01 tyler-gilbert

@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.

elagil avatar Sep 06 '24 21:09 elagil

Bump. @tyler-gilbert is there any other PR blocking this yet? Can I help in any way?

Luctins avatar Oct 21 '24 17:10 Luctins

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 avatar Oct 22 '24 02:10 tyler-gilbert

@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?

Luctins avatar Oct 22 '24 12:10 Luctins

This PR is stale. Some changes have already been merged. Others (including GPDMA circular transfers) will have to come in a later PR.

tyler-gilbert avatar Oct 23 '24 01:10 tyler-gilbert