Skip to content

Fix freeing reusable host periodic transfer buffer - #8

Open
leejugy wants to merge 1 commit into
STMicroelectronics:mainfrom
leejugy:fix/stm32-host-periodic-buffer-free
Open

leejugy wants to merge 1 commit into
STMicroelectronics:mainfrom
leejugy:fix/stm32-host-periodic-buffer-free

Conversation

@leejugy

@leejugy leejugy commented Aug 19, 2026

Copy link
Copy Markdown

Description

Fixes #6.

_ux_hcd_stm32_periodic_schedule() marks
ux_stm32_ed_data as UX_HCD_STM32_ED_STATUS_ALIGNED_BUFFER_PENDING_FREE
whenever the pointer is non-NULL.

For periodic transfers, ux_stm32_ed_data may point directly to
ux_transfer_request_data_pointer, which is the original reusable
transfer buffer and must not be treated as an HCD-owned aligned buffer.

This change sets PENDING_FREE only when ux_stm32_ed_data differs
from the original transfer request data pointer.

Test

Tested with:

  • STM32H563ZIT6
  • USBX 6.4.0
  • STM32CubeH5 1.7.0
  • GL850 USB hub
  • MSC device connected downstream of the hub

Before the change, repeated HUB Interrupt IN transactions caused the
reusable transfer buffer to be freed and eventually resulted in
UX_MEMORY_CORRUPTED.

After the change, the reusable HUB interrupt buffer remains valid and
the downstream MSC device operates normally.

@MKISTM

MKISTM commented Aug 24, 2026

Copy link
Copy Markdown

ST Internal Reference: 42c389938372c714c09687402fda1ed4

@MKISTM MKISTM added bug Something isn't working usbx Eclipse (prev. Azure RTOS) USBX for USB Host and Device library internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system labels Aug 24, 2026
@MKISTM MKISTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard Aug 24, 2026
@ALABSTM ALABSTM added mw MW-related issue or pull-request usb Universal Serial Bus labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system mw MW-related issue or pull-request usb Universal Serial Bus usbx Eclipse (prev. Azure RTOS) USBX for USB Host and Device library

Projects

Development

Successfully merging this pull request may close these issues.

[Bug]: UX_MEMORY_CORRUPTED return from error callback when using H5 interrupt IN transaction

3 participants