- Important information
- New features
- Known problems
- Program corrections
- User guide corrections
- Miscellaneous
- Release history
Important information
Interrupts are disabled during hardware multiply operations.
Deprecated features
-
CLIB
The CLIB library is deprecated. It will no longer be supported in some future version of the IAR C/C++ Compiler for MSP430. Use the DLIB library instead. -
--ropi
The support for position-independent code and read-only data (ROPI) will be removed in some future version of the IAR C/C++ Compiler for MSP430.
-
Upgrade information
-
In version 6.40.1, the
SIGNATURE
segment is deprecated. Use the new segmentsJTAGSIGNATURE, BSLSIGNATURE
, andIPESIGNATURE
instead. Note that the offsets within one of the new segments might be different than in theSIGNATURE
segment. See user guide corrections for more information. -
In version 6.40.1, the linker command files for devices with IPE have changed to allow writable data to be protected in the IPE block. See user guide corrections for more information.
-
In version 6.40.1, minor changes have been made to all linker files to provide automatic workarounds for some hardware issues. See Miscellaneous for more information.
-
In order to be able to safely generate efficient code for memory accesses through
__data20
pointers with small constant offsets, the compiler in version 6.20 requires that no data is allocated in the memory range 0x10000-0x1003F (64 bytes starting at the 64k boundary). This restriction applies to both writable and read-only data. However, code can safely be placed in this range.The linker command files that are delivered with version 6.20 have been updated to reflect the new requirement. If you have copied and modified linker command files from earlier versions of the product, you will have to perform the update manually.
-
The names of the runtime libraries have been changed in version 6.10 when the concept of code models was introduced. In the IDE this change is take care of automatically, but if you are building on the command line you must change the names of the runtime libraries accordingly.
-
The compiler options
--aggressive_inlining
and--aggressive_unrolling
are replaced by the new option--no_size_constraints
. If these options were used in an Embedded Workbench project in combination with high speed, the project will be converted to us the option--no_size_constraints
instead. If they were used in combination with any other optimization level, they will be ignored.--aggressive_inlining
and--aggressive_unrolling
are still accepted on the command line, but we recommend you to use the new option--no_size_constraints
instead. -
Position independent code, as it was implemented in version 5.30 and earlier, is no longer supported. Instead we have added support for position independent code and read-only data (ROPI). ROPI can be used in the same situations but note that constant data is assumed to move together with the code. For more information about ROPI, see the IAR C/C++ Compiler Reference Guide.
-
Source code that was originally written for earlier versions of the IAR C/C++ Compiler for MSP430, can without any modifications also be used with the compiler included in this package.
-
ICC430 generates UBROF10 as debugger output object format. If an emulator which supports an earlier version of UBROF is used, XLINK must be forced to generate the appropriate UBROF format. To do this, select the correct UBROF format in the Output format drop-down list on the Output options page in the XLINK category.
New features
None.
Known Problems
-
[EW430-1511, TPB-2950] The pragma directive __printf_args does not work for class methods.
-
[EW430-1437] Position-independent code and read-only data (ROPI) does currently not work in combination with the multithread support in the DLIB library.
-
[EW430-1258, EW14296] In the CLIB library, if the toupper() macro is used for instance with an incremented array index, such as: toupper(com[index++]), the array offset will incorrectly be incremented twice. All ctype functions evaluate their arguments twice or more, which is wrong. The following workarounds exist:
1. Undefine the macro toupper, then a function call will be used instead.
2. Use parentheses to force a function call, (toupper)(com[index++]).
3. Use the IAR DLIB Library which handles macro expansion correctly. -
[EW430-1103, EW15986] The compiler always puts a nop instruction after the dint instruction in a __monitor function even if it is not necessary.
-
[EW430-532, EW22686] The compiler does not issue a MISRA-C warning when a macro is expanded to nothing.
-
[EW430-473, EW23539] When time_t is 32 bits, gmtime will not return NULL for too large time_t values (after the year 2035).
Program Corrections
None
User guide corrections
The corrections below refer to the PDF version of the user guide IAR C/C++ Compiler Reference Guide for MSP430, C430-13.
None.
Miscellaneous
-
Workarounds for hardware problems:
-
CPU4:
When
--core=430
is given, the compiler will use a safe alternative encoding forPUSH #4/#8
. -
CPU6:
When
--hw_workaround=CPU6
is given, the compiler will replace@Rn
operands with0(Rn)
unlessRn
isPC
. The runtime libraries are built with--hw_workaround=CPU6
enabled, but the IDE does not automatically enable this workaround for affected devices. -
CPU8:
The compiler never generates code that puts odd values into the
SP
register. It assumes that the value in theSP
register is always even. -
CPU11, CPU12, CPU13, CPU45:
Not handled by the IAR Embedded Workbench for MSP430 toolchain.
-
CPU15:
In situations where a device affected by CPU15 would branch to a different location than an unaffected device, the compiler adds a symbolic value
?CPU15_OFFSET
to the branch offset. This value is defined in the linker command files to be either 0 (for unaffected devices), or 2 (for affected devices). -
CPU16:
The compiler generates code that works on both affected and unaffected devices.
-
CPU18, CPU19, CPU24, CPU25, CPU27, CPU29:
If the option
--hw_workaround=nop_after_lpm
is given to the compiler, it will automatically issue aNOP
after every instruction that might change the LPM bits in the status registerSR
. The runtime libraries are built with--hw_workaround=nop_after_lpm
enabled, and the IDE enables it automatically for all affected devices. -
CPU20:
The linker command files for affected devices do not allow code in default segments to be placed on the last four bytes of a memory region that is not followed by valid memory. If you modify the address ranges in the linker command file, or add custom segments, you must ensure that this constraint is still met.
-
CPU21:
The compiler never generates
POPM #1, SR
. -
CPU22:
The compiler never generates
@PC
operands, because they are not useful in real applications. -
CPU23, CPU34:
The compiler never generates instructions that rotate the
PC
register, because they are not useful in real applications. -
CPU26:
The compiler never generates
CALL SP
instructions. -
CPU28:
The compiler never generates instruction sequences that trigger this issue.
-
CPU30:
In situations where a device affected by CPU30 would branch to a different location than an unaffected device, the compiler adds a symbolic value
?CPU30_OFFSET
to the branch offset. This value is defined in the linker command files to be either 0 (for unaffected devices), or 2 (for affected devices). -
CPU31:
The compiler never generates code that uses the auto-increment mode with a push instruction.
-
CPU32:
The compiler never generates
CALLA PC
instructions. -
CPU33:
The compiler never uses negative stack offsets, because they would access the unallocated memory outside the current stack. Such memory can be corrupted at any time by interrupts.
-
CPU35:
The compiler never generates
BIT.B @Rx, PC
instructions. -
CPU39:
If
--core=430X
is given to the compiler, it always places aNOP
after any instruction that might disable interrupts. -
CPU40:
If
--hw_workaround=CPU40
is given to the compiler, it will emit aNOP
whenever the last instruction in a segment part is a jump instruction. The IDE does this automatically for all affected devices.
-
-
Hardware achitecture notes:
-
The 430X architecture requires that a
DINT
or other instruction that disables interrupts must be followed by aNOP
.When
--core=430X
is given to the compiler, it will automatically issue aNOP
after every instruction that might disable interrupts.
-
The 430X architecture requires that the
GIE
bit in the status registerSR
is not set by one instruction and then cleared by the next instruction, for example by the code sequenceEINT; DINT
.When
--core=430X
is given to the compiler, it will automatically issue aNOP
between every such pair of instructions.
-
The 430X architecture requires that interrupt flags must not be reset by the instruction immediately before an
EINT
or other instruction that enables interrupts.When
--core=430X
is given to the compiler, it will automatically issue aNOP
before every such instruction.
-
Release history
Version 7.11.3
Program corrections
-
[EW430-1510] The compiler incorrectly determines that parts of the structure could be copied using .A instructions when there is a pointer cast inside a copy statement.
This can result in unwanted truncation of data.
-
[EW430-1507] The command line compiler option" --diagnostics-tables" does not work on MSP430 version 7.11.
Version 7.11.1
Program corrections
-
[EW430-1490] The intrinsic function __delay_cycles sometimes emits code that consumes 2 cycles too few.
-
[EW430-1469] On medium or higher optimization level, if a variable is first initialized by a memcpy call, then changes, and then after the change is used as source by a memcpy call, the optimizer might revert the changes to the variable.
-
[EW430-1464, TPB-2824] Persistent variables cannot be placed in user-defined segments, and the compiler issues no warning for this.
-
[EW430-1463] In expressions of the form (x & 1) >> 1, the variable x might be corrupted.
-
[EW430-1460] The compiler sometimes generates a call to the library function ?DivMod16s to perform an 8-bit modulo operation, when a call to ?DivMod8s would have been sufficient.
Version 7.10.1
Program corrections
[EW430-534, EW22679] When MISRA-C rule 10.1 or 10.6 is enabled, an error is issued for #pragma vector=XXX_VECTOR, for the vector constants defined in supplied device header files.
[EW430-332, EW26314] Loops where the loop counter is incremented both with a loop-invariant non-constant expression and a constant can trigger an internal error on optimization level High.
[EW430-330, EW26331] In rare cases, when the source code contains an infinite loop, the compiler could use the stack register as a plain temporary register.
[EW430-1412] At optimization level High, the compiler can incorrectly move instructions into loops in a way that changes the behavior of the program.
[EW430-1410] At optimization level High, the code generated by the compiler can be different from one run to the next.
Version 6.50.1
New features
-
Extended functionality in C-STAT
Two new packages of checks: CERT and SECURITY.
The MISRA C:2012 package has been updated with about 90 new checks, of which some are enabled by default.
The analysis engine has been improved to increase the analysis precision for both existing and added coding rules. This can have the effect that the number of issued messages for a file or project can differ compared to previous versions of C-STAT, even if the enabled checks are exactly the same.
There is a new option to enable or disable the false-positives elimination phase of the analysis that is performed on each source file. (
--fpe
when usingicstat.exe
, or Enable false-positive analysis when using C-STAT in the IAR Embedded Workbench IDE.)There is a new option (
--exclude path
) to exclude files from analysis.C-STAT message suppression can now be controlled by directives placed in comments in the source files. See Descriptions of compiler extensions for C-STAT in the C-STAT Static Analysis Guide.
C-STAT settings in an old IAR Embedded Workbench IDE or Eclipse project will be updated. Some checks will be renamed (they retain their enabled or disabled settings), some checks are removed, and many new checks are added (see above).
Importing settings for C-STAT checks from a file will use the same logic as used when updating the project settings, if the settings file is created with an old version of C-STAT.
Extended inline assembler
The inline assembler has been extended with the possiblity to take input arguments, have return values, and read or write to C symbols.The inline assembler now supports the following syntax which is compatible with the syntax of the GCC compiler:
__asm(ASSEMBLER_LINES [: OUTPUT [: INPUT [: CLOBBER]]])
OUTPUT
can be used to set values in the surrounding programINPUT
is used to pass values to the inline assembler linesCLOBBER
describes resources that are destroyed by the inline assembler statement
unroll
This new pragma directive can be used to specify that the loop following immediately after the directive should be unrolled with the specified number of copies of the loop body.
Program corrections
EW25937: The compiler can sometimes fail to initialize a flexible array member.
EW25759: If a variable using
__ro_placement
needs dynamic initialization an error should be issued at compile time.
Version 6.40.4
-
Updated device header files:
- Enhanced DEFWL macro
- Corrected family definition for several FR2xx devices
- Added ADC10PDIV_3 definition to resolve backwards compatibility issues
Version 6.40.3
-
EW25979: Jump length optimization between functions can cause functions to be marked as "keep-with-next" even when not needed. This could lead to XLINK failing to fit an application into memory, if more than one CODE memory range is used.
Version 6.40.2
EW25884: Static member functions of template classes defined outside the class cause the compiler to terminate with an internal error if any IAR function type attributes are used on the function.
EW25839: Prevent calls to the
setjmp
standard functions from being extracted to a subroutine.
Version 6.40.1
New features
-
Improved compiler performance
The complier has been further optimized for both speed and size giving a 7.9 % improvement on the EEMBC ULP Bench and 11.3 % on EEMBC CoreMark benchmarks. -
Multiplication related enhancements:
-
The compiler uses the hardware multiplier more efficiently.
-
Speedup of integer and floating-point multiplication routines in the runtime library. This includes new floating-point routines tailored for the 32-bit hardware multiplier and overall faster 64-bit integer multiplication.
-
-
__no_multiplier
: New function object keyword that suppresses generation of code to directly access the hardware multiplier. -
New intrinsic functions for performing saturated addition and subtraction. When the mathematical result is outside the range of the destination type, the result is the smallest or largest value the type can hold.
The functions are
__saturated_add_type(value, value)
and__saturated_sub_type(value, value)
. All integer types, both signed and unsigned, are supported. See the file "intrinsics.h" for details. -
__data20 setjmp
and__data20 longjmp
Two new functions,__data20_setjmp
and__data20_longjmp
, declared inintrinsics.h
, provide variants ofsetjmp
andlongjmp
that allow the jump buffer to be placed in__data20
memory. These functions are only available when using the MSP430X architecture and the medium or large data model.
Program corrections
-
EW25768: An internal error was issued when placing packed structs in
__regvar
variables. Now an error is issued. -
EW25742: When accessing
__data20
pointers in arrays, the compiler can emit aMOVA
instruction with the wrong offset. If this happens a "Register displacement out of range" internal error is issued. -
EW25705: MISRAC++2008-8-5-2 fails for arrays with more than 100 elements even though it uses an initializer with the correct amount of elements.
-
EW25675: The information about the RAM area in
lnk430f5359.xcl
is incorrect, it should be01C00 - 063FF
. -
EW25560: The information about core in
lnkrf430frl152h.xcl
is incorrectly set to MSP430X. -
EW25495: When checking MISRAC2012-Dir-4.10 (include guards), any system header included using "..." instead of <...> is considered in violation of the rule.
-
EW25360: The MID definitions are missing in the files
io430f5358.h, io430f5359.h, io430f5658.h, io430f5659.h, io430f6458.h, io430f6459.h, io430f6658. h,
andio430f6659.h
.
Version 6.30.2
-
EW25474: C-STAT may fail when an analyzed source file or header file has a path containing multibyte characters.
-
EW25289: The compiler might terminate with an internal error when compiling a member function of a template class or a template member function of a non-template class, where an IAR type attribute (like
__monitor
) is used and the function has one or more default arguments. -
EW25279: Using the address of a string literal in the initializer for a variable with static storage duration can cause the compiler to terminate with an internal error.
-
EW25257: A variable may have its live range extended to the end of the function if the last access is through alias effects of a function call.
Version 6.30.1
New features
-
General code optimizations.
Program corrections
None.
Version 6.20.2
EW25178: The compiler sometimes generated a
MOVA
instruction with indexed addressing mode to access 20-bit data in__data16
memory. On devices where the CPU16 erratum has been fixed, the wrong memory address would be accessed.
Version 6.20.1
New features
Smaller math functions
You can choose between default mathematical functions and a smaller version by choosing Project > Options > General Options > Library Options.See the user guide for more information.A new option
--no_ubrof_messages
that can be used to minimize the size of your application object file by excluding messages from the UBROF files. See the user guide for more information.Both the compiler and the assembler now support comparing
__CORE__
with either__430__/__430X__
or__430_CORE__/__430X_CORE__
, to allow code to be shared between C/C++ and assembler.Due to the pipeline CPU architecture, the compiler now inserts a
NOP
instruction before enabling interrupts on devices with the MSP430X core to ensure proper subsequent instruction fetches in the pipeline.The address of the hardware multiplier is now determined at link time. The advantage, compared to determining this at compile time, it that fewer libraries are needed to cover all devices.
The following changes have been made:
The command line option
--multiplier_location
has been removed.The global symbol
__iar_HWMUL
holds the location of the hardware multiplier. The provided device-specific linker command files define this.
Changes related to the TI MathLib library:
More function calls are redirected to MathLib using the linker configuration files
mathlib32.xcl
andmathlib64.xcl
, used with 32- and 64-bit doubles, respectively.MathLib can now be used with CLIB when 32-bit doubles are used.
MathLib functions can be called from CLIB when 64-bit doubles are used, but the "f" version (as in
sinf
) must be declared manually.MathLib can now be used with locked registers.
Program corrections
[EW430-567, EW22399] If the construct "switch(__even_in_range(...))" is used, and the compiler managed to fully optimize away the entire switch statement, the error "Error[Ta021]: This intrinsic can only be used as argument to a switch statement" might be issued.
EW24863: At high optimization, an
__even_in_range
switch with a constant value as input that happened to be inlined can sometimes trigger the silicon erratum CPU30.EW24699: Corrected a problem where the TI MathLib library was not used on high optimization levels.
EW24698: The TI MathLib library can be used with both 32 and 64 bit doubles.
Corrected a problem where XLINK reported a basic types warning.
The compiler sometimes uses
MOV
orMOVA
instructions instead ofMOVX
for memory accesses through__data20
pointers with constant offsets. In rare cases, this can lead to the wrong address being accessed.The compiler sometimes uses
MOVX.A
orMOVA
with register indexed addressing mode to access 20-bit data in__data16
memory. In rare cases, this can lead to the wrong memory address being accessed.
Version 6.10.5
The header files for the following devices have been corrected:
MSP430FR4131, MSP430FR4132, MSP430FR4133
MSP430I2020, MSP430I2021, MSP430I2030, MSP430I2040, MSP430I2041
MSP430FR5887, MSP430FR5888, MSP430FR5889, MSP430FR5986, MSP430FR5987, MSP430FR5988, MSP430FR5989
MSP430FR6887, MSP430FR6888, MSP430FR6889, MSP430FR6987, MSP430FR6988, MSP430FR6989
MSP430FR58891, MSP430FR59891, MSP430FR68891, MSP430FR69891
Version 6.10.2
EW24670: Value-preserving casts from constants are treated as constant expressions, like they were prior to versions 6.10.1.
EW24610: Pointer increments or decrements can, in some rare cases, be optimized incorrectly if the same series of increments or decrements of a variable occurs in parallel flows of control.
Version 6.10.1
New features
MPU/IPE support
Applications using MSP430 devices featuring a Memory Protection Unit (MPU) or Intellectual Property Encapsulation (IPE) can now automatically take advantage of these features when using the IDE. See the IAR C/C++ Compiler Reference Guide for more information.Small code model
A Small code model has been added for devices built on the MSP430X core. The Small code model uses standard 16-bit instructions for call and return, which consumes less stack space. Functions must be placed in the first 64 Kbytes of memory. See the IAR C/C++ Compiler Reference Guide for more information.Heap in FRAM
For FRAM devices, the heap is now placed in FRAM rather than RAM.The IAR C/C++ Compiler Reference Guide has been updated.
Program corrections
EW24781: The register definitions for TB0IV 3-6 have been corrected in
msp430f5659.h
andio430f5669.h
.EW24590: Missing definitions for TB0IV have been added to the file
mps430f5419.h
.EW24485: A global or namespace object, with a constructor that assigns a function pointer one of the members, can trigger an internal error on the medium or high optimization level.
Version 5.60.5
New features
Extended TI Math Library support
TI MathLib now also supports the MSP430F4xx device family.
Program corrections
EW24340: The compiler generates an Internal Error when a binary integer constant is used in an inline assembler instruction.
Version 5.60.1 - 2013-09-16
New features
TI Math Library for MSP430
The TI Math Library for MSP430 is now integrated into IAR Embedded Workbench for MSP430. This optimized library can bring you increased performance in any applications that use floating point scalar math. Prebuild libraries for MSP430F5xx, MSP430F6xx, and MSP430FRxx devices are provided in the product installation. The following functions are provided:- Trigonometric:
sin, cos, tan
- Inverse trigonometric:
asin, acos, atan, atan2
- Exponential:
exp, log
- Misc:
sqrt, reciprocal, fmod
In the IDE, The TI Math Library for MSP430 is enabled by selecting Project>Options>General Options>Library Configuration>Use MathLib.
On the command line, extend the XLINK command line with the option
-f mathlib.xcl
and add the apropriate Math Library from the dirctory430\lib\MathLib
. The filemathlib.xcl
can be found in the directory430\config
.You find more information about the TI Math Library for MSP430 on the TI website. This relase includes version 1.0.2.0 of MathLib.
- Trigonometric:
Prebuilt libraries with multithread support
Prebuilt libraries with multithread support are now provided in the product installation.
Read more about Managing a multithreaded environment in the IAR C/C++ Compiler Reference Guide and in the User guide corrections.
Program corrections
EW24121: In some very rare cases, two compilations of the same file might not produce identical results.
EW24070: An array-delete of a structure that has no default destructor uses the wrong library function call in the IAR C++ runtime environment.
EW24068: Defining the same anonymous union/struct twice can result in an internal error.
EW23935: The definition of
PM_UCB0SOMI
is now correct inmsp430f5172.h
.EW23768: Accesses to and from members in structs packed using
#pragma pack
might be handled incorrectly if the source and the destination are in different memory types.
Version 5.52.1 - 2013-05-13
New features
Improved optimizations
The compiler now generates 33% faster code on the EEMBC CoreMark benchmark compared to the previous version.
Program corections
EW23901: A corrupt license cache file could lead to a Divide by zero error during license check. This is now avoided.
EW23813: In some header files,
PM_UCB0SOMO
has been corrected toPM_UCB0SOMI
.EW23762: In some cases, copying to or from a packed struct triggers an internal error.
EW23676: The calculation of leap-days was incorrect in the time system in the library. This has been fixed.
Version 5.51.5 - 2013-01-17
New features
The compiler now inserts a
NOP
instruction between two instructions which might enable and disable interrupts, respectively, as required by the architecture on devices based on the MSP430X core.
Version 5.51.2 - 2012-11-12
New features
The compiler now adds a
NOP
instruction between aEINT
and aDINT
instruction as required by the architecture on devices based on the CPUxv2 core.
Program corrections
EW23588: The
CSTACK
segment is now always placed indata16
memory (below 0xFFFF) also on devices with a RAM area above 0xFFFF.
Version 5.51.1 - 2012-10-18
New features
The
printf
andscanf
formatters that remove the multibyte support in the DLIB runtime library, can now be set on the Library Options tab in the Project options dialog.
Program corrections
EW23424: In some cases
while
loops where the loop condition consisted of multiple single bit tests in an&&
expression could be optimized incorrectly.
Version 5.50.1 - 2012-06-29
New features
New complier option
--no_size_constraints
. This new option optimizes for speed, but relaxes the normal restrictions for code size expansion. This option is only available at the level High, speed. See User Guide Corrections for more information.
Program corrections
EW23270: The definitions of the symbols
VLCD_13, VLCD_14, VLCD_3_32
, andVLCD_3_38
have been corrected in the filesmsp430f477.h, msp430fg477.h, msp430f478.h, msp430fg478.h, msp430f479.h
, andmsp430fg479.h
.EW23269: Incorrect definitions of drive strength control for the port pins in output mode have been removed from the files
msp430fr5739.h
andio430fr5739.h
.EW23172: Indirect
long long
comparisons no longer trigger an internal error in the compiler.EW23120: An assembler statement following immediately after a constructor call, a destructor call, or an intrinsic library function that returns the first parameter, no longer triggers an internal error.
EW23117:Added Calibration Data defines in the header file
io430x26x.h
.EW23116: The compiler generated incorrect CFI directives for
__interrupt
functions when the option--core=430X
was used. Therefore the Call stack window did not work correctly when execution stopped inside an__interrupt function
. This has beem corrected.EW23034: When one of the values in an initializer for an aggregate caused a template function to be instantiated, the compiler no longer exits with an internal error.
EW22967: Incorrect code could be generated when the internal library function
?OneBitMask32
was used, because the peephole optimizer did not have correct information about which registers were modified by the library function. This has been corrected.EW22959: MISRA-C:2004 rule 4.1 no longer checks whether a character that is used in a string literal or character constant is part of the C standard character set.
EW23035: A definition of
MPULOCK
has been added to the filesio430fr5739.h
andmsp430fr5739.h
.
Servicepack 5.40.2
EW22891: When using multi-file compilation, the following error could no longer be triggered:
Internal Error: [TCgInterface::GetCallingConvention]: Unknown calling conventionEW22879: When using inline assembler and multi-file compilation would sometimes cause the compiler to abort.
Version 5.40.1 - 2011-11-24
New features
Position-independent code and read-only data
Support has been added for position-independent code and read-only data (ROPI). For more information, see the IAR C/C++ Compiler Reference Guide.Thread-safe libraries
The DLIB library now has improved support for threaded environments.The IAR C/C++ Compiler Reference Guide has been updated.
Program corrections
EW22700: Structure members temporarily placed in registers could in some cases be written back to memory too late.
EW22684: The MISRA-C:2004 rule 13.5 will no longer check the expressions governing a for-loop.
EW22734: The definition of
RTCTIM0_L
and similar symbols are now provided in the fileiocc430x513x.h
.EW22566: The compiler no longer warns for a missing vector from an interrupt declaration when it was correctly given for an earlier declaration.
EW22524: The definitions of the registers
UCB0CTL0
andUCB0CTL1
are now correct in the fileio430f5172.h
.EW22513: The definition of
CRCDI_L
and similar symbols are now provided in the fileio430fr5739.h
.EW21027, EW21028, EW21029: It is now possible to build a DLIB library for multi-threading.
Servicepack 5.30.3 2011-09-05
EW22630: Incorrect defines have been removed in a number of
io430fxxxx.h
files.EW22567, EW22625: A code generation problem that would sometimes cause an internal error "Optimization goal not set" has been fixed.
EW22603: Incorrect defines in the file
io430f5510.h
have been removed.EW22564: Incorrect defines in the file
io430f5437.h
have been removed.EW22556: Incorrect defines in the file
io430fr5739.h
have been corrected.
Version 5.30.1 2011-06-30
New features
Automatic selection of printf/scanf formatter
The compiler/linker will parse theprintf/scanf
format specifiers and automatically select the smallest possible formatter from the library.PIC for MSP430X
Support for position independent code also for MSP430X devices.New optimizations
Two new optimization possibilities has been added; Aggressive Inlining and Aggressive Unrolling. See User guide corrections for more information.time.h
has an optional 64-bit interface that supports years from -9999 up to 9999.New extended keyword
__no_pic
It is now possible for position independent functions (compiled with--pic
) to call functions that are not position independent. See User guide corrections for more information.Override segment base name
It is now possible to Override the base name for memory segments. Use the option Override segment base name on the options page Project>Options>C/C++ compiler>Output.
Program corrections
EW22483: The result of a cast from a signed character used in a complex expression that accesses a table in memory, no longer generates code that, under special circumstances, access the wrong location.
EW22460: A reference to a misaligned object in an initializer is no longer improperly accessed as an aligned object.
EW22422: In special circumstance, an
AND.W #1, Rx
instruction is no longer incorrectly optimized away.EW22361: The file
intrinsics.h
is now included in the flesio430xxxx.h
and the use of the intrinsic functions_BIC_SR_IRQ
and_BIS_SR
has been changed to__bic_SR_register_on_exit
and__bis_SR_register
, respectively.EW22336: The file
intrinsics.h
now have a declaration of the return typeistate_t
.EW22331: The unrolling of a one-trip loop with multiple tests and empty loop body now work even if the second test is used to determine that only one iteration of the loop is executed.
EW22315:
While
loops where the final statement in the loop body is a conditional assignment and the assignment ensures that the loop condition would be true no longer issues an internal error.EW22298: Using a static anonymous union placed at an absolute address no longer issues an internal error in the compiler.
EW22281: A missing bit has been added between
CLR
andMCx
in the registerTA1CTL
in the fileio430430x21x2.h
.EW22218: The compiler option
--guard_calls
referred in the documentdoc/infocenter/DLIBThreadSupport.html
is now implemented.EW22208: In some rare cases, if the register allocator has aliased a value with the lower part of another value, a cast from the value no longer results in clearing the upper part of the larger value.
EW22190: Now the compiler can produce an error for a nonstandard implicit cast of a function to a pointer-to-member.
Servicepack 5.20.2 2011-01-18
Program corrections
EW22170: Interrupt vector offsets have been corrected in the file
msp430f47183.ddf
.EW22169: Definitions for DMA have been added in the file
io430f47163.h
.EW22167: Now the MISRA-C:2004 rule 20.2 checker can handle a long preprocessor symbol define.
EW22149: Duplicated defines have been removed from the file
io430x471x6.h
.EW22141: USCI_A1 and USCI_B1 have been added in the file
io430x471x6.h
.Corrections have been made to a number of other device specific header files.
Version 5.20.1 2010-12-01
New features
Thread-safe libraries
The DLIB library now supports being used in a threaded environment. Some library systems, like the heap and the file structure, will be guarded by locks. Other library systems, likelocale
anderrno
, will have their static data allocated in thread-local storage. The DLIB thread support can either be supported by your chosen RTOS or can be manually implemented. For more information, see DLIB multi-threaded support.The compiler and assembler now automatically know where the library's system headers reside. You can control the compiler using the options:
--dlib_config
, to choose a configuration in the DLIB library.--system_include_dir
, to override the directory to use as system header base.--no_system_include
, to turn the automation off.
Program corrections
EW22090: UCB0I2COA and UCB0I2CSA have been changed to
short
in the fileio430x54x.h
.EW22066: FLL_CTL2 has been added in the files
io430x471x6.h
andio430x471x6.h
.EW22041: Static initialization of a reference variable to an explicit address no longer causes an internal error in the compiler. Example:
int & x = *(int *)0x1000;
EW22027: On MSP430X, a function declared with both
__intrinsic
and__ramfunc
, is now placed in RAM memory.EW21884: P3REN and P4REN have been added in the file
io430fx23x0.h
.EW21881: The addresses for SD16IV, SD16MEM0, SD16MEM1 and SD16MEM2 have been corrected in the header files
io430f47183.h, io430f47193.h, msp430f47183.h
andmsp430f46193.h
. The registers SD16MEM3-SD16MEM6 have been added.EW21834: The compiler no longer causes an internal error for pointer expressions involving subtrating the result of a value modulo two.
EW21789: The MISRA-C:2004 rule 13.5 loop-control checking now allows for more variants of data-accessing.
EW21716: The XCAP values have been corrected in the file
io430f4784.h
.
5.10.6 Servicepack 2010-09-15
New featuresA workaround for the hardware bug CPU40 on MSP430F5xx and MSP430F6xx devices has been implemented. When the IAR Embedded Workbench IDE is used, the workaround will be adapted automatically for all devices where it is required. On the command line the following option must me used to enable the workaround:
--hw_workaround=CPU40
EW21976: The definition of ADC12MCTL is now correct in all header files for the MSP430F54xx and MSP430F55xx devices.
EW21964: When using the
switch(__even_in_range(x, N))
construct, and the switch table contains odd values, the generated code could in some cases be incorrect.EW21935: Using the address of a field in an anonymous struct/union in a static initializer could result in an internal error in the compiler.
EW21883: A problem in the I/O header files for the MSP430F54xx/ MSP430F55xx devices has been corrected.
EW21879: The MISRA-C:2004 12.7 rule checker now uses the underlying type when checking for errors.
5.10.4 Servicepack 2010-06-09
Program correctionsEW21804: Now
sprintf, snprintf
, etc returns the number of written characters also when using_PrintfTiny
.EW21793: The
printf
formatter_PrintfTiny
now follows the same calling convention as the other_Printfxxx
variants.EW21784: An internal error no longer occurs for conditions where the test is a ? :-expression on the form:
if ((condition1 && condition2) ? 1 : 0)
EW21740: An internal error should no longer occur if
__segment_begin()
or__segment_end()
is used in conditional code.EW21736: Using the option
--mfc
(multi-file compilation) with modules using public file-scope anonymous structs/unions (an IAR extension) no longer results in an internal error in the compiler.EW21734: A variable that has been defined with the attribute
__ro_placement
is no longer treated as a constant when the code is optimized.EW21713: On some 430X devices, in the medium and large data models, 20-bit variables placed in the memory range 0x8000-0xFFFF could not be accessed correctly. The devices that were affected were new devices where the hardware bug "CPU16" was corrected, whereas the code worked correctly on older devices. The code that currently is generated runs correctly on all devices.
EW21671: When
#pragma pack
was used, some expressions involving data placed in different memories, could cause the compiler to issue an internal error. This has been corrected.
5.10.1 2010-04-12
New featuresC99 compliance
Compliance with the ISO C99 standard.__persistent
Global or static variables defined with the new attribute__persistent
will not be initialized by cstartup, but only by a code downloader or similar add-on functionality.__ro_placement
You can use the new attribute__ro_placement
in combination with the type qualifiersconst
andvolatile
to inform the compiler that a variable should be placed in read-only (code) memory. In earlier versions of the compiler this had to be done by not usingvolatile
and hiding the constant values from the compiler by plaing them in a separate source file. This is no longer needed. See the IAR C/C++ Compiler Reference Guide for MSP430 for more information.The IAR C/C++ Compiler Reference Guide has been updated.
EW21683: The RAM size for the device MSP430F477 has been corrected to 2 KByte in the linker command file.
EW21614: When compiling in multi-file compilation mode (
--mfc
), end-of-module diagnostic message (for instance, "variable was declared but never referenced") no longer cause an internal error.EW21542: The addresses of
UCB012COA
andUCB012CSA
in the fileio430x47x4.h
have been corrected.EW21418: The define
TAG_ADC12_1
has been changed from 0x10 to 0x08 in the header files.EW21319: A missing definition of
PxSEL2
has been added in the fileio430x21x2.h
.EW21308: The compiler could, in some cases, typically involving placement or
nothrow new
, emit a reference to a runtime library constant of the form__XXX_array_new_prefix_size
with an incorrect type, which could result in a type conflict warning or a range error when linking. This has been corrected.EW21299:
DMA1TSEL_7
andDMA1TSEL_8
have been corrected in the filemsp430x552x.h
.EW21282: A load from an object with known contents will no longer be replaced with the contents if the address expression has been cast to a pointer to volatile.
4.21.9 (patch release)
EW21513: In some rare cases irregular loops could be optimized incorrectly and the code in the loop could use uninitialized variables. This has been corrected.
EW21544: An assembler-level peephole rule that eliminated the use of a temporary register, was in rare cases applied even when it should not. This has been corrected.
4.21.6 (patch release)
EW21423: Multiplying a 32-bit value with a 16-bit value now works when the hardware multiplier is used with the option Allow direct access, and the 32-bit value is accessed via a pointer or a C++ reference.
4.21.2 2009-09-01
Program correctionsEW21269: On the 430X core, when the medium and large memory models was used, the intrinsic function
__delay_cycles
could clear the upper four bits of a processor register.EW21205: The code sequences for inline multiplication disabled interrupt too late to be fully interrupt safe. (This only affected applications where the hardware multiplier was used both in normal code and in interrupt service routines.)
EW21094, EW20687: The MISRA C:2004 rule number 10 is no longer triggered by Doxygen Documentation tags, for example:
/* * @} */
EW21062: In the large memory model on the MSP430X core, when using global dynamic initializers in C++, calling a function with a class parameter, and passing a temporary object, the function could, in some cases, be called with the wrong calling convention.
EW21003: A warning is issued then the function
__low_level_init
is defined unless the header fileintrinsics.h
has been included. When defining the function__low_level_init
in C++, an error is issued if it is not defined or declared using 'extern "C++"', as inintrinsics.h
.EW20999: JTAG Port Direction Birs has been corrected in the file
io430x54x.h
.EW20984: The compiler incorrectly accepted both the
--misrac1998
and--misrac2004
command line options at the same time.EW20982: The header file
msp430.h
no longer triggers any warning messages from the MISRA C checker.EW20981: The SFR
UCSCTL7
number of bits corrected to 16 in the header fileio430x54x.h
.EW20934: When using
#pragma pack
and copying data between objects in two different memories, or an object placed on the stack and one not, the internal error "[CoreUtil/General]: integral add" could be triggered. This has now been corrected.EW20932:
ADC12EOS, RTCNT12, RTCNT34
, andPMM
upper and lower bytes definitions have been added in the fileio430x54x.h
.EW20913: When using
#pragma pack
the internal error "[CoreUtil/General]: Unexpected basic type to size" could be triggered. This has now been corrected.EW20893: When using an auto array containing certain floating-point values, the compiler could appear to hang.
EW20839: When building the cstartup file, these symbols can be set to customize it:
IGNORE_SEG_INIT
-- To remove segment initialization
IGNORE_DATA16_DATA
-- To remove segment initialization ofDATA16
data
IGNORE_DATA20_DATA
-- To remove segment initialization ofDATA20
data
IGNORE_RAMFUNC_INIT
-- To remove segment initialization oframfunc
code
DISABLE_WATCHDOG
-- To disable the watchdog
Note: When using this feature to disable the watchdog, the preprocessor symbol representing the device used must also be defined.EW20816: In the file
io430G46x.h
file, enums are added forUSART1
modules.EW20806: When using C++ and device header files (or any located variable), multifile compilation did not work correctly.
EW20805: When using the 32-bit hardware multiplier, "long long" multiplication did not work correctly.
EW20793: A definition of
EOS
forADC12
has been added in the fileio430x54x.h
.
__ramfunc
The new extended keyword__ramfunc
makes a function execute in RAM. The code will be copied from flash memory into RAM by the startup code.When building the cstartup file, these symbols can be set to customize it:
IGNORE_SEG_INIT
-- To remove segment initialization
IGNORE_DATA16_DATA
-- To remove segment initialization ofDATA16
data
IGNORE_DATA20_DATA
-- To remove segment initialization ofDATA20
data
IGNORE_RAMFUNC_INIT
-- To remove segment initialization oframfunc
code
DISABLE_WATCHDOG
-- To disable the watchdog
Note: When using this feature to disable the watchdog, the preprocessor symbol representing the device used must also be defined.
v 4.20.1 2008-12-08
Program corrections- EW20647:
Some definitions for the
USCI
registers are missing in the filesmsp430x54x.h
andio430x54x.h
. - EW20634:
In the file
msp430x54x.h
some of theFLLUNLOCKxxxx
defines had wrong bits, this is now corrected. - EW20471:
Duplicate definition of
TAIV_TAIFG
has been removed from the fileio430x24x.h
. - EW20435:
UCB1I2COA
andUCB1I2CSA
have been changed fromchar
toshort
in the fileio430x24x.h
. - EW20365:
The address for
ME2
has been corrected. - EW20348:
Some register addresses have been corrected in the file
io430x26x.h
. - EW20313:
The compiler could crash when applying
#pragma pack
to a struct containing bitfields. - EW20312:
A problem that could cause an internal error in the compiler when
the C++ construct
reinterpret_cast
was used in a template has been corrected. - EW20262:
Some
DMA?TSEL
defines have been added in the fileio430x16x.h
. - EW20254:
The register
FWKEY
has been added to the fileio430x54x.h
. - EW20239: Incorrect code could sometimes be generated when accessing parts of volatile objects. Instead of accessing all bits in the object part, the code would only access a single bit. Typically, this would occur when using volatile in combination with bitfields.
- MISRA C:2004 support
IAR Embedded Workbench now supports automatic checking of source code for conformance to the MISRA C:2004 standard. - Multiple inheritance
Support for multiple inheritance has been added to the MSP430 compiler. - Improved hardware multiplier support
The compiler will generate code that accesses the hardware multiplier directly, when appropriate based on the optimization settings. Otherwise library calls will be made. It is also possible to always use library calls.
v 4.11E - patch release
- EW20300: A problem could occur for switch that used the intrinsic
fuction
__even_in_range
. If more than one switch was placed in the same compilation unit (source file) the compiler could incorrectly extract the "add to pc" instruction to a subroutine.
v 4.11C - patch release
- EW20226: The compiler could crash when
#pragma pack
was applied to a structure that contained a pointer. - EW20239: Incorrect code could sometimes be generated when accessing parts of volatile objects. Instead of accessing all bits in the object part, the code would only access a single bit. Typically, this would occur when using volatile in combination with bitfields.
- EW20240: A source file with a loop with a trivial body could, in rare conditions, trigger an "illegal state" internal error.
v 4.11B - 2008-07-10
Program corrections- EW20093:
The definition of port 7-10 in the file
io430xG46x.h
has been corrected. - EW20065:
When the option
--migration_preprocessor_extensions
was used, Misra C rule 97 was not checked. - EW20064: The symbols
EEI
andEEIEX
are now defined in the filesio430x47x3.h
andio430x47x4.h
. - EW20061: In some rare cases, post increment and decrement on pointers could be optimized incorrectly when the high optimization level was used. This has been corrected.
- EW20017:
The intrinsic function
__delay_cycles
, when used on the MSP430X core, triggered an internal error for certain input values. - EW19930: When the compiler recognized code that would swap the two bytes of a 16-bit value, and the value was placed on the stack frame, the compiler triggered the internal error "illegal state."
- EW19929:
An internal error is no longer generated if the intrinsic function
__data20_read_short()
is used together with the traditional MSP430 core. This intrinsic function is only useful together with a MSP430X core. - EW19888: In rare cases, the assembler-level optimizer could, when optimizing an instruction right before a switch statement, trigger the internal error "unexpected exception"
- EW19863:
The missing register
SWCTL
has been added to the fileio430xG42x0.h
. - EW19847: In some cases, the assembler-level peephole optimizer could incorrectly rewrite code when mixing byte and word accesses to the same location in memory.
- EW19789:
The registers
DMA0SZ
andDMA1SZ
are now defined in the fileio430x26x.h
. - EW19757:
In the linker command file
lnk430X.xcl
,HEAP
has been corrected toDATA16_HEAP
andDATA20_HEAP
. - EW19703:
Missing bits for port 7 and port 8 in the file
io430x26x.h
have been added. - EW19692: An internal error that could occur at some occasions when high speed optimization was used, has been corrected.
- EW19663: The compiler no longer causes an internal error when using a composite type that had already been diagnosed with an error.
- EW19646: The compiler no longer generates a faulty assembler instruction that refers to two symbols that were identical apart from uppercase and lowercase.
- EW19557:
The definitions of
SIFCTL4
andSIFDIV3
in the filemsp430xW42x.h
have been corrected. - EW18877: Some of the files
io430xxx.h
had a problem related to duplicate symbol definitions. This has been corrected. - EW18323: A compiler generated instruction that should refer to two symbols that are different by case only could be incorrectly generated referring to only one of them twice. This has been corrected.
- New compiler option
--segment
The command-line option--segment
can be used to rename segments or the base name of segment groups for memory types. The syntax is:--segment what=NEWNAME
Change the segment name. The parameter
what
can be one of the following:cstack
-- The run-time stackcode
-- Normal codeisr_code
-- Interrupt codeintvec
-- The interrupt vector tabledifunct
-- C++ dynamic initialization__data16
-- Base name for __data16 memory__data20
-- Base name for __data20 memory__regvar
-- Base name for __regvar variables
When using the
--segment
option from inside IDE Embedded Workbench, the Extra Options tab must be used. - Improved Hardware Multiplier support
Previously, hardware multiplier support was provided by letting the linker redirect calls to multiplication subroutines.The compiler can now generate code that uses the hardware multiplier directly. The following command-line options are provided:
--multiplier
or--multiplier=kind
. The parameterkind
can be one of the following:16
-- Traditional hardware multiplier.16s
-- The extended hardware multiplier used by some 2xx devices.32
-- 32-bit hardware multiplier.
--multiplier_location=HexAddress
. Thjis option specifies the location of the multiplier. For example, some 5xx devices need to use the option--multiplier_location=4C0
.
- Zero initialization of local array variables
A local array that originally was set to zero is initialized in a much more efficient manner, both in terms of speed and in terms of amount of read-only memory used.
V4.10D patch release
- EW19847: In some cases, the assembler-level peephole optimizer could incorrectly rewrite code when mixing byte and word accesses to the same location in memory.
- EW19777: Defining or using variables from different namespaces with the same name in one module could make the compiler crash or result in references to the wrong variable.
- EW19768: The common sub-expression elimination optimization could increase the code size if the code contained a lot of conditional expressions (e.g. questionmark-colon).
- EW19758: Access to a packed structure via a
data20
pointer could truncate the pointer. This problem only occurred in the medium data model for the MSP430X core.
V4.10B patch release
- EW19705, EW19693: Casts involving 20 bit types could, in rare cases, generate the following message: "Internal Error: ( CoreUtil/General): Wrong arity(1)". This has been corrected.
4.10A 2007-09-27
Program corrections- EW19557: The definitions of SIFCTL4 and SIFDIV3 in the file
msp430xW42x.h
have been corrected. - EW19465: Some
io430xxxx.h
files had incorrect definitions of port 1 and 2. - EW19433: In some cases, when placed inside an infinite loop,
the intrinsic function
__delay_cycles
could be optimized away. - EW19287: A problem related to Kanji letters in source file paths has been corrected.
- EW19238, EW18736: A problem has been corrected that could cause
the internal error, "illegal operand for low", to be triggered when
using the intrinsic function
__get_SR_register
,. - EW19218: The size of the RAM area for the device MSP430F2370 has been corrected to 2 Kbytes
- EW19182: Instantiating a template where the type of a non-type
template parameter depended on the type of a type template parameter
could cause an internal error in the compiler. For example:
template
struct X { T fun() { return x; } }; X sX; - EW19109: The reported problem has been corrected.
- EW19070: The devices msp430f1610, msp430f1611, and msp430f1612
have been added to the file
io430.h
. - EW18699: Nested loops with constant trip counts could be incorrectly optimized. Nested loops should now execute the correct number of iterations. .
- EW18677: The reported problem has been corrected.
- New data models for MSP430X
The concept of data models has been introduced for the MSP430X architecture. A medium and a large data model have been added to make it possible to access data above memory address 0xFFFF without using intrinsic functions. The small data model corresponds to the behavior in the 3.x compiler. For more information see the compiler reference guide. - Libraries built with previous versions of the compiler must be rebuilt to work with code generated with this version of the compiler.
- Changed calling convention
The calling convention has been improved. This affects applications written in assembler that are calling C functions. The old calling convention can still be used for assembler functions by specifying the keyword__cc_version1
. - A new option for control of the optimization level ,
-O
has been introduced. For more information see the compiler reference guide.
3.42A 2006-12-07
Program corrections- EW18609: An optimization can lift a global variable to a register in a code region. In some rare cases the register was not written back to the variable on all paths from the region. This problem has been corrected.
- EW18606: When using
MSP430X, monitor functions with stack parameters did not work. This has been
corrected.
- EW18594:
When a subroutine was extracted that included a
PUSH
, as well as code that referred to the new stack cell, the addressing mode offsets in the instructions became incorrect. This has been corrected.
- EW18368:
An internal error could be generated at very rare occasions when the operators
__segment_begin
and__segment_end
were used.
- EW18311:
The assembler-level peephole optimizer could lift
MOV
instructions, with the status register as destination, over conditional branches, overwriting the status bit that was tested. This has been corrected. - EW18197: The code that
would handle system termination could end up before the code for system
initialization. This has been corrected as it could confuse some debuggers.
- EW18136:
The runtime libraries responsible for multiplying two 16 bit numbers
into one 32 bit number internally used the
BR
instructions. If the destination address was placed too far from the branch instruction, the application failed to link. - EW17970:
The bit name
USIFGDC
(in theUSI
module) has now been corrected toUSIFGCC
inmsp430x2xxx.h
andio430x2xxx.h
.
- New generic header files
Two new generic header files,io430.h
andmsp430.h
has been added. These two files can be used when building from within the IDE and the correct device specific header file will automatically be included. A preprocessor define (the-D
option) will be used to identify the device.
3.41E 2006-06-08 (patch release)
- EW18131: In some rare conditions, the
AND.B
andAND.W
instructions could be removed even though they were needed.
3.41C 2006-05-12 (patch release)
- EW18040: In some cases, the compiler would handle register
R15 incorrectly when the internal library functions
?Mul16to32s
and?Mul16to32u
were used. - EW18017: When the MSP430X core was used, function pointer calls (when the actual destination address is a known integer value) could cause the compiler trigger an internal error.
3.41A 2006-04-13
Program corrections- EW17958: In rare cases, instructions that performed zero-extension,
AND.B #0xFF, Rn
, could be removed by the peephole optimizer. (This could occur if the register later was used in an indirect or post-inc addressing mode in byte instructions.) - EW17928: The compiler can transform simple if-else-statements into straight code that computes the result rather than using traditional test-and-branch code. This transform is no longer performed on low optimization levels since it makes the code harder to debug.
- EW17892: Memory accesses through
__segment_begin()
or__segment_end()
could incorrectly be removed as dead code. - EW17887: In some cases high speed optimization could cause a loop
to execute one extra iteration, if:
- the loop had a constant trip count,
- the loop was expressed as a while (true) loop, and
- the loop exit was handled by a condition and a break statement in the middle of the loop body with non-dead code both before and after the break.
- EW17860: Code that swapped two bytes could, in rare conditions, cause
an internal error. This has been corrected.
- EW17849: An error message will now be given if you try to place a
located variable above address
0xffff
. - EW17818: The compiler could arbitrarily generate an internal error on
medium or higher optimization levels.
- EW17751: A constructor with a statically initialized local variable no
longer generates an internal error.
- A new intrinsic function
__delay_cycles
provides cycle accurate code size minimized delay functionality. - A new pre-processor symbol
__POSITION_INDEPENDENT_CODE__
has been added.
3.40C 2006-01-30 (Patch release)
- EW17729: An internal error could be generated on high optimization levels when the optimization resulted in dead code.
3.40B 2006-01-27 (Patch release)
- EW17725: In some rare cases the optimizer incorrectly transformed
a for or a while loop to a do loop if:
- the loop test compared the loop counter to variable (V) that was invariant in the loop, and
- the loop was preceded by an if-else-if-statement where the else-if-test tested V against a constant value.
- EW17720: The binary search with compare switch algorithm did not work properly.
- EW17649: The compiler could hang when there were volatile read/write operations inside a loop.
- EW17638: An internal error was generated when the
#pragma bis_nmi_ie1
directive was used.
3.40A 2005-12-19
Program corrections- EW17522: A word access on
R4/R5
by the__set_R4/R5_register
instrinsic function could earlier incorrectly be changed to a byte access if used with inline assembly. - EW17287: Accesses to
struct
orunion
members declaredvolatile
could earlier incorrectly be removed as dead code if:
- the member was declared
volatile
but thestruct
orunion
was not and - the member offset in the
struct
orunion
was 0.
- the member was declared
- EW17250: The
VLDx
bit definitions for theSVSCTL
register is no longer missing in the header filemsp430f16x.h
and in the filemsp430f167.sfr
. - EW17246: On high optimization levels, the compiler could sometimes consume unnecessary large amounts of time and memory.
- EW17205: In the default link files, the RAM end addresses were one byte too large. This has now been corrected.
- EW17126: In some rare cases, assignments could incorrectly be hoisted
out of the loop if the loop body contained a test of a variable (
V
) andV
was assigned a constant value later in the loop body. - EW17124: An Internal Error could occur when high optimization was used.
- EW17001: The register renaming optimization could sometimes rename
too many occurences of a register. For example, if the optimization
tried to rewrite the two instructions
MOV R12, R14
andMOV.B @R14, R14
into the single instructionMOV.B @R12, R14
the result instead becameMOV.B @R12, R12
. (This instruction, of course, will be subject to other optimizations, for example dead code elimination.) - EW17000: An internal error could occur if identical infinite loops were found and they were extracted into a subroutine.
- EW16921: A problem, where a global variable was placed in a register and not written down before the global was read again, has been fixed.
- EW16909: The linker warning "more than one definition for struct/union type" was earlier incorrectly displayed when an I/O definition header file was included and more than one SFR was referenced from C++ source code.
- Support for the MSP430X architecture
IAR Embedded Workbench for MSP430 now supports the MSP430X architecture. The MSP430X architecture provides an extended memory range up to 1 Mbyte and an extended instruction set. Note that the support for the MSP430X architecture is in beta status until the first MSP430X devices are released to market. Select Generic MSP430X device in the Device list to generate code for the MSP430X architecture. -
You can now compile several source files in one compilation by specifying the command line option
--mfc
. The advantage of multi-file compilation is that it gives the interprocedural optimizations a larger set of functions to work on. If you also specify the command line option--discard_unused_publics
, the optimization will be further improved because the compiler will assume that there are no references to any symbol from the outside in the compilation, that is the compilation unit is the whole application apart from the library.
Note: Use the--mfc
option with caution, it is experimental in this version of the compiler. - The added predefined preprocessor symbols
__SUBVERSION__
and__BUILD_NUMBER__
, in the compiler and the assembler, denote the subversion, that is the 'C' in 4.21C, and the build number, respectively. The build number is a number that does not necessarily increase with a later released compiler or assembler, that is use it only in equality or inequality preprocessor expressions. -
It is now possible to declare variables in the initialization clause of a
for
statement, but only in extended language mode. This behavior is according to the C99 and the C++ standards. -
Some more C99 functionality has been added to the IAR DLIB Library:
Ctype.h
definesisblank
as an added function.Inttypes.h
has been added. Note that only the conversions are included, not the functions.Math.h
defines the following additions:
- Macros -
HUGE_VALF, HUGE_VALL, INFINITY, NAN, FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, MATH_ERRNO, MATH_ERREXCEPT, math_errhandling
. - Typedefs -
float_t, double_t
. - Macro functions -
fpclassify, signbit, isfinite, isinf, isnan, isnormal, isgreater, isless, islessequal, islessgreater, isunordered
.
- Macros -
Stdlib.h
definesllabs, lldiv, strtoll, strtoull, atoll, strtof
, andstrtold
as added functions.Wchar.h
definesvfwscanf, vswscanf, vwscanf, wcstof
, andwcstolb
as added functions.Wctype.h
definesiswblank
as an added function.
3.30B 2005-06-16
Program corrections- EW16547: An optimization that tries to hold a global variable in a register during several modifications of the global could in some cases cause incorrect code.
- EW16618: Corrected a problem where, if
-
1) the address of an auto struct (x) was passed as a argument to a function call,
2) a member (m) of x was used in the same expression (to calculate the function address or in another function argument), and
3) x.m was assigned immediately before the call - EW16621: In some rare cases, values were not written to memory before a function call.
- EW16809: Loop idiom recognition could cause an internal error.
- EW16879: At optimization level high incorrect code could be generated if a loop had an unsigned loop counter, the loop counter was decremented, and the loop contained a test (besides the loop exit test) where the loop counter was compared to zero.
- EW16888: If a loop with a variable upper limit was preceded by a
modification of the upper limit and a test of the upper limit being larger
than the lower limit of the loop, the optimizer could incorrectly assume that
the loop body should always be entered.
if (u > 0)
{
--u;
for (i = 0; i < u; ++i)
{
...
}
}
3.30A 2005-04-18
Program corrections- EW16162: Volatile accesses to non-byte objects could earlier, in some situations, be performed using byte accesses. In this release, volatile accesses to objects larger than a single byte are performed using 16 bit operations.
- EW16321: The write-back from the return value registers to a variable located on the stack was sometimes removed on the highest optimization.
- EW16346: In rare cases, inside special kinds of loops, inline assembler statements could be removed.
- EW16527: The error
Internal error: [CoreUtil/General]: Illegal operand for low
could occur, in some rare cases, when a value was accessed via a pointer and the result was used in a comparison. - EW16641: An internal error could occur when the optimization "loop unrolling" was used.
- A number of new optimizations has improved both code size and execution speed.
- The 64-bit floating point support has been dramatically improved regarding both size and speed especially when the HW multiplier is used.
- A new option
--reduce_stack_usage
has been added. This option will force the compiler to clean up the stack more frequently at the cost of a bit larger and slower code. - Support for compound literals has been added to the C language.
3.21A 2004-10-20
Program corrections- EW15428: If one of the ready made I/O definition files is used, and an additional include file is specified using an absolute path that includes a drive letter equal to one of the status register bits (C, N, V, or Z) defined in the I/O definition file, the compiler would replace the drive letter with the defined bit number and the file would not be found.
- EW15799: Structure assignments involving at least one auto variable and a struct member of a large struct could cause an internal error.
- EW15821: A problem has been fixed where, in rare cases, the assembler level optimizer incorrectly optimized memory accesses inside loops.
- EW15871: Multiplication of long long's did not work when the hardware multiplier was enabled.
- EW15942: The compiler produced different (but correct) output on different PCs.
- EW16054: The definition of
U0TXBUF
was incorrect inmsp430x16x.h
.
- The 32-bit floating point support is now even faster especially when the HW multiplier is used.
3.20A 2004-06-18
Program corrections- EW15085: The use of the
__ALIGNOF__
operator in a preprocessor construction in conjunction with the option--migration_preprocessor_extensions
caused the compiler to generate errors incorrectly. - EW15370: Remarks were incorrectly generated when compiling an empty file within the IAR Embedded Workbench.
- EW15461: A test on a
volatile
declared variable could in some cases fail on optimization level 4 or higher. - EW15481: Incorrect code could be generated for packed structures on optimization level 6 or higher.
- The option
--core
has been added to include support for 128-Kbyte devices. The support for 128-Kbyte memory also includes a new memory type attribute__word16
. - New more optimized 32-bit floating-point libraries. The compact math library version for IAR CLIB has been removed from the product as the new floating-point libraries are even more compact.
- Two new intrinsic functions have been added to set and get the value of the
stack pointer,
__set_SP_register()
and__get_SP_register()
. - A new pragma directive
bis_nmi_ie1
has been added. It will generate aBIS.W #xx,IE1
instruction right before theRETI
instruction at the end of the function, after any POP instructions. The effect is that NMI interrupts cannot occur until after the instruction in question and that less stack will be used in the case of nested interrupts. - A new intrinsic function
__even_in_range()
has been included to provide a way to generate optimal code for switch statements where you know that only even values within a given range are possible. This is useful, for example, in an interrupt service routine for the TAIV Interrupt Vector Generator. - The following C99 features can now be used in the C
language if language extensions (-e) are enabled:
- The
inline
keyword. It works as the C++ inline keyword (and the#pragma inline
declaration). - Mixing declarations and statements within the same scope.
- Having a declaration in the initialization expression of a for-loop.
- The
- A new object attribute,
__noreturn
, has been added. The attribute can be used on functions to inform the compiler that the function will not return. The compiler can then generate more efficient code. Example of functions that do not return areabort()
andexit()
. - The MSP430 IAR C/C++ Compiler Reference Guide has been updated.
3.10A 2004-03-05
Program corrections- EW14579: A function that was inlined was incorrectly removed by an optimization.
- EW14882: Equal comparison of floating point numbers was not working correctly when position-independent code was used.
- EW14993: An attempt to optimize two similar function calls failed on the highest size optimization level.
- New optimizations have been implemented to make the generated code even more compact.
- C++ support is now available also in the standard MSP430 IAR Embedded Workbench package.
- Extended EC++ adds the
following C++ features that are not part of the EC++ standard:
- Templates. The template design accommodates memory attributes in an efficient
way. They adhere to the C++ standard except for not supporting the export keyword.
- Standard Template Library. The collection classes can be placed in any suitable memory and they are optimized for a small memory footprint.
- Class memory, i.e. a class type has an associated memory attribute. This
enables the placement of a class in any suitable memory.
- Namespace support.
- C++ cast variants static_cast<>, const_cast<>, and reinterpret_cast<> are supported.
- Mutable is supported.
- Templates. The template design accommodates memory attributes in an efficient
way. They adhere to the C++ standard except for not supporting the export keyword.
- Some ISO C99 features have been added. They are available when language extensions are
enabled and apply to both CLIB and DLIB (library related functionality apply only when using
the DLIB library):
- Support for the bool data type, if the header file
stdbool.h
has been included. - _Pragma support. This operator works as the pragma directive and can be used in macro definitions.
- Variadic macro support. You can now write printf-style macros.
- Hexadecimal floating point constants support. This means the ability to
exactly specify a floating point constant. The functions strtod(), printf(),
and scanf() recognize the syntax.
- The macro definition __func__. If used in a function, it is defined to the name of the function.
- Designated initializers. Using these, you can initialize a specific element in a structure or a specific element in an array.
- Inline functions. The pragma directive
inline [= forced]
has been added as well. - Long long support in the library. For example the functions strtoll(), strtoull() have been added as well as support for them in printf() and scanf().
- Support for the bool data type, if the header file
- More optimized and configurable C/EC++ library
The C/EC++ libraries now come in two variants, normal and full. Each variant can be further customized to reach an optimal balance between functionality and size. To allow even more detailed tuning of the libraries, the library source and a template project is available to make it easy to build a customized C/EC++ library. - Extended keyword __regvar
It is now possible to permanently place a variable in a register. The new extended keyword__regvar
will place a variable in register R4 and/or R5. Note that the compiler options--reg_var_r4
and/or--reg_var_r5
must be used to reserve the registers. - Extended keyword __raw
The extended keyword__raw
has been added. It can be used to prevent a interrupt function from preserving the content of all used processor registers at the entrance and from restoring them at exit. Note that this is only useful for some very special applications.
2.21B-P1 2003-12-16
- EW14715: A loop that accesses a volatile variable could make the compiler hang on optimization level medium and high.
2.21B 2003-11-21
- EW14603: The compiler could hang and never return when a loop with accesses to volatile declared variables was compiled. This problem only occured on the optimization levels medium and high.
- EW14646: The right hand side of a compound assignment (+=, *=, etc.), or a simple assignment that could be transformed to a compound assignment, could in some rare cases be incorrectly eliminated as a common subexpression.
2.21A 2003-10-17
Program corrections- EW14180: The #pragma optimize directive was erroneously diagnosed as not applicable when defining a member function of a class.
- EW14311: A problem related to return from switch-statments has been corrected.
- EW14395: In some rare cases, complex pointer expressions that modifyies a pointer variable close to a use of the same variable could cause an internal error.
- EW14398: If loop optimization could hoist all C code out of a loop, the loop could be eliminated even though it still contained an asm statement. This has been corrected.
- EW14420: In some cases optimization of casts from a floating-point type to a signed integral type and then to an unsigned integral type was too aggressive. Casting the floating-point value directly to the unsigned type produced incorrect result for negative values.
- EW14469: The return sequence for interrupt functions was not handled correctly when position-independent code was used.
- EW14475: Interrupt service routines could earlier get unnecessary push/pop instructions even at the highest optimization when some intrinsic functions were used within the routine.
- EW14554: It was not possible to change the heap size by adding the heap.c file to the project.
- The library functions that performs signed and unsigned long division have been improved.
- A more efficient 32*32-> 64 bit multiplication has been implemented. It is
important that correct variable types are used. This can be acompliched in
the following way:
unsigned long long mul(unsigned long x, unsigned long y) { return ((unsigned long long)x) * y; }
- The compiler generates more efficient code for multiplications when one of the factors is a known constant.
- Additional new optimizations have been added.
2.20A-P030708 (patch release) 2003-07-08
- EW14137: Writing to an SFR could in some situations not be handled correctly by the compiler.
- EW14155: Arithmetic expessions could be transformed incorrectly if the result was masked with 0x01, for example (x + 1) & 0x01.
- EW14164: A test inside a loop with contant start and stop values could in previous versions be transformed to an unconditional jump if the test was made on the least significant bit of the loop counter.
2.20A 2003-05-23
Program corrections- A
NOP
instruction has been added after theDINT
instruction in the intrinsic funtion__disable_interrupt
. - EW13767: In some cases a pointer incrementation or decrementation could be performed as a postincrement or postdecrement in the previous statement, even if the statement had multiple accesses through that pointer and execution of the postincrement or postdecrement affected the other accesses. This has been corrected.
- EW13863: An alignment problem has been corrected for the type
jmp_buf
used by the functionssetjmp
andlongjmp
. - EW13943: A problem has been corrected where an internal error could be generated for complex expressions containing casts from the address of a variable to an int.
- Support for 64-bit floating point numbers (doubles).
- Support for the
long long
integer data type, for more information see User guide corrections. - Support for position-independent code.
- Intrinsic functions that can be used for adding two BCD coded numbers have been added. For more information see User guide corrections.
2.10A-3 2003-03-20
- EW13735: The supplied source for
cstartup
was not the right one.
2.10A 2003-02-28
Program corrections- EW13554: Shift with a known number of steps on a variable in memory did not work, in some cases. The problem occured for 32 bit objects that where placed in memory and shifted exactly 8 steps (for all shift variants). In addition, for unsigned right shift, if the step count was 24 to 30.
- Embedded C++ support
The new MSP430 IAR Compiler supports C and optionally Embedded C++ for the Texas Instuments MSP430 microprocessor family. The compiler is based on the latest IAR compiler technology and replaces previous versions of the MSP430 IAR C Compiler. A simple click in the options dialog box will give you access to a true object-oriented language that is well suited for embedded applications. Embedded C++ is a subset of C++, in which some of the more costly parts of the C++ language have been removed. Embedded C++ support is only included if you have purchased an Embedded Workbench EC++ product. - A number of new optimizations now makes the compiler generate even more compact code for either speed or size.
- A fully IEEE754-compliant floating point library is now included in the product.
- New compiler options and intrinsic funtions has been added to this version. See the MSP430 IAR C/EC++ Compiler Reference Guide for more information.
2.09B 2003-01-31 (beta version)
- CFE0013: The following code:
case 1: if (0) default: p += 3;
erroneously deleted the default label. Complex logical expressions where one or more conditions where known constants or redundant nested switch statements could cause different types of problems. - EW12430:
When the following expression was compiled:
while (FCTL3 & 0x01);
an 8-bit access was generated on a 16-bit register. - EW12893: The new intrinsic function _SWAP_BYTES was missing in the in430.h file.
- EW13388: The compiler did in some cases not distinguish between a volatile pointer and a pointer pointing to a volatile variable/value.
- EW13399: The stack pointer was not restored correctly in the cstartup.s43 file, causing two bytes to be wasted on the stack.
- EW13400: When subtracting a constant value from a long variable, the compiler could give wrong results on optimization level High.
- EW13401: The Embedded Workbench closed down unexpectedly during compilation of a file with a comment with many '*' characters that had lost it's first '/' character.
1.26B 2002-10-11
- EW12055: A
function-pointer expression that involved a comma expression generated
erroneous code or a crash of the compiler.
- EW12097: A for loop could in some cases be entered when the condition was false. This happened if the size optimization was medium or higher but has now been corrected.
- EW12141:
An internal error was generated in the function get_reg_ind_P20 on the following code:
long *lmmpa = (long *)0; (*lmmpa++) &= 3;
The problem occured when SP was used in indexed addressing mode. - EW12221: When a local
variable was declared inside a block within a function, it could occur that
the variable was placed on an odd address on the stack.
1.26A 2002-03-11
- None.
1.25A 2001-11-09
- New optimizations:
1) while(1) { } Old assembler code: New code: ?1: MOV #1h,Ry ?1: JMP ?1: CMP #0,Ry JNE ?1: 2) while(1) { statement; } Old assembler code: New code: ?1: MOV #1h,Ry ?1: statement ... CMP #0,Ry JMP ?1: JEQ ?2: statement ... JMP ?1: ?2: 3) More effective code, when writing as follows: i /= 2, i /= 4, i /= 8, i /= 16, i /= 32, i /= 64 and i /= 128. i /= 128 only if the speed optimization flag is set.
- Three new intrinsic functions: _BIS_SR_IRQ and _BIC_SR_IRQ, to change the SR register on the stack, within interrupt service routines (ISR). _BIS_NMI_IE1, to change the interrupt enable control bits 1 (IE1, address 0x0000), within a NMI service routine, the BIS.B instruction is placed before the RETI instruction.
- A new option -ua, to enable odd address check. It is not possible to read a word from an odd address.
- C00016
The code:
void func_pointer(void);
#define FUNC func_pointer
&FUNC-1,
caused an internal error. This has now been corrected. - C00017
Copying a structure to another, using pointers, corrupts one of the structure pointers. This has now been corrected. - C00018
Internal error when using the keyword asm:
asm ("BIC 010h,0(SP)").
No asm instruction available, the compiler now generates the error: "No asm-keyword available". - C00020
The optimizer corrupted local pointers at higher optimizations than -s6, when decrementing more than twice. This has now been corrected.
1.24A 2001-04-06
- Optimizations:
Old assembler code: New assembler code: MOV Rx,Ry MOV @Ry,Rx MOV @Rx,Rx
- The option -re (Generate source file embedded in object file) is now available from the IAR Embedded Workbench.
- A new option -upic, to receive position-independent code except function
pointers. With the option -ufp, function pointers will be position-independent.
To use both options, write -upicfp. Use the libraries cl430_pic.r43 or cl430m_pic.r43. Position-independent code will generate more code, particularly function pointers.
1.23A 2000-10-16
- Optimizations:
Old assembler code: New assembler code: MOV &1,Rx AND #XX,Rx MOV Rx,&1 BIC #~XX,&1
- Multiply with 3 and 5 is generated respectively as, 2*val+val and 2*val+2*val+val, no library call. Also when writing X *= 3, X *= 5 and X *= 9, more effective code without library calls will be generated.
1.22E 2000-06-26
- Updated with the latest compiler front end.
- C00014
A NOP instruction has been added after the DINT in the hardware multiply library functions. This has been done to ensure a non-interrupted load of the multiplier registers.
1.22A 1999-11-25
- C0013
Optimization level 3 now generates fully debuggable code. - C0012
Earlier versions incorrectly accepted absolute bit syntax. Such syntax is not supported by the ICC430 compiler and now generates an appropriate error message.
1.20A 1999-02-19
- C0008
Calling a function via a function pointer on the stack used an incorrect stack offset. This type of call was done inside printf. This has been corrected. - C0009 Static register variables were always saved on function exit even if they had not been modified. This has been corrected.
- C0011
Problem that could cause Internal Error "scan-if - X06 : null pointer" is now corrected. - Support for MSP430 11X series microcontrollers is included with the sfr include file io11x.h.
- The bit definitions for the TCCTL register in the other io.h files are removed since same bit names are located in different positions in other registers.
1.11A 1997-09-11
- Support for MSP430 330 series hardware multiplier has
been added in the new library 'cl430m.r43'. All devices can use the standard
library 'cl430.r43', multiplications are then emulated.
The 'cl430m.r43' library protects the hardware multiplier from maskable interrupts. This implies a longer interrupt latency during multiplications.
Avoid multiplications and indexing arrays of non-scalar elements when writing non-maskable interrupts in C if the 'cl430m.r43' library is linked. - C0005
The condition test 'if (uint - 42 == 0)' was performed with 'CMP.B'. This has been corrected to 'CMP'. - C0006
Writeback of static char variables at a function epilogue was performed with 'MOV'. This has been corrected to 'MOV.B'. - C0007
Illegal optimization for assignments of type 'uint = uchar;' has now been removed.
1.10C 1997-02-28
- Incorrect offsets were used when passing auto variables as arguments to functions:
PUSH @SP was used to transfer stack top, should be PUSH 2(SP)This problem did not show when (1) passing the two leftmost arguments, since they go in registers and (2) when the passed value is a register variable. [Report D970218A]
1.10B 1997-01-15
- Register parameters were not saved to stack when compiling with option -rr (no register variables). This has been corrected.[Report D961210A]
- Incorrect data definition directives were used in the assembler list file. This has been corrected.
- Post-increment addressing mode is now better utilized.
- XLINK now supports the MSP430_TXT format, which is
used in Texas Instruments' Starter Kit/Evaluation Kit. To generate this format
use XLINK option:
-Fmsp430_txt
-f stk430.xcl
1. ChooseProject>Options
2. Select the XLINK category.
3. On the output page, select the format Other and choose msp430-txt from the drop-down list.