Showing results for 
Search instead for 
Did you mean: 

STM32U5 USB problem

Associate II

I'm having problems with USB on NUCLEO-U575ZI-Q (STM32U575).

I've created from scratch project in CubeIDE for USB CDC ACM device, and set up all th peripherals as in the example STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U575ZI-Q\Applications\USBX\Ux_Device_CDC_ACM - USB_OTG_FS, UCPD1, USART1 and GPDMA. Also I inited ThreadX, USBX and USBPD in the Middleware section identically to the example.

I've checked all the settings in .ioc file, they are identical to one form example, also all the source code is borrowed from the example too and I can't find a difference, but my project doesn't work.

I can't get OTG_FS_IRQ when I attach or reattach USB cable to the board. UCPD1_IRQHandler is happening, but OTG_FS_IRQHandler - not. Also I can't see any difference in USB peripherals in debug mode between my project and example.

I'm attaching my project below.

Appreciate any help.

ST Employee

Hi @ASamo.2 ,

First of all, could you please tell us: is the example STM32Cube_FW_U5_V1.4.0\Projects\NUCLEO-U575ZI-Q\Applications\USBX\Ux_Device_CDC_ACM working properly for you  as is?

Now moving to your project, are heap & stack size set properly for your generated project?


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Amel

Thanks for the reply.

Yes, example project Ux_Device_CDC_ACM works perfect on my board.

Ragerding heap and stack size, they are set to 0x200 for Minimum Heap Size and 0x400 for Minimum Stack Size, just as in example (if you mean stack an heap sizes in Linker Settings on a Project Managet tab). As for stack and pool sizes for ThreadX tasks, they are also sufficient for proper initialization and start of the app.

I attached my project to the previous message. Also, I can attach the example project if you need one for reference, but part of it's dependencies is referenced, so there could be problems with opening and building it on other computer.