2019-07-08 01:03 AM
Hi, I have problem running USB on STM32L412KBT. The code hangs inside MX_USB_DEVICE_Init. Sometimes in function HAL_StatusTypeDef USB_DevInit(USB_TypeDef *USBx, USB_CfgTypeDef cfg) (file stm32l4xx_ll_usb.c), sometimes in function HAL_StatusTypeDef USB_DevConnect(USB_TypeDef *USBx) (the same file).
Any help appreciated...
2019-07-08 03:50 AM
As a quick workaround, while waiting for more useful replies, try to disable interrupts around MX_USB_DEVICE_Init()
-- pa
2019-07-08 08:53 AM
__disable_irq() did not help.
Strange thing is that it randomly hangs on different places.
One thing I forgot to mention is that I am using crystal-less USB, but I should be OK with this CPU. Is there anything special that I must setup or the CubeX generated code should be fine ?
Thanks....
2019-07-08 09:42 AM
Next quick try while waiting for more useful replies: increase stack size,
2019-07-08 01:45 PM
No luck with stack size...
2019-07-08 02:06 PM
2019-07-08 02:16 PM
Yes... thank you...