The example echoes any character typed in by the user. However, I am looking for a way to write to the virtual com port using PRINTF(); function (Or any other alternative).
Is there a way to redirect PRINTF(); to USB VCOM?
Solved! Go to Solution.
Hi @CarrotMan ,
usb_device_cdc_vcom_lite will simulate the USB port as the vcom,then printf the data through the USB VCOM.
You can use: usb_echo("kerry test");
#define usb_echo DbgConsole_Printf
The usb_echo will printf the data to the board debug COM.
The USB VCOM mainly use the USB_DeviceSendRequest to send the data out.
So, you still can use the USB_DeviceSendRequest API to send out it. You can see, the USB need the handler, the endpoint, the buffer and size, not just simple printf.
Wish it helps you!
Best Regards,
Kerry
Hi @CarrotMan ,
usb_device_cdc_vcom_lite will simulate the USB port as the vcom,then printf the data through the USB VCOM.
You can use: usb_echo("kerry test");
#define usb_echo DbgConsole_Printf
The usb_echo will printf the data to the board debug COM.
The USB VCOM mainly use the USB_DeviceSendRequest to send the data out.
So, you still can use the USB_DeviceSendRequest API to send out it. You can see, the USB need the handler, the endpoint, the buffer and size, not just simple printf.
Wish it helps you!
Best Regards,
Kerry