20 Commits

Author SHA1 Message Date
ALTracer
caaf002f09 usb/dwc: Enable (unaligned) access to OTG_FIFO for ARMv8-M Main 2025-09-21 16:52:00 +03:00
Stoyan Shopov
49e347923b Fix usb_dwc_common.c endpoint initialization
This commit addresses libopencm3 issue #1242:
https://github.com/libopencm3/libopencm3/issues/1242
2025-07-13 10:32:00 +01:00
dragonmux
7e4a6334a1 usb/dwc: Cleanup in the setup interrupt handling and IN endpoint handling 2025-07-11 20:26:35 -07:00
dragonmux
c3d972632a usb/dwc: Fixed how the endpoints were configured and brought up during endpoint setup for the H7 2025-07-11 20:26:35 -07:00
dragonmux
484bfee238 usb/dwc: const-correctness improvements 2025-07-11 20:26:35 -07:00
dragonmux
adb4f73125 usb/dwc: Fixed a whole lot of constants issues in the common header 2025-07-11 20:26:35 -07:00
dragonmux
6b4592c82d usb/dwc: Corrected how interrupts are handled for the H7's DWC2 so that setup and out packets are properly acknowledged 2025-07-11 20:26:35 -07:00
dragonmux
5e6c423100 usb/dwc: Corrected how packets are read and unloaded from the DWC2 FIFOs on the H7 2025-07-11 20:26:35 -07:00
dragonmux
d9779685ae usb/dwc: Further implementation cleanup to fix integer conversions issues 2025-07-11 20:26:35 -07:00
dragonmux
7851b5e4a5 usb/dwc: Cleaned up in the endpoint setup implementation to improve const-ness 2025-07-11 20:26:35 -07:00
dragonmux
714e7b1c91 usb/dwc: Corrected how packets are written and loaded to the DWC2 FIFOs on the H7 2025-07-11 20:26:35 -07:00
dragonmux
7da573f9eb usb/dwc: Fixed some issues with how interrupts were being handled for the H7's DWC2 variant 2025-07-11 20:26:35 -07:00
dragonmux
76ba8900e3 usb/dwc: Fixed how the control endpoints are configured when built for STM32H7 2025-07-11 20:26:35 -07:00
dragonmux
22ef380fbf usb: Fixed up the number of endpoints defined in the control structures 2025-07-11 20:26:35 -07:00
dragonmux
61ed913de9 usb/dwc: Fixed the endpoint count being wrong on some devices as the DWC does not have a fixed endpoint count 2025-07-11 20:26:35 -07:00
dragonmux
6ef29be9dd usb/usb_dwc_common: Removed the unnecessary and standards-forbidden (void *) casts from the callback registrations 2025-07-11 19:18:13 -07:00
dragonmux
60ff345798 usb: Begun implementing support into the USB device machinary for BOS descriptors 2025-07-11 19:14:29 -07:00
Karl Palsson
26ab78a710 usb: fix race between setup complete and endpoint nak
See https://github.com/libopencm3/libopencm3/issues/873

Commentary describing this patch originally by zyp:

```
After looking further into it, I've concluded that my preliminary
analysis looks correct. The problem is that setting CNAK before
the SETUP complete event is received causes a race condition. The
SETUP callback is called when the SETUP packet event is received,
which means that setting CNAK from the callback is too early.

Originally the problem was that CNAK was set by ep_read() which is
called by the callback. #672 solved this by moving CNAK out of
ep_read() and calling it after the SETUP complete event is received
instead.

The regression by #785 is caused by the introduction of flow control
calls into the SETUP callback. They also set CNAK.

To solve this properly, I propose changing the event handling code
to only call the SETUP callback after the SETUP complete event is
received. Unfortunately, this implies that the callback can't call
ep_read() itself anymore, because the packet has to be read out of
the FIFO before the SETUP complete event arrives. This implies a
change of the API between the hardware drivers and _usbd_control_setup().
```

L1 (st_usbfs) works and passes tests as before change
F4 (dwc_otg_fs) works and now passes tests. (yay)
LM4f still compiles, and has had the same style of implementation as
st_usbfs, however has not been tested on any hardware.
2018-08-27 15:11:32 +00:00
Sebastian Holzapfel
a0669421e1 usb-dwc: handle any-aligned buffers
This is required to support armv6m targets using this code.
2018-03-02 22:42:05 +00:00
Sebastian Holzapfel
a2ee90fbfe usb: stm32fx07 -> usb_dwc_common
The stm32fx07 is common DesignWare IP, used in both STM32 and EFM32 chips.
Rename the files to make this more clear, and easier to use in other
targets.
2018-03-02 22:42:05 +00:00