Skip to content

Puya PY32F07x support#3694

Open
rhgndf wants to merge 7 commits into
hathach:masterfrom
rhgndf:py32f0
Open

Puya PY32F07x support#3694
rhgndf wants to merge 7 commits into
hathach:masterfrom
rhgndf:py32f0

Conversation

@rhgndf

@rhgndf rhgndf commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

This adds support for another musb variant, py32f07x. The USB block looks like musb with a modified register layout and a lot of functions stripped out.

I'm evaluating this MCU due to it having USB support (also have DFU and is low cost). I also have HC32F460 and HC32F4A0 if anyone is interested to see a port of those.

Dev board is a generic board, no special name

};
uint16_t length; /* the number of bytes in the buffer */
uint16_t remaining; /* the number of bytes remaining in the buffer */
uint16_t mps; /* maximum packet size */

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adds 2 more bytes to the struct, is this ok? py32's maxp field is in increments of multiples of 8 for packet size, instead of per byte for others

Comment thread README.rst
| +---------+-------------------+--------+------+-----------+------------------------+--------------------+
| | RW61x | ✅ | ✅ | ✅ | ci_hs, ehci | |
+--------------+-----------------------------+--------+------+-----------+------------------------+--------------------+
| Puya | PY32F071, PY32F072 | ✅ | ❌ | ❌ | musb | 1-dir ep |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit more specific than "1-dir ep"? Two dirs are possible with some scheduling, but probably very complex

#if defined(TUP_USBIP_MUSB_PY32)
void dcd_connect(uint8_t rhport)
{
(void) rhport;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A connect/disconnect requires enabling or disabling the entire block through the APB, doesn't look like it can disconnect the resistor by itself.

@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

Top 10 targets by memory change (%) (out of 2404 targets) View Project Dashboard →

target .text .rodata .data .bss total % diff
ek_tm4c123gxl/audio_test 12,164 → 12,180 (+16) 12,216 → 12,232 (+16) +0.1%
ek_tm4c123gxl/audio_test_multi_rate 12,376 → 12,392 (+16) 12,428 → 12,444 (+16) +0.1%
msp_exp432e401y/dfu_runtime 8,960 → 8,948 (-12) 9,528 → 9,516 (-12) -0.1%
ek_tm4c123gxl/video_capture 13,352 → 13,368 (+16) 13,412 → 13,428 (+16) +0.1%
ek_tm4c123gxl/uac2_headset 13,692 → 13,708 (+16) 13,728 → 13,744 (+16) +0.1%
msp_exp432e401y/hid_generic_inout 10,012 → 10,000 (-12) 10,580 → 10,568 (-12) -0.1%
ek_tm4c123gxl/uac2_speaker_fb 14,456 → 14,472 (+16) 14,492 → 14,508 (+16) +0.1%
msp_exp432e401y/hid_multiple_interface 10,796 → 10,784 (-12) 11,364 → 11,352 (-12) -0.1%
msp_exp432e401y/hid_boot_interface 10,808 → 10,796 (-12) 11,376 → 11,364 (-12) -0.1%
ek_tm4c123gxl/cdc_uac2 15,292 → 15,308 (+16) 15,328 → 15,344 (+16) +0.1%

@rhgndf rhgndf force-pushed the py32f0 branch 2 times, most recently from 8c0c88e to 9e6e54e Compare June 18, 2026 09:28
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Hardware-in-the-loop (HIL) Test Report

hfp.json

✅ 52 passed · ❌ 0 failed · ⚪ 0 skipped · blank not run

Board cdc_dual_ports cdc_msc dfu cdc_msc_throughput audio_test_freertos dfu_runtime cdc_msc_freertos hid_boot_interface msc_dual_lun hid_generic_inout printer_to_cdc midi_test mtp
stm32l412nucleo ✅ CDC 630k/406k MSC 826k/763k
stm32f746disco ✅ CDC 13.7M/10.1M MSC 15.5M/28.5M
stm32f746disco-DMA ✅ CDC 12.9M/9.8M MSC 12.7M/30.3M
lpcxpresso43s67 ✅ CDC 12.7M/11.5M MSC 30.6M/33.4M

tinyusb.json

✅ 338 passed · ❌ 1 failed · ⚪ 11 skipped · blank not run

Board cdc_dual_ports cdc_msc dfu cdc_msc_throughput audio_test_freertos dfu_runtime cdc_msc_freertos hid_boot_interface msc_dual_lun hid_generic_inout printer_to_cdc midi_test mtp host_info_to_device_cdc cdc_msc_hid msc_file_explorer msc_file_explorer_freertos device_info hid_composite_freertos
ek_tm4c123gxl ✅ CDC 838k/1M MSC 1M/1M
espressif_p4_function_ev rd 409KB/s
espressif_p4_function_ev-DMA rd 409KB/s
espressif_s3_devkitm rd 409KB/s
espressif_s3_devkitm-DMA
feather_nrf52840_express ✅ CDC 392k/268k MSC 566k/505k
max32666fthr ✅ CDC 7M/14.3M MSC 10.4M/20.5M
metro_m4_express ✅ CDC 505k/257k MSC 565k/513k
mimxrt1015_evk ✅ CDC 8.4M/4.1M MSC 23.4M/18.6M
mimxrt1064_evk ✅ CDC 10M/9.1M MSC 20M/14.9M rd 1365KB/s rd 1365KB/s
lpcxpresso11u37 ✅ CDC 392k/277k MSC 544k/501k
ra4m1_ek ✅ CDC 499k/308k MSC 576k/497k
raspberry_pi_pico ✅ CDC 515k/560k MSC 546k/515k rd 62KB/s rd 62KB/s
raspberry_pi_pico_w rd 1106KB/s rd 1022KB/s
raspberry_pi_pico2 rd 1108KB/s rd 1022KB/s
adafruit_fruit_jam ✅ CDC 583k/541k MSC 618k/537k rd 62KB/s rd 62KB/s
stm32f072disco ✅ CDC 382k/352k MSC 462k/475k
stm32f407disco ✅ CDC 869k/511k MSC 963k/905k
stm32f723disco ✅ CDC 792k/749k MSC 707k/794k rd 18078KB/s rd 4096KB/s
stm32f723disco-DMA ✅ CDC 603k/850k MSC 603k/965k rd 19418KB/s rd 4096KB/s
stm32h743nucleo ✅ CDC 888k/1M MSC 903k/1.1M
stm32h743nucleo-DMA ✅ CDC 645k/959k MSC 734k/977k
stm32g0b1nucleo ✅ CDC 505k/513k MSC 507k/664k
stm32l476disco ✅ CDC 721k/511k MSC 856k/852k
stm32u083nucleo ✅ CDC 452k/510k MSC 549k/582k
nanoch32v203-fsdev ✅ CDC 1M/576k MSC 1.1M/1M
nanoch32v203-usbfs
ch32v103r_r1_1v0 ✅ CDC 511k/508k MSC 521k/566k
ch582m_evt ✅ CDC 201k/218k MSC 435k/481k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant