USB ROM Driver examples using LPCXpresso for LPC11Uxx

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

USB ROM Driver examples using LPCXpresso for LPC11Uxx

711 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kpa on Mon Aug 27 04:52:25 MST 2012
Hello all,

I have tried the USB ROM CDC demo from this link http://www.lpcware.com/content/nxpfile/usb-rom-driver-examples-using-lpcxpresso-lpc11uxx
I works perfectly on a LPC11U35 but on a LPC11U24 it hard fault quickly and the device is not enumerated at all...

Any one have any idea why ?

Thanks in advance

Kpa
Labels (1)
0 Kudos
5 Replies

572 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by  on Wed Oct 24 18:11:37 MST 2012
Hi mrob,
Here is the LPCxpresso codebundle with the USB_Rom drivers fixed.
http://www.lpcware.com/content/nxpfile/sample-code-bundle-lpc11uxx-peripherals-using-lpcxpresso
0 Kudos

572 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by  on Tue Oct 16 00:05:21 MST 2012
Hi mrob,
We have fixed this issue with the new release of the Keil Code bundle here http://www.lpcware.com/content/nxpfile/sample-code-bundle-lpc11uxx-peripherals-using-keils-mdk-arm-0
However we are in the process of revising the LPCxpresso codebundle.
Could you please momentarily use the code from the Keil bundle? ( you might need to change some keywords to make the code compatible with Xpresso, but it should be similar to the current code you are using)
let me know if it works,
Regards,
0 Kudos

572 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Mon Oct 15 19:55:30 MST 2012
Please create new thread for new problem..
0 Kudos

572 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mrob on Fri Oct 12 07:53:43 MST 2012
Thanks for the help, I was running into that and having trouble tracking down the problem.
EDIT: Ends up that wasn't part of my issue.  I'm using the LPC11U24FBD48/401 which does have 8K of ram available (the "/301" version only has 6K)


I'm having an issue with the MSC driver example.

The code seems to get stuck copying the disk image from the constant to ram.

In lpc11uxx_usbd_msc_mem.c

<code>ErrorCode_t usb_msc_mem_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR* pIntfDesc, uint32_t* mem_base, uint32_t* mem_size)
{
  USBD_MSC_INIT_PARAM_T msc_param;
  ErrorCode_t ret = LPC_OK;
  uint32_t n;

  for (n = 0; n < MSC_PhysicalMemorySize; n++) {     /* Copy Initial Disk Image */
    Memory[n] = DiskImage[n];               /*   from Flash to RAM     */
  }
</code>

If I comment out the for loop, it seems to work fine.
Has anyone else seen this, or is it just me?

Update:  It ends up I'm still having issues with the CDC example.  The Windows Device Manager is saying the device couldn't start.  If I reinstall the drivers, it works until my device is either removed or reset.
0 Kudos

572 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kpa on Mon Aug 27 06:15:03 MST 2012
I have catched the problem. Below is the solution with explenation if it could help someone...

The LPC11U24 that I am using have only 6kB RAM.

On the main.c of the demo the RAM allowed for the USB stack is defined like this:
  usb_param.mem_base = 0x10001000;
  usb_param.mem_size = 0x1000;

But the RAM on the MCU start at 0x10000000 and finish at 0x10001800. So the RAM allowed for the USB stack goes over the 6KB of RAM.
I have changed the declaration like this:
  usb_param.mem_base = 0x10000800;
  usb_param.mem_size = 0x1000;

And it works perfectly !

kpa
0 Kudos