Puya PY32F07x support#3694
Conversation
| }; | ||
| 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 */ |
There was a problem hiding this comment.
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
| | +---------+-------------------+--------+------+-----------+------------------------+--------------------+ | ||
| | | RW61x | ✅ | ✅ | ✅ | ci_hs, ehci | | | ||
| +--------------+-----------------------------+--------+------+-----------+------------------------+--------------------+ | ||
| | Puya | PY32F071, PY32F072 | ✅ | ❌ | ❌ | musb | 1-dir ep | |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
A connect/disconnect requires enabling or disabling the entire block through the APB, doesn't look like it can disconnect the resistor by itself.
|
| target | .text | .rodata | .data | .bss | total | % diff |
|---|---|---|---|---|---|---|
| ek_tm4c123gxl/audio_test | 12,280 → 12,308 (+28) | — | — | — | 12,332 → 12,360 (+28) | +0.2% |
| ek_tm4c123gxl/audio_test_multi_rate | 12,492 → 12,520 (+28) | — | — | — | 12,544 → 12,572 (+28) | +0.2% |
| ek_tm4c123gxl/video_capture | 13,480 → 13,508 (+28) | — | — | — | 13,540 → 13,568 (+28) | +0.2% |
| ek_tm4c123gxl/usbtest | 13,744 → 13,772 (+28) | — | — | — | 13,776 → 13,804 (+28) | +0.2% |
| ek_tm4c123gxl/uac2_headset | 13,804 → 13,832 (+28) | — | — | — | 13,840 → 13,868 (+28) | +0.2% |
| msp_exp432e401y/usbtest | 13,804 → 13,832 (+28) | — | — | — | 14,372 → 14,400 (+28) | +0.2% |
| ek_tm4c123gxl/uac2_speaker_fb | 14,568 → 14,596 (+28) | — | — | — | 14,604 → 14,632 (+28) | +0.2% |
| msp_exp432e401y/audio_test | 12,400 → 12,424 (+24) | — | — | — | 12,988 → 13,012 (+24) | +0.2% |
| msp_exp432e401y/uac2_speaker_fb | 14,756 → 14,784 (+28) | — | — | — | 15,328 → 15,356 (+28) | +0.2% |
| msp_exp432e401y/audio_test_multi_rate | 12,616 → 12,640 (+24) | — | — | — | 13,204 → 13,228 (+24) | +0.2% |
8c0c88e to
9e6e54e
Compare
Hardware-in-the-loop (HIL) Test Reporthfp.json✅ 49 passed · ❌ 7 failed · ⚪ 0 skipped · blank not run
tinyusb-esp.json✅ 10 passed · ❌ 14 failed · ⚪ 0 skipped · blank not run
tinyusb.json✅ 20 passed · ❌ 327 failed · ⚪ 17 skipped · blank not run
|
|
Great job! Also tested to work on PY32F403 (tested: HID and CDC-ACM) with almost no change. |
mind adding the setup that you have for f403? Both the bsp and dcd changes |
Basically nothing, it's register compatible. DCD no change (though you can utilize the 8 (instead of 6) endpoints through minor changes), BSP solely enabled the clock. https://github.com/ImproperCatGirl/PY32F403_USB/ |
|
Thank you, from Codex:
|
fixed by commenting out the line. Should we put in a TU_ASSERT if the ep size exceeds what the hardware can handle?
fixed also have rebased the branch |
We can let hwfifo_config return false as assert is already in dcd_edpt_open, also add assert to dcd_edpt_iso_alloc. |
Signed-off-by: HiFiPhile <admin@hifiphile.com>
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
