Freedom K22F Virtual COM needs both USB cables?

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

Freedom K22F Virtual COM needs both USB cables?

568 Views
benjamin_tait
Contributor II

I'm running a debug console over the USB virtual COM port. In other words, I have this line in my main function: 

DbgConsole_Init((uint32_t)NULL, (uint32_t)NULL, DEBUG_CONSOLE_DEVICE_TYPE_USBCDC, (uint32_t)NULL);

I am able to send data between the MCU and PC, over this virtual COM port, with both USB cables plugged in.

Once the firmware is loaded onto the FRDM-K22F board, only the "k22f micro-USB" connection (diagram below) should be necessary for communication with the PC, no? (we are only communicating over this cable)

Yet strangely, I am no longer able to communicate over the virtual com port, the "k22f micro-USB" port, when the "OpenSDAv2Debug micro-USB" is unplugged. 

When I plug in a power-only micro-USB cable to the "OpenSDAv2Debug micro-USB", or leave it unplugged, I am no longer able to communicate.

When I shunt J22, the "5V supply enable for USB host mode", I am able to communicate over the "k22f micro-USB" connection. Strange - I don't recall setting up the USB in host mode in my firmware.

This makes little sense to me. Could anyone provide me with more details, on why either that second USB connection, or shunting J22, is necessary?

pastedImage_1.png

Thanks!

Tags (2)
0 Kudos
1 Reply

470 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Benjamin Tait ,

   What's the code you are using?

   You can try the official SDK helloworld code, then you just need to connect the opensda usb cable to printf the information.

   You can download the SDK code from this link:

   Welcome | MCUXpresso SDK Builder

  J22 is used to enable the USB host functionality, do you use the usb function in the K22, or just use the on board virtual com port? the on boar virtual com port is from the opensda usb interface. But if you use the CDC usb code, you need to use the USB interface.

Please try it.

If you still have questions, please let me know.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos