imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imxrt1064 usb_device_cdc_vcom_lite printing to VCOM with PRINTF();

ソリューションへジャンプ
1,660件の閲覧回数
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 解決策
1,652件の閲覧回数
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 返信
1,653件の閲覧回数
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 件の賞賛
返信