Skip to content

Conversation

@roma-jam
Copy link

@roma-jam roma-jam commented Nov 20, 2025

Description

This is a first part of moving to v0.20.0.

Changes include pure tag 0.20.0 merged on top of the branch release/v0.19 (with partial limitation fix from #69).

Notes

As the release "v0.19.0~2" wasn't pulblished yet, this changes will take place over the stable release v0.18.0~6. Published 24.11.2025

The merging logic:

  • Create the branch release/v0.20 from the release/v0.19, tag v0.19.0.2
  • Make a merge from the pure tag 0.20.0 from the upstream
  • Solve the conflicts with listing them in here
  • Create a PR to the release/v0.20 (this PR)

Limitations

  • Blocked by snprintf in tusb_debug.c

Additional notes

Conflicts, found during merging with 0.20.0:

tusb_common.h:

dcd_dwc2.c:

  • Fixed more alert found by PVS-Studio (accept incoming changes)

ArcaneNibble and others added 30 commits September 13, 2025 22:05
This code is written very carefully to always use an uncached view
of memory to read/write EDs. An uncached view must *always* be used,
or else cache behavior can corrupt the ED.

As part of this change, combine access into as few word-sized accesses
as possible. This makes the code perform better. Doing this involves
giving type names to the bitfields that make up the ED's data words.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: Mengsk <admin@hifiphile.com>
Signed-off-by: Mengsk <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: Mengsk <admin@hifiphile.com>
Signed-off-by: Mengsk <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
All four of these examples immediately crashed on stack overflow when
connected, at least on a FRDM_K64F board.

In 46fd822 the default freertos stack size was increased, but
_only_ for stm32?  Perhaps either all platform examples need the default
increased, rather than increasing the problem task stacks as is done
here.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
dwc2 requires manually toggle Even/Odd bit manually for ISO IN transfer,
that's poses a problem when bInterval > 1 mainly for audio class, as the
moment the transfer is scheduled, we don't know when the host will issue
IN token (bInterval vs bRefresh schenanigans).

Linux driver use NAK interrupt to detect when the host is sending IN token
and toggle the Even/Odd bit accordingly based on the current frame number
and bInterval.

However on ST's stripped down DWC2 FS controller (e.g STM32F4, STM32F7),
NAK interrupt is not supported, even it's marked as always present in DWC2
databook. NAK interrupt is only supported on HS controller with external PHY.

Instead I schedule all ISO IN transfer for next frame, if the transfer failed,
incomplete isochronous IN transfer interrupt will be triggered and we can
relaunch the transfer.

Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: Mengsk <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
remove dcd_esp32sx which is replaced by dwc2
hathach and others added 25 commits November 19, 2025 11:32
# Conflicts:
#	examples/device/dfu/src/usb_descriptors.c
#	examples/device/dfu_runtime/src/usb_descriptors.c
#	src/device/usbd_control.c
#	src/portable/synopsys/dwc2/dcd_dwc2.c
use uint8_t for dfu state and status to reduce size
dcd/dwc2: fix EP0 multi-packet transfer logic
dcd/dwc2: support ISO IN transfer when bInterval > 1
osal/none: add nested count to spin lock
host/dwc2: cleanup transfer on device close
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
dwc2 requires manually toggle Even/Odd bit manually for ISO IN transfer,
that's poses a problem when bInterval > 1 mainly for audio class, as the
moment the transfer is scheduled, we don't know when the host will issue
IN token (bInterval vs bRefresh schenanigans).

Linux driver use NAK interrupt to detect when the host is sending IN token
and toggle the Even/Odd bit accordingly based on the current frame number
and bInterval.

However on ST's stripped down DWC2 FS controller (e.g STM32F4, STM32F7),
NAK interrupt is not supported, even it's marked as always present in DWC2
databook. NAK interrupt is only supported on HS controller with external PHY.

Instead I schedule all ISO IN transfer for next frame, if the transfer failed,
incomplete isochronous IN transfer interrupt will be triggered and we can
relaunch the transfer.

This is a combination of 4 commits, including:
- dwc2: support ISO IN transfer when bInterval > 1
- Retry until bInterval
- Simply restart the transfer
- extract to handle_incomplete_iso_in() for readability

Signed-off-by: HiFiPhile <admin@hifiphile.com>
This is a combination of 3 commits:
- Fix preset with espressif
- dcd/dwc2: fix enumration when EP0 size=8
- dcd/dwc2: cleanup previous pending EP0 IN transfer if a SETUP packet is received

Signed-off-by: Mengsk <admin@hifiphile.com>
@roma-jam
Copy link
Author

Closed and re-opened in from the branach with *_v0.20 postfix in the name.

@roma-jam roma-jam closed this Nov 26, 2025
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.