LPCOpen New Project Issues

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

LPCOpen New Project Issues

3,940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Thu Apr 25 10:55:48 MST 2013
Hi everyone. I've been tasked with evaluating the NXP LPC11U2X line of microcontrollers as a cheaper/faster/better alternative to the Atmel ATmega32U4 in an ongoing USB device project. So I ordered an LPCXpresso LPC11U14 board, and an Embedded Artists LPC11U35 board. I didn't want to spend a week writing drivers, so I decided to try the LPCOpen platform, which has an updated version of CMSIS anyway.

I've been trying for several days now to get a generic HID project up and running and, while I can get the examples to import and run (which seems to be where the docs end), I can't seem to figure out how to actually create a new workspace/project that leverage's the platform. I was able to recreate the periph_blinky example, but I spent like 10 minutes alone setting up hard coded include paths and library paths. Is this honestly how it's supposed to be used, where every project has to include every folder that all of the library projects include? How does this work when the platform is updated? Do I have to re-import all of the new examples and look for changes in the paths?

I also spent about an hour trying to recreate the generic HID example, but I couldn't get it to build. The lpc11u14 board library and USB device library would build separately, but when I tried to build the example the USB device library would start complaining about HAL related things. I even made sure I had all of the same paths, symbols, and references as the example!

I've combed through the documentation and found nothing related to starting a new project, outside of a note that installing LPCOpen means unzipping it, and a passing mention that "sys_config.h" is where you go to configure things... I realize this is a relatively new project, but it seems like very little thought was put into documenting how to actually use the libraries, not just import pre-done examples each equipped with a million hard coded include paths.

So basically, if somebody could walk me through creating a new workspace/project and linking it to the core library and USB library I would really appreciate it! I tried asking the same question over at LPCware a few days ago, but I haven't gotten any replies. I'm worried if this takes much longer, my company will pull the plug on this endeavour and send us back to the ATmega32U4. And now I'm hooked on 32-bit! :D

Thanks!
Neil Thiessen

EDIT: I'm also going to need to link to FreeRTOS eventually, but for now I'd be happy just to learn the proper way to use the platform, and get USB up and running.
0 Kudos
Reply
17 Replies

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon May 13 15:14:53 MST 2013
Ok, the new documentation is much better and I've been able to get some projects up and running now. Thank you! I've just got a few remaining questions. First of all, what's the preferred way to use PWM outputs in LPCOpen? Also, I'm still having trouble getting USB ROM drivers to work. When I reconfigure the generic HID example for the LPC11U2X_3X and change USE_USB_ROM_STACK to 1 I get the following errors:

Building target: nxp_xpresso_11u14_usb_GenericHIDDevice.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"..\..\..\nxp_xpresso_11u14_board_lib\Debug" -L"..\..\..\nxp_xpresso_11U14_usblib_device\Debug" -Xlinker -Map="nxp_xpresso_11u14_usb_GenericHIDDevice.map" -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "nxp_xpresso_11u14_usb_GenericHIDDevice_Debug.ld" -o "nxp_xpresso_11u14_usb_GenericHIDDevice.axf"  ./Lib/UsbRom.o  ./Descriptors.o ./GenericHID.o ./cr_startup_lpc11xx.o   -lnxp_xpresso_11u14_board_lib -lnxp_xpresso_11U14_usblib_device
./Lib/UsbRom.o: In function `CALLBACK_UsbdRom_Register_ConfigureEndpoint':
C:/nxp/lpcopen/applications/LPCUSBlib/lpcusblib_GenericHIDDevice/Lib/UsbRom.c:98: undefined reference to `Generic_HID_Interface'
./Lib/UsbRom.o: In function `CALLBACK_UsbdHid_Register_ReportInBuffer':
C:/nxp/lpcopen/applications/LPCUSBlib/lpcusblib_GenericHIDDevice/Lib/UsbRom.c:115: undefined reference to `Generic_HID_Interface'
./Lib/UsbRom.o: In function `CALLBACK_UsbdHid_SetReport':
C:/nxp/lpcopen/applications/LPCUSBlib/lpcusblib_GenericHIDDevice/Lib/UsbRom.c:121: undefined reference to `Generic_HID_Interface'
collect2: ld returned 1 exit status
make: *** [nxp_xpresso_11u14_usb_GenericHIDDevice.axf] Error 1
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Thu May 09 08:07:56 MST 2013

Quote: wells
If you need it, it's up now. The official release will be this Friday in v1.03
http://www.lpcware.com/system/files/LPCOpen_v1.03_rc1_docs.zip

