LPCXpresso Build and Debug Questions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPCXpresso Build and Debug Questions

3,224件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sat Jul 10 05:23:36 MST 2010
1) More often than not LPC Xpresso loads the wrong project into the debugger even though I have the project I want selected and the cursor is clicked inside the window of the source code I want to debug and run.  Why is this, am I doing something wrong or is there a bug in LPCXpresso?  Anyone else having this issue?

2) Is there a one click way to build only the current project?  There is the "Build All" button on the tool bar but it builds all projects and takes too long.  There is the "Build Project" from right clicking on the current project.  Is there are way to add a button to the toolbar for "Build Current Project" or is there a ctrl key sequence for this?

3) How do you deselect all of the grey highlighted text that the editor does to find matching symbols?

4) How do you flash a Release build into the part?
0 件の賞賛
返信
15 返答(返信)

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Feb 11 09:01:01 MST 2012

Quote:
**** Build of configuration Debug for project CMSISv2p00_LPC11Uxx ****
...
[COLOR=Red]Invoking: MCU Archiver[/COLOR]
...

You are building a library, so there's nothing to debug :eek:

Use a real project, and the linker will hopefully create something you can execute and therefore debug :)


Quote:

**** Build of configuration Debug for project LPC11_Switch ****

make all
Building file: ../src/can.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=can.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/can.d" -MT"src/can.d" -o"src/can.o" "../src/can.c"
Finished building: ../src/can.c

Building file: ../src/cr_startup_lpc11.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=cr_startup_lpc11.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/cr_startup_lpc11.d" -MT"src/cr_startup_lpc11.d" -o"src/cr_startup_lpc11.o" "../src/cr_startup_lpc11.c"
Finished building: ../src/cr_startup_lpc11.c

Building file: ../src/i2.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=i2.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/i2.d" -MT"src/i2.d" -o"src/i2.o" "../src/i2.c"
Finished building: ../src/i2.c

Building file: ../src/main.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=main.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.c"
Finished building: ../src/main.c

Building file: ../src/uart.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=uart.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/uart.d" -MT"src/uart.d" -o"src/uart.o" "../src/uart.c"
Finished building: ../src/uart.c

Building file: ../src/wdt.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv2p00_LPC11xx -DCR_INTEGER_PRINTF -I"C:\nxp\workspace\CMSISv2p00_LPC11xx\inc" -O2 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -Wa,-ahlnds=wdt.asm -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/wdt.d" -MT"src/wdt.d" -o"src/wdt.o" "../src/wdt.c"
Finished building: ../src/wdt.c

Building target: LPC11_Switch.axf
[COLOR=Red]Invoking: MCU Linker[/COLOR]
arm-none-eabi-gcc -nostdlib -L"C:\nxp\workspace\CMSISv2p00_LPC11xx\Debug" -Xlinker -Map=LPC11_Switch.map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "LPC11_Switch_Debug.ld" -o"LPC11_Switch.axf"  ./src/can.o ./src/cr_startup_lpc11.o ./src/i2.o ./src/main.o ./src/uart.o ./src/wdt.o   -lCMSISv2p00_LPC11xx
Finished building target: LPC11_Switch.axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size LPC11_Switch.axf; # arm-none-eabi-objcopy -O binary LPC11_Switch.axf LPC11_Switch.bin ; checksum -p LPC11C14_301 -d LPC11_Switch.bin;
   text       data        bss        dec        hex    filename
  14352         52       1012      15416       3c38    LPC11_Switch.axf

0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alexandergb on Sat Feb 11 08:30:21 MST 2012
I'm a novice in LPCXpresso.
I decided to make a project with blinking LED.
There are no problems when I build a project, but I can't download a project into target, because the button 'Debug' is not availiable.

This is build protocol:

**** Build of configuration Debug for project CMSISv2p00_LPC11Uxx ****

make all
Building file: ../src/blinky.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -I../inc -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/blinky.d" -MT"src/blinky.d" -o"src/blinky.o" "../src/blinky.c"
Finished building: ../src/blinky.c

