2025-01-02 08:16 AM
Hello,
I’m a beginner working with the STM32H723ZG, and this is my first time trying to implement USB functionality. I’m attempting to set up the USB peripheral in Device mode (CDC) to send audio data from a buffer (filled by SAI via DMA) to a PC.
I’ve configured the USB in Full Speed (12 Mbit/s) mode using the internal PHY in STM32CubeMX and generated the initialization code. However, Windows fails to recognize the device, showing the error "USB device not recognized". I have also downloaded and installed the STMicroelectronics Virtual COM Port (VCP) driver to ensure proper communication.
I found out that the error occurs specifically during the call to MX_USB_DEVICE_Init(); in the initialization process.
After debugging, I traced the issue to the function USB_CoreReset() in stm32h7xx_ll_usb.c, which times out.
USB Configuration in CubeMX:
The clock for USB is set to 48MHz.
I have no idea what I’m missing… Have you got an idea?
PS: The main.c file of my project is attached for reference.
Thank you for your help!
2025-01-02 10:59 AM
How is VDD33USB connected and how do you manage it in software?
JW
2025-01-02 11:24 AM
Thank you for your reply!
I’m unsure about the VDD33USB since I didn’t know I needed to do anything specific about it... However, here is what I’ve done so far:
Hardware Connection:
I am using the STLINK connector (CN1) as the power supply for the NUCLEO-H723ZG board.
I connected the USER USB connector (CN13) to the computer for USB data transfer, as I understood this setup should work without requiring additional connections or external power.
Software Management:
I haven’t made any specific configurations for VDD33USB since I assumed the function HAL_PWREx_EnableUSBVoltageDetector() in MX_USB_DEVICE_Init() manages the USB power automatically. Isn’t this function supposed to handle the USB power setup?
Thank you again for your help!
2025-01-03 01:19 AM
I don't use the 'H7, let alone this particular chip/board, sorry.
Neither do I use Cube/HAL, but generally, it's open source, so you can look up yourself what does it do and what it does not do. The required procedure is outlined in USB regulator subchapter of PWR chapter in Reference Manual (RM).
You can (and should) also always read out the relevant registers and check (here also check clocks setup in RCC).
JW