After the official release is up, the link above won't work anymore and you'll have to download from http://www.lpcware.com/content/nxpfile/lpcopen-platform.

For the Project and Board porting guides, see the Technical Library link on the home page (index.html).

We are also looking at some changes to reduce the number of include paths and needed files in the libraries/examples, but this won't be in v1.03..

thanks!



Thank you very much! I'm downloading it as I type, I'll let you know if I run into any more issues.
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Wed May 08 17:07:18 MST 2013

Quote: neilt6
Ok, thanks for the update. We've run into some  production problems with another product so the pressure's off at the  moment.



If you need it, it's up now. The official release will be this Friday in v1.03
http://www.lpcware.com/system/files/LPCOpen_v1.03_rc1_docs.zip

After the official release is up, the link above won't work anymore and you'll have to download from http://www.lpcware.com/content/nxpfile/lpcopen-platform.

For the Project and Board porting guides, see the Technical Library link on the home page (index.html).

We are also looking at some changes to reduce the number of include paths and needed files in the libraries/examples, but this won't be in v1.03..

thanks!
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed May 08 02:11:35 MST 2013

Quote: neilt6
I tried the code that was referenced in that forum, but I can't get it to compile in the same way that the person in that forum couldn't get it to compile...



As this thread's subject is on LPCOpen and nothing to do with LPC11U divides, I've created a new thread to cover the use of ROM divide...

http://knowledgebase.nxp.com/showthread.php?t=4509

Regards,
CodeRedSupport.
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Tue May 07 09:48:23 MST 2013

Quote: daniel.widyanto
See http://knowledgebase.nxp.com/showthread.php?p=19789 for using ROM division library in LPC11Uxx



I tried the code that was referenced in that forum, but I can't get it to compile in the same way that the person in that forum couldn't get it to compile...
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by daniel.widyanto on Mon May 06 23:31:54 MST 2013
See http://knowledgebase.nxp.com/showthread.php?p=19789 for using ROM division library in LPC11Uxx
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon May 06 14:38:04 MST 2013

Quote: wells
Just an update - I'm still working on this. I was expecting to complete  it yesterday, but it's taking a little more time than I expected. It  needs a quick review before release, so I'm hoping for Friday or Monday.  Sorry about the extended delay..



Ok, thanks for the update. We've run into some production problems with another product so the pressure's off at the moment.
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Thu May 02 16:28:55 MST 2013
Just an update - I'm still working on this. I was expecting to complete  it yesterday, but it's taking a little more time than I expected. It  needs a quick review before release, so I'm hoping for Friday or Monday.  Sorry about the extended delay..
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon Apr 29 22:12:19 MST 2013

Quote: wells
Unfortunately, the official v1.03 release will be delayed as  review and testing is ongoing and not complete, but we are adding a few new features for that release. For the 11Uxx, there is no new content (except I2C) so this shouldn't affect you.

We should have an Xpresso document put together tomorrow or Wednesday with help for projects including setup for include paths, build-time definitions, required files and libs, etc.

Basically, it will be a step by step guide for new projects, but with needed sources files (especially the IP files) and include paths to build the projects.

Once this is ready, we'll just post this publicly on LPCware.com somewhere and link to it here..

thanks!



That's exactly what I need, thanks! :) Please let me know as soon as the new docs become available. I'm designing this product as a successor to another product, and the previous tech wrote everything in HC12 assembly which is proving to be a real joy to port. Hence, I'd like to keep the new firmware as portable as possible.
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Mon Apr 29 17:04:50 MST 2013

Quote: neilt6
A guide on creating new projects is exactly what I need! Is this going to be in the 1.03 release that's coming out tomorrow?

I don't think it was a linker error, I think it was a compile error IIRC. Either way, I seem to recall solving that problem, but not being able to get the ROM-based USB drivers to work.



Unfortunately, the official v1.03 release will be delayed as  review and testing is ongoing and not complete, but we are adding a few new features for that release. For the 11Uxx, there is no new content (except I2C) so this shouldn't affect you.

We should have an Xpresso document put together tomorrow or Wednesday with help for projects including setup for include paths, build-time definitions, required files and libs, etc.

Basically, it will be a step by step guide for new projects, but with needed sources files (especially the IP files) and include paths to build the projects.

Once this is ready, we'll just post this publicly on LPCware.com somewhere and link to it here..

thanks!
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon Apr 29 14:11:51 MST 2013

Quote: whitecoe
The LPC11 rom divide stuff is very similar to that in LPC12. The later has support within the LPCXpresso IDE project wizards, as per:

