eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
146 stars 87 forks source link

USB Host Stack not functional with UX_HOST_STANDALONE defined #167

Open Ryzee119 opened 1 month ago

Ryzee119 commented 1 month ago

Describe the bug The USB Host Stack does not function when trying to use it with UX_HOST_STANDALONE..

To Reproduce Steps to reproduce the behavior:

  1. Compile project with UX_HOST_STANDALONE
  2. I happened to be using the OHCI backend but would be valid for any backend.

Some issues that I identified early in the device state machine:

_ux_host_stack_rh_port_rese does not return a UX_STATE value. So the status value is invalid here. https://github.com/eclipse-threadx/usbx/blob/331a6694abd6e042080e69af5b290c76aa3c3424/common/core/src/ux_host_stack_tasks_run.c#L535

‎_ux_host_stack_rh_port_reset‎ also returns UX_PORT_RESET_FAILED because it fails the check on actual_flags as _ux_host_event_flags_get is stubbed out. https://github.com/eclipse-threadx/usbx/blob/331a6694abd6e042080e69af5b290c76aa3c3424/common/usbx_host_controllers/src/ux_hcd_ohci_port_reset.c#L118

Not sure if this is intended to function with UX_HOST_STANDALONE or its for testing only?