I'm having problems enabling USB on STM32H503. This happens on both my custom board (STM32H503CBT6-based), as well as on MB1814B (STM32H503RBT6-based). I observe no USB connection, no USB IRQ being invoked, no hardware handshake.
Here's the simplest repro:
1. in STM32CubeIDE, v.1.18.0 (same with v.1.17.0), create a new STM32 project for STM32H503RBT6 core (CBT6 for my board)
2. in .ioc, enable I-Cache, SWD, and USB. In "Middleware and Software Packs", the USBX section, enable "Core System", "Device CoreStack FS", "CDC ACM"
3. close .ioc, build the project
4. connect MB1814B to the host on both sides: USB and ST-Link. In my case, they are connected to the same USB hub, and the hub is powered after both sides are connected
5. flash the compiled firmware
6. notice that the host only sees the piped-through-SWD-end Virtual COM, but fails to see the USB connection on the device side. Observed under debugger, the firmware fails to invoke the USB interrupt. Observed under oscilloscope, it fails to initiate the USB handshake.
Troubleshooting I've done on MB1814B:
1. verified that the jumpers are set correctly for the USB Device configuration: SB1, SB7, SB14 -- off, SB4 and SB8 -- short
2. verified power before and after plugging the device-side USB-C
3. verified that other devices on the chip work fine: PWM, UART, I2C
Similar steps on my custom H503CBT-based device result in similar outcomes. The board has ESD protection on USB lines using USBLC6-2 and it is powered by TLV70233 LDO from the USB-C's VBUS line (the other components are irrelevant to the problem, work correctly, and removing them doesn't fix the problem)
Troubleshooting steps I've done on my board:
1. in debugger, verified that all the obvious IDE-generated init functions are called (they are), the clock and IRQ are enabled (they are), the IRQ vector points to my `USB_DRD_FS_IRQHandler()` handler and not the weak handler (ditto), and that the registers contain the expected values at the start of the forever loop (they do, as far as I can tell)
2. verified power on all VDD pins (3v3 nominal, 3v282 - 3v297 measured), verified my board for shorts, etc. Removed the LDO and powered the board from the bench, verified power consumed
3. swapped the microcontroller on my board just in case
4. removed the USB ESD protection from my board, just in case
5. removed all other devices from my board, just in case
6. hooked up USB_DM and USB_DP lines (PA11 and PA12) to oscilloscope -- no signals on these lines
7. tried to clock USB from both the HSI48 and HSE (24 MHz-based)
8. changed the core's clock between 25 MHz and 250 MHz
9. swapped the USBX to the old USB stack that I last used few months ago on STM32G0
What might be causing this? Thank you very much for your help!