Dear friends,
I am developing an application using keil's RL-USB library to turn the microcontroller into a USB host controller so that I can read a flash memory device.
I am at the very beginning down the road and I want to use the keil's sample for LPC1788 board of embedded artists. the project is located at: C:\Keil_v5\ARM\Boards\Embedded Artists\LPC1788-32 Developers Kit\RL\USB\Host\MSD_File
I have designed my own board (I am not using embedded artists' board) and I have used USB2 as the host controller, not USB 1. Therefore I need to change the HOST controller in USB_Config.c from USB HOST 0 to USB HOST 1. I have done all the programming and everything is fine. There is just one problem that prevents the project from being compiled correctly: .\Obj\MSD_File.axf: Error: L6218E: Undefined symbol usbh1_hcd_ohci (referred from usb_config.o).
It is important to say that the program is compiled successfully when USB HOST 0 is chosen in USB_Config.c. I was wondering if anybody has faced the same problem and solved it before.
There is only one controller on this chip but for host it can be configured that it uses both ports as host, there are a few possible combinations and they can be selected by using RTE_Device.h file
Yes, exactly. I actually fixed that problem a long time ago. I had mixed up the two USB ports of LPC1788 with its host controller. (I did not pay much attention and I thought those are host controllers) When I looked again into the datasheet, I suddenly figured out that there is only one host controller, so I just fixed it.
Hey there,
I am also developing an application using Keil's RL-USB library to turn the microcontroller into a USB host controller for read a flash memory device. I need only the USB2 as host, USB1 I do not use.
I use the LPC1788 oem board from embedded artists mounted on a own board. I know, that the hardware works fine (tested with another program not based on Keil's RL-USB).
I've tried to get the sample program running. Without any modification at the program, I can compile it successfully, but while running the program it stays in the function USBH_Initialize(0) forever.
Changing the Port Functionality Configuration in RTE_Device.h from (U1 = host, U2 = host) to (U1 = device, U2 = host) helps to pass successfully the USBH_Initialize(0) function. However the Program is not able to recognise the USB flash memory device. The function USBH_MSC_GetDeviceStatus(1) always return usbDeviceError.
Are there any settings I've missed to change? My hardware uses only the D+ and D- line and none of the additional pins (power control/overcurrent/LED). Is it possible, that the program needs one of these pins for a successful USB connection?
Could any one successfully run the example program and can give me a hint how to get it running?
Why do you use USBH_MSC_GetDeviceStatus(1) when to check if there is instance 1 attached you should be calling USBH_MSC_GetDeviceStatus(0) instead.
The code line in the example program looks like this: con = (((USBH_MSC_GetDeviceStatus(1) == usbOK) << 1) | (USBH_MSC_GetDeviceStatus(0) == usbOK)) & 3;
I thought (USBH_MSC_GetDeviceStatus(0) checks the port 1 and USBH_MSC_GetDeviceStatus(1) checks the port 2. That's why I have written the result of USBH_MSC_GetDeviceStatus(1). However the program checks also USBH_MSC_GetDeviceStatus(0) with the same result.
Can't you use example that exists for Embedded Artists board as a starting point even if it uses both port for Host and see if it works, and then continue tailoring it to your exact needs?
That's exactly what I've tried. But as I have written in my first post:
"I've tried to get the sample program running. Without any modification at the program, I can compile it successfully, but while running the program it stays in the function USBH_Initialize(0) forever."
If you use LPC1788 oem board can you try it with Embedded Artists base board and go from there.
Ok, I've tried it now with the Embedded Artists base board. The jumpers are set as described in Abstract.txt.
But the result is the same. Without any modifications on the example, the program does not return from the function USBH_Initialize(0).
What versions do you have of: - Embedded Artists LPC1788 OEM board - Embedded Artists base board - MDK - Middleware - LPC1700 DFP
I use the following versions: - LPC1788 OEM Board REV D - OEM Base Board rev PB1 - µVision V5.14.0.0 - MDK-Middleware 7.00-beta - LPC1700_DFP 2.1.0
I have: - LPC1788 OEM Board REV A - OEM Base Board rev A
and it works on my board, perhaps you can try to find out what are the differences between these two boards regarding USB interface.
Thanks for your help. I finally got it running.
The problem was the I2C communication with the OTG Transceiver for setting the Pull-downs on the D+ and D- data lines. If the communication fails, the program stays in an endless while loop.
I do not use the OTG Transceiver, so disable it in RTE_Device.h solved the problem. Important fact I noticed is that disable the entire Port U1 will not disable the OTG initialization.
Also it works only with the port functionality configuration "U1 = host, U2 = host". Why this is I don't know.
However everything I need for my project now works well.