You are sending data to the USBUART even when it is not initialized correctly.
Can you please post a complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
OK, so ... I can't quite reproduce this (I have the working version on my home computer...), so I have attached a version that doesn't seem to work at all.
The code to init the USBUART is taken right from the USBUART code example, as well as the PutString and block-until-complete loop. I am using the driver from the example project, which enumerates as "Cypress USB UART" in device manager.
Using the debugger (and the board LED), it does run through the initialization, but then opening a serial terminal yields no messages, and code waits on one of the while()'s when the USBUART buffer is full.
What am I doing wrong?
Having USBUART work is very important, it's the only way I can get data off the board. The usage here is interfacing to one I2C sensor, and to extend that to 10+ in the future. The BusPirate I was using was giving me spurious reads that I know are not correct, so I was just trying to hack together a simple sensor polling i2c-to-uart device.
(Without looking at it, wrong computer right now) Is your project still configured to use 3V, and your board too?
Well, as usual, Bob was right. Adding a busywait before the first USBUART write makes it work properly.
A minimum working example is attached. I hope whoever else stumbles upon this finds it helpful. The USBFS_UART code example is a little unhelpful, since it just echoes back individual characters. For dev board users like me, having the USB->UART working for general data export is great, now I can use this board as a very flexible interface to a bunch of sensors (all different interfaces) for which I am collecting data and characterizing.
You making me flush!
Glad to have been of any assistance.
You were asking whether it is better to check USBUART_CDCIsReady() before or after an USBUART_PutString()
Comment in USBUART_cdc.cstates:
* The USBUART_CDCIsReady() function should be called before
* sending data with a new call to USBUART_PutString(), to be sure
* that the previous data has finished sending. This function sends
* zero-length packet automatically, if the length of the last packet, sent
* by this API, is equal to Max Packet Size
This makes sense in so far that during some other jobs the string is sent in the background, giving a little bit more performance doing it this way.