Debug is OK, Release

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

Debug is OK, Release

375 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeHalo on Mon Nov 15 15:33:39 MST 2010
Hopefully a simple one for someone to answer, but I'm stumped!

Using the 1768 xpresso board, I have been running in debug configuration for a while and all is fine.

I'm now (unsucessfully) trying to use the CAN port, and I think one problem I have might be the clock speeds, so I change the PLL0CFG_Val and CCLKCFG_Val (I'm using CMSIS), but the clock value doesn't change.

I then think that this may be because I'm in debug mode (where a crystal clock doesn't mean much when single-stepping), so I right-click on the project and choose 'build configurations -> set active -> release'.

When I build the project now, I get the following error from the linker:

[SIZE=2][FONT=Courier New]Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"" -Xlinker -Map=Mike1768CAN.map -Xlinker --gc-sections -mcpu=cortex-m3 -mthumb -T "Mike1768CAN_Release.ld" -o"Mike1768CAN.axf"  ./src/IRQ.o ./src/VSM.o ./src/can.o ./src/cr_startup_lpc17.o ./src/main.o   -lCMSISv1p30_LPC17xx
c:/nxp/lpcxpresso_3.5/tools/bin/../lib/gcc/arm-none-eabi/4.3.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lCMSISv1p30_LPC17xx
collect2: ld returned 1 exit status
arm-none-eabi-gcc.exe: unrecognized option '-Map=Mike1768CAN.map'
make: *** [Mike1768CAN.axf] Error 1[/FONT][/SIZE]

What am I missing? The [SIZE=2][FONT=Courier New]CMSISv1p30_LPC17xx [/FONT][/SIZE]file is where it's always been ;-)
How can the same code compile, link, download and run in 'debug' configuration but not in 'release'?

Any help at all would be appreciated.
Mike
0 Kudos
Reply
3 Replies

358 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeHalo on Tue Nov 16 05:36:46 MST 2010
Thank you both for your quick and helpful replies.
The answer is obvious when someone points it out to you ;-)

Cheers!
0 Kudos
Reply

358 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Nov 16 01:39:09 MST 2010
As per Zero's response, if you build a project for release, you need to make sure that you have also built a release build of the CMSIS library (or any other library projects that your project is linked with).

The easiest way to make sure this happens is to change the build configuration of both projects (or perhaps all projects in your workspace) at the same time. For details of how to do this, see the FAQ:

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

Regards,
CodeRedSupport
0 Kudos
Reply

358 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Nov 15 16:44:56 MST 2010
[FONT=Courier New][SIZE=2]c:/nxp/lpcxpresso_3.5/tools/bin/../lib/gcc/arm-none-eabi/4.3.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lCMSISv1p30_LPC17xx[/SIZE][/FONT]

You have to compile also a 'Release' version of CMSISv1p30_LPC17xx. Obviously this Lib cannot be found.
0 Kudos
Reply