Skip to content

Pinned the ThreadX simulator tick rate in the Windows test build - #301

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/windows-sim-tick-defaults
Nov 9, 2026
Merged

fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/windows-sim-tick-defaults

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

ThreadX #833 changed the Windows simulators' defaults from a 1 ms timer interrupt processing five ticks to a 10 ms interrupt processing one, so that simulated time follows the host clock. This suite's Windows delays assume five ticks per millisecond, as its CMake comments say. Built against ThreadX dev without that rate, usbx_ux_device_class_storage_vendor_strings_test reconnects the storage device and then gets INQUIRY strings that do not match the ones it configured.

The Windows build now sets TX_TIMER_PERIODIC=1 and TX_WIN32_TICKS_PER_INTERRUPT=5 on the ThreadX target. These equal the port defaults in ThreadX 6.5.2.202603, so nothing changes when building against that release.

Against ThreadX dev at 44b394a3, the Win64 suite passes 433/433 with this change and 432/433 without it. The vendor strings test fails 10 of 10 runs without it and passes 10 of 10 with it.

ThreadX #833 changed the Windows simulators' defaults from a 1 ms timer interrupt
processing five ticks to a 10 ms interrupt processing one, so that simulated time
follows the host clock. This suite's Windows delays assume five ticks per
millisecond, as its CMake comments say. Built against ThreadX dev without that
rate, usbx_ux_device_class_storage_vendor_strings_test reconnects the storage
device and then gets INQUIRY strings that do not match the ones it configured.

The Windows build now sets TX_TIMER_PERIODIC=1 and TX_WIN32_TICKS_PER_INTERRUPT=5
on the ThreadX target. These equal the port defaults in ThreadX 6.5.2.202603, so
nothing changes when building against that release.

Against ThreadX dev at 44b394a3, the Win64 suite passes 433/433 with this change and
432/433 without it. The vendor strings test fails 10 of 10 runs without it and
passes 10 of 10 with it.

Assisted-by: Claude Code (Opus 5.5) <noreply@anthropic.com>
fdesbiens added a commit that referenced this pull request Nov 9, 2026
…302)

After disconnecting, usbx_ux_device_class_storage_vendor_strings_test re-created
the device and reconnected without waiting for the host to remove the old storage
instance, so its readiness check could find that instance and the INQUIRY read the
old strings. Its INQUIRY helper also built the command in the instance's shared CBW
and sent it without the storage lock, while the class thread sends its media checks
through the same CBW.

The test now waits for the removal, as the CDC-ACM tests do, and its INQUIRY helper
holds the storage lock while it builds and sends the command. With the wait alone,
the INQUIRY reached the new instance and collided with a media check, which then
ran a data phase without a buffer and crashed the host simulator.

On Win64 against ThreadX dev, the test failed 10 of 10 runs before the change, with
mismatched strings. With the removal wait alone it failed 10 of 10 with a segfault
in _ux_hcd_sim_host_transaction_schedule. With both parts it passes 10 of 10, and
10 of 10 with the tick settings of #301. Not run on Linux.

Assisted-by: Claude Code (Opus 5.5) <noreply@anthropic.com>
@fdesbiens
fdesbiens merged commit 61e263d into eclipse-threadx:dev Nov 9, 2026
5 checks passed
@fdesbiens
fdesbiens deleted the fix/windows-sim-tick-defaults branch November 9, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant