2024-10-14 04:58 AM
Hi
I am working on an STM32L433 using STM32IDE. When running in debug mode, the USB CDC is recognized when plugging in the cable (into Windows 10 and 11) . But when I compile as release mode the USB isn't recognized . I am using the HAL for USB .
Anyone please help on this?
Best Regards
Scott
2024-10-14 05:17 AM
Hi @SSmit.13
Try to lower optimization level to make sure you will get same behavior in debug mode. Then, check USB descriptors are properly configured. Connect directly USART RX to TX to test CDC in loopback.
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.
2024-10-16 05:44 AM - edited 2024-10-16 05:44 AM
Sorry, the USB is working in release mode, I have just realized that its reading an input pin that always reads 0v . I use a jumper to detect whether to use the USB or not, and it always reads 0v in release .
I have made a new thread based on this issue
Many thanks
Scott
2024-10-17 07:23 AM
Hi @SSmit.13
To conclude, by ensuring proper synchronization with the __DSB() instruction, you can avoid timing issues and ensure reliable operation in both debug and release modes.
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.