USB Host Lite on the LPC1788

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

USB Host Lite on the LPC1788

1,026 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dave on Mon Jul 25 10:44:46 MST 2011
I downloaded the USB Host Lite (Beta) example software from NXP.COM from here:

http://ics.nxp.com/support/documents/microcontrollers/zip/usb.host.lite.lpc17xx.zip

The first thing I noticed is within the Host_Init() function, the base memory address for the data structures is as follows:

<code>
// For chip revision V01 and later
HostBaseAddr = 0x20080000;
</code>

According to the user's manual, this section of memory is reserved for the AHB peripherals...
[ref: UM10470 LPC178x/7x User manual Rev. 1.4 — 10 June 2011, page 14, table 3]

Am I misinterpreting this table?

I was thinking about relocating this base address to 0x2000000, which is described as "Peripheral RAM - bank 0(first 8kB)".

Anybody else run across this problem?
Labels (1)
0 Kudos
3 Replies

703 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dave on Mon Aug 01 21:42:34 MST 2011
Why is 0x20004000 preferred over say 0x20000000 or 0x20002000?  Isn't this peripheral RAM available to all peripherals?  Or is there something special about 0x20004000 that better suits the HC?

Thanks for your help in advance,

0 Kudos

703 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drs on Mon Aug 01 16:25:31 MST 2011
Hello Dave,

I read your post on http://tech.groups.yahoo.com/group/lpc2000/message/54764 and it looks like you have received confirmation on the proper base address.

The basic issue here is that the example source you were using was for the LPC176x and LPC175x line of parts. The parts that you are using have a different die and so the base addresses are different.

As you learned on the other forum, the proper base address for the LPC177x/8x is 0x20004000.

The code that you downloaded from nxp.com is a bit old and will be updated soon but it will still not support the LPC177x/8x parts. In the near future a new zip file will be posted on the same page that will support those parts.
0 Kudos

703 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dave on Wed Jul 27 19:03:40 MST 2011
Yes - definitely needed to relocate to 0x2000 0000 - actually, 0x20002000 and 0x20004000 work fine as well.  One thing for sure, you'll never get this example to work if you don't initialize the FAT_BootSec structure used in usbhost_fat.c

adding this simple line will make your life less stressful:

<code>
   memset( (uint8_t *)(&FAT_BootSec), 0x00, sizeof( FAT_BootSec ) );
</code>

I put it right after the file entry initialization.

The reason for this is the structure element BootSecOffset.  If your boot record contains what you need, and you don't have an LBA to jump to, this element will never get initialized, and it's value can be anything, which will throw off all your sector calculations...

Other than that, it's a pretty basic demo of using the HC to talk to a USB memory stick...

Hope this helps,
0 Kudos