Skip to main content
Associate
September 11, 2026
Question

USBX Mass Storage Class device (hard fault)

  • September 11, 2026
  • 0 replies
  • 3 views

I’m trying to implement USB mass storage class device standalone(no RTOS) on nucleo board STM32U575ZI-Q, using RAM for memory.

I tried adapting these steps :

 

but right now, in MX_USBX_Init(), inside  ux_device_stack_initialize  , at this point:

#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0

/* Obtain some memory. */
endpoints_pool -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer =
_ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, UX_SLAVE_REQUEST_DATA_MAX_LENGTH);

/* Ensure we could allocate memory. */
if (endpoints_pool -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer == UX_NULL)
{
status = UX_MEMORY_INSUFFICIENT;
break;
}
#endif

it goes : 

status = UX_MEMORY_INSUFFICIENT;

Because of that, ux_device_stack_initialize returns UX_ERROR;  witch i think causes Hard fault.

 

This happens before any code i’ve written, so i must’ve messed up something in the CubeMX configuration or i missed some step of the initialization?

 

I’ve increased USBX memory pool size to 32kB and USBX System Stack Size to 10kB but nothing changed.

 

 

i’m really stuck here, any help would be appreciated