EasyManua.ls Logo

Texas Instruments MSP430

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Writing MSP430 C Code
Debug Options
Until recently, you were required to use the –g option when you wanted source-level debugging
turned on. The drawback to this option was that it affected the code performance and size. This
has changed… since source-level debugging does not affect the optimizer’s efficiency, it is
always enabled.
On the other hand, if you want to see your C code interlisted with its associated assembly code,
then you should use the ss option. Be aware, though, that this does still affect the optimizer
which means that you should turn off this option when you want to minimize the code size and
maximize performance such as when building your production code.
Optimize Options (aka Release Options)
We highlight 3 optimization options:
-o turns on the optimizer. In fact, you can enable the optimizer with different levels of
aggressiveness; from o0 up thru o4. When you get to o3, the compiler is optimizing code
across the entire C file. Recently, TI has added the o4 level of optimization; this provides
link-time optimizations, on top of all those performed in level o3.
-mf lets the compiler know how to tradeoff code size versus speed.
-k does not change the optimizer; rather, it tells the tools to keep the assembly file (.asm). By
default the asm file is deleted, since it’s only an intermediate file. But, it can be handy if you’re
trying to debug your code and/or want to evaluate how the compiler is interpreting your C
code. Bottom Line: When optimizing your code, replace the ss option with the k option!
MSP430 Workshop - Programming C with CCS 2 - 21

Table of Contents

Other manuals for Texas Instruments MSP430

Related product manuals