Greetings,
I am using KDS v3.2 and Processor Expert to try and implement USB functionality on a custom K22FN256LH12 chip. I am using the FSL_USB_STACK, and it is currently connection to my PC fine, however I am unable to see my send commands on Tera Term. I am using Error = CDC1_SendString("Hello World!"); It is not returning any error (0x0).
I have confirmed I am using the correct serial port, however I am unsure of the tera terminal serial port settings. I have an image below of my settings, but I have tried many different baud rates. I am unable to find a baud rate value in the CDC component as well.
Any Suggestions to something I may have missed would be appreciated!
Solved! Go to Solution.
I suggest that you start with one of the examples I have put on GitHub (mcuoneclipse/Examples at master · GitHub ) as if you did your own one, there are so many things which could fail or configured wrongly.
What happens with CDC1_GetCharsInTxBuf() that it returns the number of characters in the output ring buffer. They will be sent out to the USB port if the buffer is full or at every call of CDC1_App_Task().
The other thing ot check is if your interrupts and the USB interrupt are actually enabled.
Have a look at the bare-metal 'echo' example available with mcuoneclipse/main.c at master · GitHub
I hope this helps,
Erich
USB CDC does not really use a baud rate (that does not exist for USB). What I usually use is something like 38400 in the terminal.
Your terminal settings are looking fine. I guess it is more of a host system issue. Check in your device manager/viewer if the board really enumerates that COM port you are using. Additionally, make sure you close the COM port before you connect the board (disconnecting/connecting with an active connection can be causeing problems depending on your host system).
I hope this helps,
Erich
Thanks for replying,
It shows the chip in my serial ports just fine (computer dings too). I believe it may not actually be sending. The image below is my code. The result I get from when I get the chars in the tx buffer I get 12 ("Hello World!"). Stepping through the code I never see it actually send the data.
You can see here in this function (which is the pretty much the main function to send values) It just puts values in the tx_buf
I suggest that you start with one of the examples I have put on GitHub (mcuoneclipse/Examples at master · GitHub ) as if you did your own one, there are so many things which could fail or configured wrongly.
What happens with CDC1_GetCharsInTxBuf() that it returns the number of characters in the output ring buffer. They will be sent out to the USB port if the buffer is full or at every call of CDC1_App_Task().
The other thing ot check is if your interrupts and the USB interrupt are actually enabled.
Have a look at the bare-metal 'echo' example available with mcuoneclipse/main.c at master · GitHub
I hope this helps,
Erich
Your example works! Thanks! I missed the use of app task();
Christopher / Erich
USB-CDC does contain provision for baud rate (and other things like stop bits and parity) for when used as a USB-serial adapter.
Erich's own board (with K22) can show this:
http://www.utasker.com/kinetis/tinyK22.html
where the reference has three parallel USB-CDC to UART bridges as well as the standard terminated USB-CDC (as with TeraTerm), all with end to end flow control.
Regards
Mark