Efficient Edit, Compile, Debug (load program) in LPCXpresso (Eclipse)

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

Efficient Edit, Compile, Debug (load program) in LPCXpresso (Eclipse)

1,481 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by thommaughan on Fri Oct 10 07:35:03 MST 2014
I am new to LPCXpresso, coming from MSP430 and Code Composer Studio.

I'm using the Xpresso LPC11C24 (http://www.embeddedartists.com/products/lpcxpresso/lpc11C24_xpr.php) for evaluation and have installed LPCXpresso and followed the quick start guide (http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quicks...) for setting it up and importing the target specific examples.  

My question is on the use of Eclipse for an efficient Edit -> Compile -> load code and Debug cycle.  By this I mean minimum number of mouse clicks, key strokes, and uplug, replug of the USB to reset the Link2.  

The sequence I'm using is to
1) edit text in the editor (no issues, that seems to work).  

2) I then select the example in the project folder view and right click and select build project.   At times, this builds all the examples, but mostly it builds the selected example.    I'm confused by what is a project, what is a workspace and what is an example or application - I've not yet figured out the Eclipse terms.   I can live with the build everything occasionally issue.

3) When I try to load code, the painful problems begin.  I believe I'm supposed to switch to the debug perspective, and this I do by pressing the icon that looks like a bug.   The first time I do this after starting LPCXpresso, I get the results I'm looking for, that is code is loaded and I'm ready to run or single step.

Now when I go back to edit, I'm not switching Eclipse perspective, but rather just editing the file, then  right-click build project.      When I make a minor edit to the c file, the build kicks off more compiles than I'd expect - for example it builds the i2c.c file I'm editting, the builds sys-init.c and *.axf file.   I can live with this because I have a fast laptop.

The painful problem begins when I then try to load the code and debug/run it.   There are two bug icons, one with mouse hover text 'debug project' and the other with mouse hover 'debug nxp_expresso_11c24_periph_i2c Debug already running' , this has a drop down menu next to it.   If I select the top item on the drop down, I get the Connect to Emulator dialog and the LPC-Link is not shown, when I hit the search for emulator it does not find it.   I need to unplug and replug the LPC-Link (LPC11U24 Xpresso board) for the dialog to find the emulator.   The code will then load, but IT SUCKS TO HAVE TO CYCLE THE BOARD each time.

If I select the debug icon (bug) that hovers with debug project, I get a dialog showing 'Select Launch Configuration'.   There are two items listed.   When I put a check box on the first item, it automatically puts a check box on the second item, HOWEVER, THE OK BUTTON on the dialog box stays grey (not selectable).

I can't seem to work around this very inefficient workflow and am thinking LPCXpresso might be a bit buggy (hey, it's free).   I thought I'd ask the forum before I dump LPCXpresso in the trash and switch to IAR.

I'm using: 
Product: LPCXpresso
Activation date: N/A
License file: C:\Users\Public\NXPLPCXpresso\LPCXpresso.sib
Version: LPCXpresso v7.4.0 [Build 229] [2014-09-16]
Operating system: Windows 7
VM: Java HotSpot(TM) Client VM (32 bit)


Thanks,

Thom



0 Kudos
Reply
8 Replies

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Oct 14 08:45:20 MST 2014
Dropping down the Run menu shows that "Debug last launched" is set to F11. So, after you have started your first debug session (using the Quickstart button), then hitting F11 should start you debugging again. Ctrl-F2 is Terminate.

(Come on, dropping down the menu and reading the shortcut keys is not hard - is it?)
0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by thommaughan on Tue Oct 14 07:39:54 MST 2014
I've tried a couple of key assignments, but seem to have issues with Eclipse perspective. 

If you have to ask about clicking a particular icon in a 'space shuttle cockpit' number of icon options means you don't mind moving your hands from the keyboard to the mouse and back again - I'm ok with it, but find it inefficient when I'm in the thick of development.

I am not able to just hit the Debug button, I must also hit the Terminate first then the Debug button, other wise I spin off into more unnecessary mouse clicks in dialog boxes.

I'm sure it will get to be muscle memory after a while, but I (personally) find it woefully lacking to have an IDE with the MOST common used features (build, load code) lacking a standard hot key.    I'll admit I've not read all the documents (but I believe the MOST common used features should be documented in a quick start).

Thanks anyway for the help,

best regards, 

Thom
0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Mon Oct 13 04:20:14 MST 2014
But the one that I would like still has not turned up in the command list -- "Move to line" as appears on the right click context menu
in the disassembly and the edit window (while debugging). I.e. to change the PC to the highlighted line of code/disassembly.
So I still cannot give it a hot key combo.

NB: this is not the same as "Run to line".
And I think "Go to line" only positions the edit cursor.

Cheers.
0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sun Oct 12 11:37:33 MST 2014

Quote: thommaughan
I'll share how to assign hot keys when I get it figured out.



Window->Preferences->General->Keys  :)
0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sun Oct 12 10:41:11 MST 2014

Quote:
I prefer to have hotkeys assigned for 1) compile, and 2) debug (load flash, attach debugger), then break at first line of main(). Mouse clicking and select entry, right click is a bit inefficient in my opinion.



To assign keys:
Window->Preferences, then select General and Keys. There are hundreds of keys already assigned and hundreds more for you to assign. You can create a key binding for Build Project and Debug.

For Building and Debug, as TheFallGuy already said, just press the Debug button in the Quickstart panel (does a Build and debug in one click). Whats inefficient about that?


0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by thommaughan on Sat Oct 11 12:22:24 MST 2014
Thanks for the pointer to the user's guide.    I had not read all 131 pages, but had gone to section 4.    The problem I'm having appears to be due to the a sequence of events.    I was hoping to make my edit, then build and run the debugger as few keystrokes as possible and with little or no mouse.    If you follow the user's guide, the quickstart launch of the debugger on subsequent runs, brings up the "Connect to Emulator' and the only way to get the emulator to show as an option is to unplug and replug.  

I have found thru trial and error, that what's needed is to 'Terminate' by right click in the debug window on the lowest entry of my project in the debug window before re-launching the debugger (load code, go main).    I'm hoping to figure out how to reduce the number of right click steps and automate the terminate as a pre-step to launching the comple/debug.

As a suggestion to the documentation, I think the edit->compile->debug cycle should be documented in a quick start guide with the user's guide there to supply all the explanations and details on advanced features.

I prefer to have hotkeys assigned for 1) compile, and 2) debug (load flash, attach debugger), then break at first line of main().   Mouse clicking and select entry, right click is a bit inefficient in my opinion.   

I'm still a new user to LPCXpresso and learning - I'll share how to assign hot keys when I get it figured out.

Thanks again,

Thom

0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Sat Oct 11 05:28:07 MST 2014
2) press the build button in the QuickStart panel. If the project relies on a library and the library needs rebuilding, it will build that too

3) do not switch to debug perspective. Just press the debug button in the QuickStart panel. It does everything for you

It does explain this in the use guide...
0 Kudos
Reply

1,450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sat Oct 11 00:23:20 MST 2014
I suggest that you start off by reading the supplied LPCXpresso User Guide (supplied in PDF inside the installation directory, or accessible from the Welcome screen or Help menu). And also watch the "Rapid Embedded Development with LPCXpresso" video, available from:

http://www.lpcware.com/lpcxpresso

This should give you a much better grasp of how LPCXpresso IDE is meant to be used.

Regards,
LPCXpresso Support
0 Kudos
Reply