imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

跳至解决方案
957 次查看
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 项奖励
1 解答
949 次查看
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 项奖励
1 回复
950 次查看
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 项奖励