We are using OEM QVGA BaseBoard (LPC2478 based) by Embedded Artists as a USB host. Our slave is a Kleindiek Nanocontroller running on 115200 baudrate. The Controller requires no special protocol to send it data. The PC has ben used to send commands (as ASCII characters )to the NanoController using MATLAB as a platform.
Our Project is to make the LPC2478 host transfer an array of 8bit ASCII characters to the NanoController.Using the NXP USBHostLite program we have configured our microcontroller as a host.The host gets initialized. By definition we feel that the Nanocontroller falls under the category of Communication Class of Devices for USB.
Following are our queries.
1) how do we modify the parsing function in the USBHostlite program to parse a CDC descriptor. 2) Once Parsed and our device enumerated, can we simply send a string of ASCII charcters using the WriteLE16U function provided in the NXP USBHostlite program
We have managed to enumerate the third party device. However we are yet to transfer the ASCII characters from the Microcontroller USB port to the NanoController USB port. The functions which describe themselves as writing to the endpoint (for eg. WRITE16LEU ) alone are not helpful. Could anybody suggest how we can write to the NanoController. The Controller most probably needs a BULK transfer.
"...we feel that the Nanocontroller falls under the category of Communication Class..."
"...The Controller most probably needs a BULK transfer."
Feelings and "most probably" are not a good basis for design - you really need to get hold of proper documentation for this thing and find out for sure!
Have you contacted the manufacturer?
Sir,
We are absolutely sure that our device is a communication class device .
We have initially interfaced the NanoController with a PC using MATLAB. The USB Sniffer shows that the transfer of data between the PC and the Nanocontroller is a bulk transfer.
Now we are eliminating the use of a PC by configuring our microcontroller as a host .
Our device has been enumerated and configured correctly.
We need to only send a text based command in the form of ASCII characters to our device. 1)Is it possible to just send these commands using a "Bulk send" function provided in the USB host lite ? 2)Do we need to process the transfer desciptor?
Any help will be appreciated
Note that USBHostLite is an NXP product - not Keil.
"USBHostLite is a stripped-down USB host stack that includes only USB mass storage class support with the bare minimum code to run in an OS-less environment. USBHostLite provides a simple solution for accessing the files on USB mass storage devices such as USB Pen Drives, USB Hard Disk Drives, etc., connected to the USB Host port"
"Classes other than the mass storage are not supported"
ics.nxp.com/.../
Does keil have any reference code for configuring LPC2478 as a host for a cdc device and then sending it some data
You can view Keil products here: http://www.keil.com/product/
Contact Keil & their distributors: http://www.keil.com/company/contact/
It's always worth looking at what Keil include to go along with their development boards. The nearest for you would probably be the ones for the MCB2470. Typically, this information would be places at \Keil\ARM\Board\Keil\MCB2470.
I looks like they do not give a CDC example, just an HID.
Now we are using the reference code which is given in MCB2470\RL\USB\RTX\HID.
Can we modify this to configure our Micro controller LPC2478 as host and communicate with CDC Device using the function provided in rl.usb.h .
Thanks.
Can we make HID code into CDC compatible.
Not sure whether it would be best to modify the HID example or use it as a basis for understanding how to create a CDC example. You could look for a CDC example that Keil provide and see if you can adapt that.
Hi Niharika Jha,
For NXP LPCxxxx, there are several different USB functionalities.
The KEIL USBHID and USBMem examples are for USB device, not USB host.
Umm.. The OP requires much more experience on USB before starting his project..
> The USB Sniffer shows that the transfer of data between the PC and the Nanocontroller is a bulk transfer.
Software sniffer (and hardware bus analyzer) can't tell the type of transfer, bulk or interrupt. Just the endpoint descriptor indicates it clearly. Using hot-plug option of the sniffer, you'll see the descriptors of the target on the sniffer.
Confirm that the target device is really a CDC by its descriptors. It may be a USB-UART chip, like FTDI, SiLabs or Prolific.
Anyway, it's hard to implement unsupported class to the host stack on current Keil RL-USB. You'll start with USBHostLite.
Tsuneo
Yes, our device is USB-UART FTDI chip and we are using USBHostlite code. Is there an sample project similar to the kind we are attempting. Can somebody please send us the link to project.
How is USB UART different from CDC, Still we have to make MCU as HOST and other one as Device.
www.lmgtfy.com
Ah, FTDI, as I thought. The outline of the HostLite code is,
Host_Init(); // initialize the host controller and its stack Host_EnumDev(); // enumerate target device Host_CtrlSend(..); // send vendor transfer to set up baudrate, etc to the chip.
strcpy( TDBuffer, "ABCD"); // fill ASCII characters to the buffer Host_ProcessTD(..); // send it to the chip
> How is USB UART different from CDC
There are many differences, but just for your concern, The command, sent by Host_CtrlSend(), is different.
Refer to the Linux FTDI support on ftdi_sio.c for the SETUP data of this command. In this Linux code, usb_control_msg() sends the command in change_speed()
lxr.free-electrons.com/.../ftdi_sio.c