Skip to main content
Associate III
Nov 17, 2026 7:37 PM UTC

Two drives appear to be represented by the same FileX media pointer, and access fails after an overcurrent event.

Hi,


split from this thread USBX Debug Logging | Community
I am running:

  • CubeIDE               2.2.0
  • CubeMX              6.18.1
  • H5 MCU Package    1.7.0
  • FileX             6.4.0
  • USBX              6.4.0
  • ThreadX           6.4.0

I guess I do not understand what the UX_ENABLE_DEBUG_LOG macro does, I assumed it would cause

the USBX stack to generate a slew of debug messages, which I could post-process, and maybe shine some

light on a problem I as trying to debug. Now that I know it does nothing, I can understand why the

code doesn’t compile, as there is no need to enable UX_ENABLE_DEBUG_LOG.

The change I made was just to get it to compile, in usbx/common/core/src/ux_utility_debug_log.c I disabled

the following statements, as the variable ‘source’ does not exist.

#if 0
    /* Calculate the string length.  */
    debug_location_string_length = UX_DEBUG_LOG_SIZE;
    _ux_utility_string_length_check(source, &debug_location_string_length, UX_DEBUG_LOG_SIZE);
    debug_message_string_length = UX_DEBUG_LOG_SIZE;
    _ux_utility_string_length_check(source, &debug_message_string_length, UX_DEBUG_LOG_SIZE);
#endif
 

Anyways, my problem is as follows:

I have to USB sticks plugged into ports on the USB hub chip. The USB hub and USB sticks (flash drives)

get enumerated by USBX (correctly or not?).

I cause an Over Current event on one of the USB sticks, causing the Hub to disable VBUS 5 volt power to the overcurrent port. Then I try and create,write,read a file on the other USB stick, and it fails? That is my issue, I did verify the VBUS 5V is active for the second USB stick. I was expecting the second USB stick to be able to create,read,write a FileX file.

When I process the Event callbacks from the USBX stack, I get a DEVICE_INSERTION event for both flash drives,

and I save the FX_MEDIA pointer so that I can later use FileX API’s.

Befor the Over Current event, I printed out both of the FX_MEDIA pointers (one for each USB port/stick), and noticed that they were the exact same pointers? I would assume they would be unique pointers. Could there be a bug in the HUB Host class software which causes this? 

Thanks

Ken

2 replies

ST Technical Moderator
Nov 18, 2026 7:11 PM UTC

Hi ​@microcoder 

The logging problem should be tracked separately; it is not an established cause of the storage failure.

To better align with the ST Community guidelines, we recommend addressing issues one at a time in separate posts rather than providing direct support for an entire project.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
Associate III
Nov 18, 2026 7:14 PM UTC

@FBL Totally agree, sorry.