http://support.code-red-tech.com/CodeRedWiki/RomDivide

but unfortunately this doesn't currently seem to exist for LPC11U. However NXP have posted some divide information specifically for LPC11U at:

http://www.lpcware.com/content/blog/using-integer-division-routines-rom-lpc11u2x-lpc11u3x

HTH!



I've tried both of those examples, but was unable to get either of them to work. First I tried bringing over the relevant code/settings from an LPC12 project and adjusting the ROM address, but the program would crash whenever I performed a division. The example from LPCware won't even compile, I keep getting the following error:

[B]../src/patch.c:59:17: error: initializer element is not constant[/B]
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon Apr 29 14:00:14 MST 2013

Quote: wells
Sorry about the issues you are having with LPCOpen and tool setup - in the  next release, a guide on creating new projects will be added to the  documentation that helps explain building a project from the bottom up. I can probably give you a copy of that before it's done if it's any help..

Is this a link error? Can you post the error here?



A guide on creating new projects is exactly what I need! Is this going to be in the 1.03 release that's coming out tomorrow?

I don't think it was a linker error, I think it was a compile error IIRC. Either way, I seem to recall solving that problem, but not being able to get the ROM-based USB drivers to work.
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Mon Apr 29 13:55:35 MST 2013
The LPC11 rom divide stuff is very similar to that in LPC12. The later has support within the LPCXpresso IDE project wizards, as per:

http://support.code-red-tech.com/CodeRedWiki/RomDivide

but unfortunately this doesn't currently seem to exist for LPC11U. However NXP have posted some divide information specifically for LPC11U at:

http://www.lpcware.com/content/blog/using-integer-division-routines-rom-lpc11u2x-lpc11u3x

HTH!
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wells on Mon Apr 29 13:46:46 MST 2013

Quote:
I've combed through the documentation and found nothing related to  starting a new project, outside of a note that installing LPCOpen means  unzipping it, and a passing mention that "sys_config.h" is where you go  to configure things... I realize this is a relatively new project, but  it seems like very little thought was put into documenting how to  actually use the libraries, not just import pre-done examples each  equipped with a million hard coded include paths.

Sorry about the issues you are having with LPCOpen and tool setup - in the  next release, a guide on creating new projects will be added to the  documentation that helps explain building a project from the bottom up. I can probably give you a copy of that before it's done if it's any help..


Quote:
I also spent about an hour trying to recreate the generic HID example,  but I couldn't get it to build. The lpc11u14 board library and USB  device library would build separately, but when I tried to build the  example the USB device library would start complaining about HAL related  things. I even made sure I had all of the same paths, symbols, and  references as the example!

Is this a link error? Can you post the error here?
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon Apr 29 13:41:23 MST 2013

Quote: whitecoe
There hasn't been much LPCOpen related traffic here.  You would probably do better posting to LPCware.com forums for help on LPCOpen - the NXP apps guys tend to post there more frequently than here.

With regards to CMSIS versions, to be honest from my experience there don't tend to be huge differences. If this is the only reason that you are using LPCOpen, then I would suggest that you perhaps reconsider and try out some of the "earlier generation" driver examples instead. They tend to be easier to follow - LPCOpen still seems to be evolving.

HTH!



Thanks for the reply, although I posted the same question on LPCware over a week ago and still got no replies. I'm starting to see that maybe LPCOpen is too new to be banking a commercial project on. In answer to your question, I wasn't really after CMSIS 3.01, but I like the idea of having more mobile code in case we want to change chips later on. I'm really surprised by how frustrating this new chip is proving to be. Take ROM-based division for example, no working examples to be found anywhere! Maybe I'll just have to pull out the datasheet and start hard coding everything...
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Mon Apr 29 13:27:05 MST 2013
There hasn't been much LPCOpen related traffic here.  You would probably do better posting to LPCware.com forums for help on LPCOpen - the NXP apps guys tend to post there more frequently than here.

With regards to CMSIS versions, to be honest from my experience there don't tend to be huge differences. If this is the only reason that you are using LPCOpen, then I would suggest that you perhaps reconsider and try out some of the "earlier generation" driver examples instead. They tend to be easier to follow - LPCOpen still seems to be evolving.

HTH!
0 Kudos
Reply

3,831 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by neilt6 on Mon Apr 29 12:44:02 MST 2013
Seriously? If I'd asked this same question in an AVR forum I would have had like 50 replies by now! Doesn't anybody use the LPCOpen platform?
0 Kudos
Reply