LPC4357 - USB_CDC implementation (USB_Configuration stuck)

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by sixten11 on Thu Nov 12 02:34:57 MST 2015

I've run into a strange issue which is kind of hard for me to explain. Please keep in mind that I'm very new to this. I've implemented the USB_CDC example on my development board, which runs FreeRTOS. I'm using the same USB cable for power as well as for the serial connection (TerraTerm or similar) if that makes sense.

Threads (2 of them) are created via. xTaskCreated and both er called - tested by printing to the I/O, but this line:

while (!USB_Configuration);

In my USB thread hangs forever, if I do not insert a sprintf or similar.

So to sum it up:

This works:

while (!USB_Configuration) { sprintf("anything.."); }

This does not work:

while (!USB_Configuration);

What could be causing this? The sprintf does something that magically makes it all work.