Building file: ../src/core_cm0.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -I../inc -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/core_cm0.d" -MT"src/core_cm0.d" -o"src/core_cm0.o" "../src/core_cm0.c"
Finished building: ../src/core_cm0.c

Building file: ../src/gpio.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -I../inc -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/gpio.d" -MT"src/gpio.d" -o"src/gpio.o" "../src/gpio.c"
Finished building: ../src/gpio.c

Building file: ../src/system_LPC11Uxx.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -I../inc -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/system_LPC11Uxx.d" -MT"src/system_LPC11Uxx.d" -o"src/system_LPC11Uxx.o" "../src/system_LPC11Uxx.c"
Finished building: ../src/system_LPC11Uxx.c

Building target: libCMSISv2p00_LPC11Uxx.a
Invoking: MCU Archiver
arm-none-eabi-ar -r "libCMSISv2p00_LPC11Uxx.a"  ./src/blinky.o ./src/core_cm0.o ./src/gpio.o ./src/system_LPC11Uxx.o  
c:\nxp\LPCXpresso_4.1.5_219\lpcxpresso\tools\bin\arm-none-eabi-ar.exe: creating libCMSISv2p00_LPC11Uxx.a
Finished building target: libCMSISv2p00_LPC11Uxx.a

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size libCMSISv2p00_LPC11Uxx.a ; # arm-none-eabi-objdump -h -S libCMSISv2p00_LPC11Uxx.a >libCMSISv2p00_LPC11Uxx.lss
   text   data    bss    dec    hexfilename
   1762      0    152   1914    77ablinky.o (ex libCMSISv2p00_LPC11Uxx.a)
      0      0      0      0      0core_cm0.o (ex libCMSISv2p00_LPC11Uxx.a)
   1670      0    152   1822    71egpio.o (ex libCMSISv2p00_LPC11Uxx.a)
    400      4      0    404    194system_LPC11Uxx.o (ex libCMSISv2p00_LPC11Uxx.a)


Please help!
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tinto on Sun Feb 05 23:28:42 MST 2012

Quote:
3) How do you deselect all of the grey highlighted text that the editor does to find matching symbols?




You can disable the grey highlighting by clicking the "Toggle Mark Occurrences" icon. You can see this icon right to the search option at the top. The key board shortcut is Alt+Shift+O.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jul 11 10:37:32 MST 2010
Glad you are now sorted.

One final point, we do actually have a knowledgebase entry about changing projects between debug and release.....

Changing the current build configuration of multiple projects
http://lpcxpresso.code-red-tech.com/LPCXpresso/node/24
[Login required]

Regards,
CodeRedSupport.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jul 11 09:56:05 MST 2010

Quote: CodeRedSupport
The easiest thing to do is select all the projects you want to build, and then press the "Hammer" icons drop-down and select Release or Build. It will then build all selected projects for that build configuration.



This is a great tip.  I didn't know you could select multiple projects like that!  I also did not realize that the build mode is project specific- I think that was my issue all along because some projects were set to Release and others to Debug.

Thanks for your help.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jul 11 09:17:54 MST 2010
p.s. "Build All" will build each project for its currently selected build configuration. Thus, if one project is set for Release and another is set for Debug, then the first will be built for Release and the other will be built for Debug.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jul 11 09:15:42 MST 2010
The easiest thing to do is select all the projects you want to build, and then press the "Hammer" icons drop-down and select Release or Build. It will then build all selected projects for that build configuration.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jul 11 09:10:31 MST 2010
OK, I see that.  However what is throwing me off is if all of these projects are in the same workspace and I do a "Clean All" and then a "Build All" why does that not build everything needed for all projects in the workspace?  Why do you have to go into each project separately and build them individually?
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jul 11 08:54:48 MST 2010
Well, if you READ the error message, you will see that it is now expecting to find a release version of  [FONT=monospace][/FONT]LPC13xx_Lib.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jul 11 08:51:40 MST 2010
That does not seem to fix things.

