KL05Z code size problems :)

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

KL05Z code size problems :)

Jump to solution
785 Views
kazola
Contributor III

Hi,

it seems everybody is working with KL25Z. However, I'm working with KL05Z.

By using Processor Expert, it seems the code I get is too big. I need PE + Freemaster + TSS.

No problem in using an ASLider in Basic mode. It even works my Freemaster project and I can see the graphs :smileyhappy:

However, this is what I get when I try to configure in AFID mode:

"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j8 all

'Building target: FRDM_PE_2.elf'

'Executing target #29 FRDM_PE_2.elf'

'Invoking: ARM Ltd Windows GCC C Linker'

"C:/Freescale/CW MCU v10.6/Cross_Tools/arm-none-eabi-gcc-4_7_3/bin/arm-none-eabi-gcc"    @"FRDM_PE_2.args" -o"FRDM_PE_2.elf"

c:/freescale/cw mcu v10.6/cross_tools/arm-none-eabi-gcc-4_7_3/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: FRDM_PE_2.elf section `.text' will not fit in region `m_text'

c:/freescale/cw mcu v10.6/cross_tools/arm-none-eabi-gcc-4_7_3/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: region `m_text' overflowed by 944 bytes

collect2.exe: error: ld returned 1 exit status

mingw32-make: *** [FRDM_PE_2.elf] Error 1

So, my questions are twofold:

1) Why I cannot see the code size even if I configure the thing as indicated in the following link?

Code Size Information with gcc for ARM/Kinetis | MCU on Eclipse

2) How can I reduce this code size? It seems it is 944 bytes too big.

Many thanks, please let me know! :smileyhappy:

Perhaps am I suffering from the same issue than in my previous post? I managed to build the project but I woudn't like to be in the same place :smileyhappy:

TSS 3.1 KL05Z-FRDM builds but cannot run

Labels (1)
0 Kudos
1 Solution
508 Views
BlackNight
NXP Employee
NXP Employee

The gcc code with -O0 (no optimization) is rather big, so changing it to -O1 might do the trick.

Or use -Os:

pastedImage_0.png

There is just the downside that optimized code will impact debugging. But -O1 should not impact it too much.

And: the code size you get printed after a sucessful linking phase. In case you need to find out what is eating up memory, you might temporarily increase the flash (m_text) size in the linker file (as if you would have more FLASH available).

I hope this helps,

Erich

View solution in original post

0 Kudos
2 Replies
509 Views
BlackNight
NXP Employee
NXP Employee

The gcc code with -O0 (no optimization) is rather big, so changing it to -O1 might do the trick.

Or use -Os:

pastedImage_0.png

There is just the downside that optimized code will impact debugging. But -O1 should not impact it too much.

And: the code size you get printed after a sucessful linking phase. In case you need to find out what is eating up memory, you might temporarily increase the flash (m_text) size in the linker file (as if you would have more FLASH available).

I hope this helps,

Erich

0 Kudos
508 Views
kazola
Contributor III

Amazing response, thanks a lot :smileyhappy:

0 Kudos