Hi,
I a'm trying to use the SDK example named "host_cdc_bm" to receive data from a generic VCOM device.
This question relates to LPC54628, MCUXpresso 11.6.0 with SDK 2.13.0.
It seems that the example is not able to receive any data from my VCOM device.
For test, I am using an arduino board (that behaves like a VCOM device).
The arduino board emits the string "uptime nn\r\n" once every second.
I can verify the output string arrives with 1 Hz using Tera Term on my PC.
It seems that the CDC host is able to attach/detach when I connect/disconnect the device, but then it does not receive the test strings..
Can someone help me debug this?
Thanks in advance.
Anders
Printout from debug console when running the example:
>host init done
>This example requires that the CDC device uses Hardware flow
>if the device does't support it, please set USB_HOST_UART_SUPPORT_HW_FLOW to zero and >rebuild this project
>Type strings, then the string
>will be echoed back from the device
>device cdc attached:
>pid=0x801evid=0x239a address=1
>cdc device attached
Solved! Go to Solution.
under SDK, there are cdc device demo code. you can download it to a board and use board as CDC device for test.
follow the readme file steps, if you can't get same result of readme file, let me know which step you get stuck. We will check.
Hi Jun,
Thanks for responding.
I already read the document you refer to, but I'm not sure I understand the instructions.
The document clearly says "Plug in the CDC device".
I thought the code example would enable host communication with a generic CDC device, such as an Arduino board.
I also tested with an Okdo board (ie LPC55S69), which I expect to work since the debug port also behaves like a generic CDC device.
It too attaches/detaches as expected, but it does not receive the expected test strings.
I switched hardware flow on and off as recommended in the debug print, but it doesent help.
To verify the function of the USB host port on my dev board I ran the USB code example "hist_hid_mouse_bm", it works just fine.
-Am I using the wrong HW for the CDC device?
-If so, what HW do you recommend me to use?
Regards,
Anders
Hi anders_erlandss
under the demo code folder, there is readme.pdf file. Please follow the guide of the readme to test the code with the same HW and SW enviroment, rather than arduino board.
See how it works.
Have a nice day,
Jun Zhang
under SDK, there are cdc device demo code. you can download it to a board and use board as CDC device for test.
follow the readme file steps, if you can't get same result of readme file, let me know which step you get stuck. We will check.
Hi again,
Ok. When I connected another NXP dev board running the CDC demo code it works. Thanks!
With some modifications of the CDC host example, the communication is now working when I connect a ublox GPS receiver (it behaves like a USB CDC device).
I would appreciate if you can explain the following:
-Why is the communication not working when I connect to the USB debug port (Debug Link) of an NXP board?
-Why is the communication not working when I connect to the USB port of an Arduino board?
Both devices are USB CDC devices, and I can verify the communication with the Tera Term application on my PC.
(attach/detach seems to work, but then there are no data transfers)
Regards,
Anders
Good to know it works.
I don't know how debug interface implement cdc, the souce code is not open. neither your Arduino board.
The example requires that the CDC device uses Hardware flow, if the device does't support it, please set USB_HOST_UART_SUPPORT_HW_FLOW to zero and rebuild this project.
Jun Zhang
Hi Jun,
I switched hardware flow on and off as recommended in the debug print, but it doesent help.
Ok, no further questions. I think I can go on from here.
Thanks for your assistance!
Kind Regards,
Anders
You are welcome!