cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with cubeMX generated code for STM32H755 USB_FS on M4 core ?

MJack.1
Associate III

Hi there,

I have a Nucleo-H755ZI-Q and want to get the CDC driver working with USB_FS on the M4 core. I'm having an issue where USB_CoreReset() HAL function times-out waiting for the USB core to reset. Here's the steps I take to create the issue:

  • Download latest CubeMx and firmware package
  • Start a new project for Nucleo-H755ZI-Q with peripherals set as default.
  • Enable USB_FS on the M4 core and the VCOM middle-ware.
  • Configure clocks so that M7 is at 480MHz, M4 is at 240MHz, running from the 8MHz HSE
  • Configure USB clock to have 48MHz from PLL 1Q
  • Generate code for CubeIDE

The M7 auto-generated project fails to build with "No rule to make target '../Drivers/STM32H7xx_HAL_Driver/stm32h7xx_hal_eth.c"! .. But I'll tackle that issue later..

The M4 project builds and runs. The problem is in USB_CoreReset() at line 196 of stm32h7xx_ll_usb.c. Bit 0 of USBx->GRSTCTL never clears.

There doesn't seem to be a CDC example for this Nucleo. I have tried the same process for a Nucleo-F4 I have lying around, and it worked no problems.

Any help greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
MJack.1
Associate III

Well, I found the issue. CubeMX does not have the ability to let the M4 configure the system clocks, as far as I can tell. It's always done in the M7 core. So I simply copied the clock config code from the M7 main.c to the M4 main.c, and it works.

View solution in original post

1 REPLY 1
MJack.1
Associate III

Well, I found the issue. CubeMX does not have the ability to let the M4 configure the system clocks, as far as I can tell. It's always done in the M7 core. So I simply copied the clock config code from the M7 main.c to the M4 main.c, and it works.