mirror of
https://github.com/apache/nuttx.git
synced 2026-08-22 22:18:25 +00:00
The packet memory area (PMA) accessors in the M0 USB device driver were carried over from the STM32F1 implementation, where the PMA is seen by the CPU as 16-bit values placed on 32-bit boundaries. On the STM32F0, STM32L0 and other M0 parts the PMA is a linear 16-bit memory, so the F1 scaling is wrong: - STM32_USB_BTABLE_RADDR() shifted the computed buffer descriptor offset left by one, addressing every second descriptor entry. - The buffer descriptor accessors declared the descriptor entries as uint32_t and accessed them 32 bits at a time, so each write clobbered the adjacent entry. - stm32_copytopma() and stm32_copyfrompma() scaled the PMA offset by two when computing the packet buffer address. The result is that endpoint buffer descriptors and packet data are written to the wrong offsets in packet memory, and no transfer completes correctly. Drop the F1 scaling and use 16-bit accesses throughout. Note that the sibling stm32_usbfs.h defines STM32_USB_BTABLE_RADDR() without the shift already, so this brings the M0 header in line with it. Assisted-by: GitHub Copilot:claude-opus-5 Signed-off-by: jsanchez-2g <jsanchez@2g-eng.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 | ||