optimization settings

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

optimization settings

1,215 Views
haroldvogel
Contributor II

How do I know, and set, the compiler optimization settings?

Labels (1)
0 Kudos
Reply
6 Replies

826 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Harold Vogel

You didn't mention your device. If you're using kinetis, the optimization options in CodeWarrior can be set up in the GCC compiler settings:

optimize-for-code-size.png

You can also check this post:

https://mcuoneclipse.com/2012/11/11/optimizing-the-kinetis-gcc-startup/

About the code size you can check these posts by our colleague Erich:

https://mcuoneclipse.com/2014/07/13/listing-code-and-data-size-for-each-source-file-with-gnu-and-ecl...

https://mcuoneclipse.com/2012/09/24/code-size-information-with-gcc-for-armkinetis/

https://mcuoneclipse.com/2014/05/04/printing-code-size-information-in-eclipse/


Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

826 Views
martin_kovar
NXP Employee
NXP Employee

Hi,

which IDE  and device you use?

Regards,

Martin

0 Kudos
Reply

826 Views
haroldvogel
Contributor II

Also, how do I know how much memory is being used by the code? I can see the size of the .ELF and .HEX files but not sure how that relates to the code being stored in the on-board Flash?

Sincerely,

H. John Vogel

0 Kudos
Reply

826 Views
BlackNight
NXP Employee
NXP Employee

Hi John,

in case you are using S08: the linker prints the code/data size to the console.

Otherwise, if using the GNU size utility, this one might be helpful: https://mcuoneclipse.com/2013/04/14/text-data-and-bss-code-and-data-size-explained/

In any case, all the details are in the .map (produced by the linker) file.

I hope this helps,

Erich

0 Kudos
Reply

826 Views
haroldvogel
Contributor II

Hello Erich,

If by device you mean the CPU it is MKL36Z256VLL4, this is a Kinetis device using Code Warrior with GCC complier.

John

0 Kudos
Reply

826 Views
haroldvogel
Contributor II

I hope that this helps:

CodeWarrior Development Studio

(c) Freescale Semiconductor, Inc. 2014. All rights reserved.

Learn more about CodeWarrior at

http://www.freescale.com/codewarrior

Installed Products:

- CodeWarrior for MCU

Version: 10.6

Build Id:140329

0 Kudos
Reply