I build CMSISv1p30_LPC13xx for release:
**** Build of configuration Release for project CMSISv1p30_LPC13xx ****

make all 
Building file: ../src/core_cm3.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DNDEBUG -D__CODE_RED -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\inc" -O2 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -MMD -MP -MF"src/core_cm3.d" -MT"src/core_cm3.d" -o"src/core_cm3.o" "../src/core_cm3.c"
Finished building: ../src/core_cm3.c
 
Building file: ../src/system_LPC13xx.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DNDEBUG -D__CODE_RED -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\inc" -O2 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -MMD -MP -MF"src/system_LPC13xx.d" -MT"src/system_LPC13xx.d" -o"src/system_LPC13xx.o" "../src/system_LPC13xx.c"
Finished building: ../src/system_LPC13xx.c
 
Building target: libCMSISv1p30_LPC13xx.a
Invoking: MCU Archiver
arm-none-eabi-ar -r "libCMSISv1p30_LPC13xx.a"  ./src/core_cm3.o ./src/system_LPC13xx.o   
c:\nxp\lpcxpresso_3.4\tools\bin\arm-none-eabi-ar.exe: creating libCMSISv1p30_LPC13xx.a
Finished building target: libCMSISv1p30_LPC13xx.a
 
make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size libCMSISv1p30_LPC13xx.a ; # arm-none-eabi-objdump -h -S libCMSISv1p30_LPC13xx.a >libCMSISv1p30_LPC13xx.lss
   text   data    bss    dec    hexfilename
    164      0      0    164     a4core_cm3.o (ex libCMSISv1p30_LPC13xx.a)
    524      4      0    528    210system_LPC13xx.o (ex libCMSISv1p30_LPC13xx.a)



I still get the error when I build my project for release:
**** Build of configuration Release for project LPCXPresso1343_timer32 ****

make all 
Building file: ../src/cr_startup_lpc13.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DNDEBUG -D__USE_CMSIS=CMSISv1p30_LPC13xx -D__CODE_RED -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\inc" -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\LPC13xx_Lib\inc" -O2 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -MMD -MP -MF"src/cr_startup_lpc13.d" -MT"src/cr_startup_lpc13.d" -o"src/cr_startup_lpc13.o" "../src/cr_startup_lpc13.c"
Finished building: ../src/cr_startup_lpc13.c
 
Building file: ../src/timer32_int.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DNDEBUG -D__USE_CMSIS=CMSISv1p30_LPC13xx -D__CODE_RED -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\inc" -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\LPC13xx_Lib\inc" -O2 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -MMD -MP -MF"src/timer32_int.d" -MT"src/timer32_int.d" -o"src/timer32_int.o" "../src/timer32_int.c"
Finished building: ../src/timer32_int.c
 
Building file: ../src/tmr32test.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -DNDEBUG -D__USE_CMSIS=CMSISv1p30_LPC13xx -D__CODE_RED -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\inc" -I"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\LPC13xx_Lib\inc" -O2 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -MMD -MP -MF"src/tmr32test.d" -MT"src/tmr32test.d" -o"src/tmr32test.o" "../src/tmr32test.c"
Finished building: ../src/tmr32test.c
 
Building target: LPCXPresso1343_timer32.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\Documents and Settings\\My Documents\lpcxpresso_3.4\1343 x\CMSISv1p30_LPC13xx\Release" -L"" -Xlinker --gc-sections -Xlinker -Map=LPCXPresso1343_timer32.map -mcpu=cortex-m3 -mthumb -T "lpcxpresso1343_timer32_Release.ld" -o"LPCXPresso1343_timer32.axf"  ./src/cr_startup_lpc13.o ./src/timer32_int.o ./src/tmr32test.o   -lCMSISv1p30_LPC13xx -lLPC13xx_Lib
c:/nxp/lpcxpresso_3.4/tools/bin/../lib/gcc/arm-none-eabi/4.3.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lLPC13xx_Lib
collect2: ld returned 1 exit status
make: *** [LPCXPresso1343_timer32.axf] Error 1
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Sun Jul 11 08:35:54 MST 2010
If you are building a project for release, you need all of its dependent projects build for release too.

