Skip to content

Conversation

@sfe-SparkFro
Copy link
Contributor

Summary

HSTX support for the RP2350! Resolves #17111

This implementation is similar to rp2.DMA in that the control registers values are created with pack functions. The FIFO registers are accessed with special functions. It also supports the buffer protocol (write only) so DMA transfers are relatively simple.

Note that this implementation is entirely application agnostic, unlike other HSTX implementations (which often just implement DVI, and end up hogging specific resources for it).

Testing

I've created 2 demos here. The first is a simple blink, the second is a DVI implementation.

Both tested to work with the following:

Though it should work with any RP2350 board and appropriate hardware to run the DVI example.

Trade-offs and Alternatives

On my machine, this adds 1852 bytes (+0.59%) to the RPI_PICO2 build. IMO this is worth the extra functionality for the reasons outlined in #17111.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
@sfe-SparkFro
Copy link
Contributor Author

Oh also, would be good to implement this #17692 (comment) so Pin.ALT_HSTX can be used!

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Code size report:

Reference:  shared/tinyusb: Remove macro guard for tx_overwritabe_if_not_connected. [207562d]
Comparison: rp2/hstx: Drain FIFO after soft reset. [merge of 74ee1eb]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge
Copy link
Member

Thanks for this, it looks good! I'll need to test it.

Eventually it will need docs, and ideally a test.

@sfe-SparkFro
Copy link
Contributor Author

Great to hear, thanks!

Also, this PR would benefit greatly from #18458 so the alt function can be set without the use of machine.mem32 😆

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
@sfe-SparkFro
Copy link
Contributor Author

Eventually it will need docs

First draft in 4f2c806!

Has to be done in `init()` instead of `deinit()`, because
there could be a DMA channel still filling the FIFO when
`deinit()` gets called.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HSTX Support for RP2350

2 participants