2025-08-19 7:17 AM
As the title says.
I am using STM32H523RCT6 with no RTOS (no ThreadX) and USBX in Standalone mode.
The code is basically:
MX_USB_PCD_Init();
MX_USBX_Device_Init();
HAL_PCD_Start(&hpcd_USB_DRD_FS);
Which executes, but as soon as the USB_DRD_FS_IRQHandler is called, I run into a hard fault. The trace is:
USB_DRD_FS_IRQHandler()
HAL_PCD_IRQHandler
HAL_PCD_ResetCallback
_ux_dcd_stm32_initialize_complete
at
/* Create the default control endpoint attached to the device.
Once this endpoint is enabled, the host can then send a setup packet
The device controller will receive it and will call the setup function
module. */
dcd -> ux_slave_dcd_function(dcd, UX_DCD_CREATE_ENDPOINT,
(VOID *) &device -> ux_slave_device_control_endpoint);
the USB_FNR register shows LSOF 0x3 as well as the LCK and RXDP bit set and the USB_ISTR has the bits ESOF, SOF, RST_DCON and SUSP set.
Please help, I've already lost way too much time on this.