imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

Jump to solution
946 Views
CarrotMan
Contributor II

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?

0 Kudos
1 Solution
938 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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

 

 

 

   

View solution in original post

0 Kudos
1 Reply
939 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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

 

 

 

   

0 Kudos