2025-11-10 4:37 AM - last edited on 2025-11-10 4:49 AM by Andrew Neil
Hi! I have a board based on STM32U585CIU, and I'm trying to enable a USB CDC on it. The problem is: when I generate a project in CubeMX for MDK-ARM, the code I've attached works fine, USB CDC device is being recognized by PC, and I can see messages via COM port. However, once I generate it for CubeIDE or Makefile, it just goes to hard fault in MX_USBX_Device_Init. Considering it works in Keil uVision, seems like hardware is completely okay, so there is something in the difference between gcc-arm and arm compiler.
2025-11-10 4:52 AM
@CeSium wrote:Considering it works in Keil uVision, seems like hardware is completely okay, so there is something in the difference between gcc-arm and arm compiler.
Seems a reasonable hypothesis.
Have you tried debugging the Hard Fault ?