I am trying to use SDK example lpcxpresso54s018_host_cdc_bm from SDK_2_13_0_LPC54018.
The only change that I made to the example is that I changed USB_HOST_CONFIG_OHCI to 0 and USB_HOST_CONFIG_IP3516HS to 1 in usb_host_config.h. That is because I must use USB1 and highspeed.
I have a setup where I have:
-LPC54018 PCB (our own, based on a reference design)
-nRF52 dev kit acting as a CDC device, as described in the readme.pdf of the example.
These devices are connected via USB.
The example app starts ok. I can see these from the LPC54018 PCB console port:
[11:06:14:366] host init done␍␊
[11:06:14:366] This example requires that the CDC device uses Hardware flow␍␊
[11:06:14:397] if the device does't support it, please set USB_HOST_UART_SUPPORT_HW_FLOW to zero and rebuild this project␍␊
[11:06:14:397] Type strings, then the string␍␊
[11:06:14:397] will be echoed back from the device␍␊
[11:06:14:554] device cdc attached:␍␊
[11:06:14:554] pid=0x1015vid=0x1366 address=1␍␊
[11:06:14:554] cdc device attached␍␊
[11:06:14:586] cdc control transfer error␍␊
The problem is "cdc control transfer error", the communication between the boards does not work.
What could be the reason for this?
So my setup consists now of two LPC54018 PCB's.
The first device runs SDK example lpcxpresso54s018_host_cdc_bm from SDK_2_13_0_LPC54018.
The second device runs SDK example lpcxpresso54s018_dev_cdc_vcom_bm from SDK_2_13_0_LPC54018.
The both examples are configured to use USB1 highspeed, and the devices are connected to each other with a USB cable.
The original examples work OK. When I send data bytes to device #1 terminal, the data is echoed back from device #2.
One notice though: If I try to modify the lpcxpresso54s018_dev_cdc_vcom_bm example so, that it sends data automatically e.g. once per second, it does not succeed. When data is sent from APPTask() (in virtual_com.c) by calling USB_DeviceCdcAcmSend(), the function returns always error kStatus_USB_Busy. The sending only succeeds once every time after APPTask() has received data from host (s_recvSize != 0).
BR,
jukka
Hello @jukka1
If still can't work, recommend:
1) First without any change, check whether USB0 can work well on your side.
2)About device, you can download the usb_device_cdc demo to another LPC board, then connect host and device.
3)Refer to readme.pdf to config HW and SW.
BR
Alice
Hello @Alice_Yang,
I jumped directly to 2) and I got the USB communication between the boards working.
Now I modify the usb_device_cdc example to generate a lot of data, and let's see what happens ...
BR,
jukka
Just before the "cdc control transfer error" happens, the call stack is this:
Thread #1 57005 (Suspended : Breakpoint)
USB_HostCdcInterruptCallback() at host_cdc.c:415 0x6082
USB_HostCdcInterruptPipeCallback() at usb_host_cdc.c:193 0x9530
USB_HostIp3516HsTokenDone() at usb_host_ip3516hs.c:3,186 0x5070
USB_HostIp3516HsTaskFunction() at usb_host_ip3516hs.c:3,966 0xbd5c
USB_HostTaskFn() at app.c:123 0xc0a2
main() at app.c:248 0x5c1e
The status is kStatus_USB_TransferStall in USB_HostCdcInterruptCallback().
The readme.pdf of the example mentions a "CDC device".
I assume that nRF52 dev kit is a suitable "CDC device". If I connect nRF52 dev kit to Linux via USB cable, it emerges in Linux as ttyACM0. I can open that port with minicom or cutecom, and nRF52 echoes the written characters back.
The USB descriptors can be seen in nRF52-usb-descriptors_230613.log.
Does anybody know, what kind of USB CDC device works with lpcxpresso54s018_host_cdc_bm example?
I tried an Android phone in USB tethering mode, but the example app was not happy with Android's USB descriptors.
BR,
jukka