mirror of
https://github.com/apache/nuttx.git
synced 2026-08-28 21:00:44 +00:00
Per the RP2040 datasheet section 4.1.2.5.1, when handing a buffer to the USB controller the AVAILABLE bit must be written after the rest of the buffer-control register (length and data PID) and after a short delay, because buffer control crosses from the system clock domain into the USB clock domain. Writing everything in a single store risks the controller acting on a stale length or PID. rp2040_update_buffer_control() wrote the whole word, AVAILABLE included, in one access. Follow the sequence the datasheet (and the Pico SDK) use: write the control word with AVAILABLE cleared, wait ~12 CPU cycles, then set AVAILABLE. The delay covers system clocks up to 12x the 48 MHz USB clock. Validated on raspberrypi-pico (RP2040) as part of bringing up cdcncm; no regression on cdcacm/usbmsc. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHJRvWeBMTHwzpwjaUg4HW Signed-off-by: Ricard Rosson <ricard@groundbits.com> |
||
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| avr | ||
| ceva | ||
| dummy | ||
| hc | ||
| mips | ||
| misoc | ||
| or1k | ||
| renesas | ||
| risc-v | ||
| sim | ||
| sparc | ||
| tricore | ||
| x86 | ||
| x86_64 | ||
| xtensa | ||
| z16 | ||
| z80 | ||
| CMakeLists.txt | ||
| Kconfig | ||