USBD_VCOM - terminal connection detection

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User21105
Level 1
Level 1
Hi,

I'm writing an application using the USBD_VCOM library, a relax kit with the XMC4800 and a Windows10 PC.
All my drivers are up to date.

I need my application to write a menu (multiple selections through characters) on the screen through a text terminal and the COM port .
Something like:

const unsigned char ucMenu[] =
"\n\r"
"1 ... OPTION1\n\r"
"2 ... OPTION2\n\r"
"3 ... OPTION3\n\r"
"4 ... OPTION4\n\r"
"5 ... OPTION5\n\r"
"6 ... OPTION6\n\r"
"\n"
"your choice: ";


This must happen automatically after that the terminal (I'm using Putty) has been connected to the COM port generated by the microcontroller.

At the moment, this is the sequence:
- run the application
- run Putty
- send a character on the COM port generated through USB
AND ONLY HERE I CAN print the menu because if I send anything on the port before the app receives the first character, this is not displayed

So basically, whatever I is written before I run Putty is not displayed and I need to input a character for the uC to receive the first byte and understand that it can print something which will be seen.

I'd like to find a way to get my app to understand when Putty is connected.

Would it be possible?

Thanks and regards,
Ale
0 Likes
0 Replies