How do I get started with USB on lpc4370 (lpc link v2)?

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

How do I get started with USB on lpc4370 (lpc link v2)?

1,049 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmz787 on Sat Jan 18 16:48:25 MST 2014
I'm looking to send lots of data from the ADC, I'd like error-correction (or at least something like a CRC and a packet re-send) so no streamed packets are dropped, and maybe a compression algorithm if the data throughput starts to get high enough.

I've found some USB examples, but they don't mention anything about data streaming and making sure there's no dropped packets.

[1] mentions "LPCUSBLib, an open-source USB device and host stack", but clicking on "LPCUSBLib" [2] brings up a page with a download link along with a red banner stating:
"The nxpUSBlib software package is now obsoleted by the new LPCOpen Platform which can be found here."

clicking "here" just redirects back to [1]
1. http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers
2. http://www.lpcware.com/content/project/nxpusblib

From there clicking "Click here to go to the LPCOpen product family download page"
and then clicking "LPCOpen v2.xx for LPC43xx family devices" finally takes me to:
http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages

But downloading http://www.lpcware.com/system/files/lpcopen_2_04_lpcxpresso_nxp_lpclink2_4370.zip
(LPC-Link 2 (LPC4370) board v2.04)
doesn't actually seem to include a USB demo.

:(
Labels (1)
0 Kudos
4 Replies

837 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by r1200gs on Mon May 26 19:31:10 MST 2014
Any further luck with this? I'm headed down the same path and ran into similar frustrations.

I really want reliable ADC sampling/transfer with a rate in the 'high speed' USB range.

I gave up on the LabTool path. Lots more stuff going on there than I want to try and understand (i.e. Qt). Turns out there is a USB stack in ROM on the LPC4370 which looks simpler to use than any USB stuff I have seen to date.

I think the USB examples in the 'usbd_rom_*' (in the example group with 'periph_blinky') are a pretty good place to start.

I'm wishing they'd just include a compiled version of LPCUsbTest.exe with the 'usbd_rom_bwtest' example and our question would be easily answered. Instead I'm off on a twisted path of trying to port that to the 4370 myself as I don't see a 4370 version.

I'm really tempted to start with the 'cypress ez-usb cocoa' app note as a base for the host side. Seems easier and more where I want to go anyway.

0 Kudos

837 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmz787 on Wed Jan 22 15:06:55 MST 2014
Support? Can anyone comment?
0 Kudos

837 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmz787 on Sun Jan 19 03:28:33 MST 2014
well I found the Keil uVision project file in "labtool\fw\program\uVision"... using the LPC Link 2 config tool I flashed the CMSIS-DAP image, then installed JP1 and unplugged then replugged USB. I'd previously installed Keil  uVision MDK lite (https://www.keil.com/download/product/) so I opened the labtool uVision project file, clicked on the little sparkly magic wand (the Target Options button) to the right of where it said "Internal SRAM". When the option dialog came up I went to the Debug tab and changed the drop down menu to the right of "Use" to CMSIS-DAP Debugger, then clicked Settings and saw my debugger was detected.

But when I clicked build, it said the output was greater than the lite version compilation limit of 32kB.
.\Internal_SRAM\firmware.axf: error: L6050U: The code size of this image (37118 bytes) exceeds the maximum allowed for this version of the linker.
Checking the labtool provided binary (http://www.embeddedartists.com/sites/default/files/support/app/labtool/labtool_binaries_2013-10-30.z...) firmware.bin in Windows 7 shows as 39.3KB (though I seem to have run into Windows reporting file size differently in the past).

I installed the Labtool installer (http://www.embeddedartists.com/sites/default/files/support/app/labtool/Install%20LabTool%201.1.exe).

Then opened the LPC Link2 Config Tool, and unlocked Link2 function from the File menu, then clicked Add Step, selected the Algo from the LPC Link2 Config Tool file directory programming_algos, set the File path to the Labtool firmware.bin, set the address to 0x14000000 to program the SPIFI, clicked "Region erase" and "Verify image after programming by reading it back", then finally clicked "Start".

Programming went fine, and after removing USB and plugging back in, Windows was looking for Labtool drivers to install.

After that finished I opened the Labtool program and it found the device, and I started streaming data. Since I don't actually have a labtool, I don't have any analog front-end or pins for digital sensing, so I couldn't really see much but a little noise on the ADC channel.

I guess I'll try getting the uVision labtool project running in LPCXpresso next, since it seems like a decent platform to start from since it has the USB and ADCHS (used to be called VADC). I don't know if it's a multi-core project yet or not though.
0 Kudos

837 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nmz787 on Sat Jan 18 16:57:47 MST 2014
I guess I found this, will take a look now and try compiling it:
https://github.com/embeddedartists/labtool
0 Kudos