Build CMSISv1p30_LPC13xx for release too.
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sun Jul 11 08:13:11 MST 2010
Here is what I get when I do a Debug Build, there are no errors:
**** Build of configuration Debug for project LPCXPresso1343_timer32 ****

make all 
make: Nothing to be done for `all'.


Here is what I get when I do a Release build, there is an error and I'm not sure why:
**** Build of configuration Release for project LPCXPresso1343_timer32 ****

make all 
Building target: LPCXPresso1343_timer32.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"" -L"" -Xlinker --gc-sections -Xlinker -Map=LPCXPresso1343_timer32.map -mcpu=cortex-m3 -mthumb -T "lpcxpresso1343_timer32_Release.ld" -o"LPCXPresso1343_timer32.axf"  ./src/cr_startup_lpc13.o ./src/timer32_int.o ./src/tmr32test.o   -lCMSISv1p30_LPC13xx -lLPC13xx_Lib
c:/nxp/lpcxpresso_3.4/tools/bin/../lib/gcc/arm-none-eabi/4.3.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lCMSISv1p30_LPC13xx
collect2: ld returned 1 exit status
make: *** [LPCXPresso1343_timer32.axf] Error 1
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Sat Jul 10 08:19:05 MST 2010
What is the result of a Release Build? Could you paste the console output?

You should see a "Release" folder after a successful release build. If there is an error, there will be no axf file in that folder.

Try it also with right click the project in Project explorer, Select "Build Configurations/Set Active/Release" than right click to project again, and select "Build Project". Let's see what happens.

If you get an error, probably you should "Build all" for release version. (Libraries in default are not built. You should build them in your workspace)
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rtos on Sat Jul 10 07:48:10 MST 2010

Quote: KaraMuraT

In the Project Explorer Window, find the concerning axf file under Debug or Release directory (the one you want). You can also see the binaries in "binaries" folder but if you didn't change the default settings in project options they will have the same name, therefore it may lead you to load the wrong version.

After selecting the right axf file, right click on it, Select "Binary Utilities/Program Flash".

There you go :)



Thanks for you replies.  They were very helpful.

I see the .axf under the debug folder but there is no .axf under the release folder.  I changed the hammer icon to build a release build and the .axf still does not appear under the release folder.  Maybe there is wrong serting?
0 件の賞賛
返信

3,148件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by KaraMuraT on Sat Jul 10 06:37:26 MST 2010

Quote:
1) More often than not LPC Xpresso loads the wrong project into the  debugger even though I have the project I want selected and the cursor  is clicked inside the window of the source code I want to debug and run.   Why is this, am I doing something wrong or is there a bug in  LPCXpresso?  Anyone else having this issue?

I'm not that much experienced, but never faced something like this.


Quote:

2) Is there a one click way to build only the current project?  There is  the "Build All" button on the tool bar but it builds all projects and  takes too long.  There is the "Build Project" from right clicking on the  current project.  Is there are way to add a button to the toolbar for  "Build Current Project" or is there a ctrl key sequence for this?

There is a button on the toolbar (The hammer icon). It only compiles the selected project. If you want to compile different version of the project click the little arrow right side, and select the version you want (e.g Debug or Release). Unfortunately it does not have a short cut. Or I don't know how to assign one.


Quote:
3) How do you deselect all of the grey highlighted text that the editor  does to find matching symbols?

That bothers me too, and I don't know how to solve it.


Quote:
4) How do you flash a Release build into the part?

In the Project Explorer Window, find the concerning axf file under Debug or Release directory (the one you want). You can also see the binaries in "binaries" folder but if you didn't change the default settings in project options they will have the same name, therefore it may lead you to load the wrong version.

After selecting the right axf file, right click on it, Select "Binary Utilities/Program Flash".

There you go :)
0 件の賞賛
返信