← index #17111PR #18345
Duplicate · high · value 1.667
QUERY · ISSUE

HSTX Support for RP2350

openby sfe-SparkFroopened 2025-04-10updated 2025-10-29
enhancementport-rp2

Description

Would love for the RP2350's HSTX peripheral to be available in MicroPython! It provides an interface for outputting data ludicrously fast (8 GPIO pins (GPIO 12-19 only), DDR on each clock cycle, so up to 2.4Gbps without any overclocking), very useful for things like displays. Would be a part of the rp2 module, only on RP2350 boards (not supported on RP2040).

Section 12.11 of the RP2350 datasheet provides more details about the hardware. There are also a couple examples from the pico-examples repo.

As I understand it, basically just need to gpio_set_function(<GPIO 12-19>, GPIO_FUNC_HSTX), configure the hardware peripheral hstx_ctrl_hw (from hardware/structs/hstx_ctrl.h using macros from hardware/regs/hstx_ctrl.h), then send data to the FIFO buffer hstx_fifo_hw (from hardware/structs/hstx_fifo.h using macros from hardware/regs/hstx_fifo.h). I believe it's also possible to have the DMA feed the HSTX FIFO, DREQ_HSTX is a member of the DMA's dreq_num_rp2350, which should be made available in MicroPython.

Code Size

IMO this should always be enabled for RP2350 boards as part of the rp2 module, similar to the PIO and DMA features. Not expecting it to be very large.

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

rp2: Add HSTX support.

openby sfe-SparkFroopened 2025-10-29updated 2025-11-24
port-rp2

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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied