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,