2026-03-11 8:18 AM - edited 2026-03-11 8:58 PM
I’m trying to get a USB Full-Speed Host Mass Storage example running on the STM32H753I-EVAL2 using ThreadX, USBX, and FileX.
I’ve generated the base project from CubeMX, but I’m running into a few issues:
VBUS Enable/Detection:
Memory Pool & Stack Sizes:
I’m looking for:
Any example projects, tips, or guidance would be greatly appreciated.
Thanks in advance!
Solved! Go to Solution.
2026-03-13 1:36 AM
My Bad.
USB drive was originally formatted with GPT (GUID Partition Table) instead of the classic MBR partition table.
Properly formatting the USB drive solved the issue
2026-03-12 1:58 AM
Hi @pranavps & welcome to ST Community,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-03-12 4:52 AM
Hi
Thank you for the response.
Regarding VBUS management, on the STM32H753I-EVAL2 board the VBUS power switch is controlled through the MFX IO expander and not directly by a GPIO. Initially, VBUS was not getting enabled properly in host mode.
To resolve this, I had to initialize the MFX device through I2C and enable the VBUS power switch using the BSP IO driver. After adding the proper BSP initialization sequence, VBUS started enabling correctly and the USB device could be detected.
Once this was fixed, the USB MSC device enumeration works correctly, and I get the following output:
**** USB OTG FS MSC Host ****
USB Host library started.
Starting MSC Application
Connect your MSC Device
STarting msc_process_thread_entry
USB Mass Storage Device Plugged
PID: 0x2003
VID: 0x3f0
*** Start Files operations ***
ERROR: !! Could Not Create TEST.TXT File !!
While debugging further, I found that the failure occurs in FileX when creating the file. The error originates from _fx_file_create() returning FX_MEDIA_NOT_OPEN:
if (media_ptr -> fx_media_id != FX_MEDIA_ID)
{
/* Return the media not opened error. */
return(FX_MEDIA_NOT_OPEN);
}
So it appears that the FileX media is not successfully opened before the file operation, even though the USB device is detected and enumerated.
For memory configuration, I am currently using:
#define USE_STATIC_ALLOCATION 1
#define TX_APP_MEM_POOL_SIZE 1024
#define FX_APP_MEM_POOL_SIZE (1024 * 2)
#define UX_APP_MEM_POOL_SIZE (1024 * 64)
#define UX_HOST_APP_THREAD_STACK_SIZE 1024
#define UX_MSC_APP_THREAD_STACK_SIZE (1024 * 2)
The implementation is adapted from the STM32H735G-DK USBX MSC Host example in the X-CUBE-AZRTOS-H7 repository.
Also attaching the main and ld file
Please let me know if you suspect this could be related to:
FileX media initialization
memory pool size
Thanks again for the guidance.
2026-03-13 1:36 AM
My Bad.
USB drive was originally formatted with GPT (GUID Partition Table) instead of the classic MBR partition table.
Properly formatting the USB drive solved the issue