- Important information
- New features
- Known problems
- Program corrections
- User guide corrections
- Miscellaneous
- Release history
Important information
-
Read the IAR C/C++ Development Guide for STM8 for detailed information about this product component.
New features
-
None
Known Problems
-
Struct assignment does not work for objects in huge memory that cross 64-Kbytes section boundaries.
-
Some IAR C language constructs relating to inlining and absolute symbols are not represented correctly in the assembler language listings, leading to list files that cannot be assembled.
-
The EEC++ templates
std::less
,std::less_equal
,std::greater
, andstd::greater_equal
, as well as thestd::string
methodsappend
,assign
,insert
, andreplace
that take a pointer argument do not take the extended address byte of__far
pointers into account, which could lead to unexpected behavior.
Program Corrections
-
[EWSTM8-703] An incorrect optimization removes a required load instruction.
User guide corrections
-
Summary of extended keywords, page 299
Extended keyword:__ro_placement
Description: Placesconst volatile
data in read-only memory
Descriptions of extended keywords, page 304
__ro_placement
Syntax: See Syntax for object attributes, page 298.
Description: The__ro_placement
attribute specifies that a data object should be placed in read-only memory. There are two cases where you might want to use this object attribute:
- Data objects declared
const volatile
are by default placed in read-write memory. Use the__ro_placement
object attribute to place the data object in read-only memory instead. - In C++, a data object declared
const
and that needs dynamic initialization is placed in read-write memory and initialized at system startup. If you use the__ro_placement
object attribute, the compiler will give an error message if the data object needs dynamic initialization.
You can only use the__ro_placement
object attribute onconst
objects.
In some cases (primarily involving simple constructors), the compiler will be able to optimize C++ dynamic initialization of a data object into static initialization. In that case no error message will be issued for the object.
Example:
__ro_placement const volatile int x = 10;
- Data objects declared
Miscellaneous
-
Workaround for the hardware bug "Unexpected result when DIV/DIVW instruction used in ISR"
If there is aDIV
orDIVW
instruction in the ISR or there is a call to at least one function the compiler automatically inserts a workaround as:
Note: If there is nopush cc pop a and a,#$BF push a pop cc
DIV
and noDIVW
instruction and no call to any function the workaround is not implemented.
You can globally disable the workaround from the command line with the option--disable_hardware_workaround DIV_ISR
.
You can also disable the workaround for individual interrupt service routines using the new function object attribute__no_div_workaround
.
See hardware errata for more information.
Release history
V3.10.1 - 2017-06-30
Program corrections-
[EW26254] Correct C code can cause an internal error in the compiler after an inline assembler statement has resulted in an error.
-
[EW25931], [EW26300] The linker optimization to merge duplicate sections (
--merge_duplicate_sections
) can sometimes incorrectly merge non-equivalent sections.
-
Improved code generation and optimization
The compiler generates smaller and faster code for certain source program constructions. -
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.
V2.20.3 - 2017-01-31
-
[EW26359] Extracting a byte from a 32-bit value can sometimes corrupt local variables or data objects.
-
[EW26050] Certain 32-bit operations, when implemented with library calls, do not preserve the volatileness of memory operands.
V2.20.1 - 2015-11-27
-
Improved code generation and optimization
The compiler generates smaller and faster code for certain source program constructions.
V2.10.4 - 2015-03-31
Program corrections-
[EW25222] The compiler emits a spurious error when a non-constant is used to supply the value of a bit-field member in aggregate initialization of a structure with automatic storage duration.
V2.10.3 - 2015-02-18
Program corrections-
[EW25205] Initalization of local structs or arrays with size in bytes >= 256 could destroy the value of other local variables. Assignment and parameter passing of large whole arrays or structs could also be affected by the same problem.
-
[EW25206] Subtracting a 32-bit value from a constant could destroy the value of another local variable.
-
[EW25207] Shifting a signed char right a constant amount >= 8 could give the wrong result.
-
[EW25208] Signed bitfields in long types with a witdh of 8 or 24 bytes could yield the wrong value when read, and lead to decreased performance.
-
[EW25211] The compiler gives an error if an __eeprom variable is first declared, then defined later in the same compilation unit.
-
[EW25219] Internal Error occurs in the compiler when declaring an array on the stack which is larger than 32 kB.
V2.10.1 - 2014-11-20
New features-
You can choose between the default versions and smaller versions of the mathematical functions cos, sin, tan, log, log10, pow, and exp.
-
Multithread supporting libraries can be built. See the C/C++ Development Guide or the online help system.
V1.42.1 - 2014-01-23
New features-
Support for static and global initialized
__eeprom
variables has been added. -
Absolute located variables no longer have to be declared no_init.
-
[EW24382] In rare cases at high optimization levels, an assignment to an element of a local array can be incorrectly optimized away.
-
[EW24120],[EW24436] Absolute located constants (also placed with #pragma location) causes an internal error.
V1.41.1 - 2013-07-05
-
None.
V1.40.1 - 2013-03-05
New features-
New intrinsic functions
Intrinsic functions that generate bit handle instructions from the compiler have been added. These functions are defined inintrinsics.h
:__BCPL(a,b)
,__BRES(a,b)
, and__BSET(a,b)
.
Assembler instructions with corresponding names are generated. These instructions manipulate the specified bit number (specified inb
) in the byte at the address pointed out bya
.
Example:
static unsigned char str[] = "sTM8";
__BCPL((unsigned char __near *)str,5); // "sTM8" -> "STM8"
-
[EW22912] On optimization level High
__ramfunc
functions could become inlined in ROM-functions.
V1.31.2 - 2013-01-24
Program corrections-
[EW23702] Signed long comparison with zero sometimes used the wrong jump instructions.
V1.31.1 - 2012-10-04
Program corrections-
[EW23102] The linker configuration files for the STM8S20x devices had incorrect RAM region setup. This is now corrected.
-
[EW23355] An error in the register allocation could generate an
Internal Error: [`anonymous-namespace'::Base::Validate]: Malformed instruction
. This is now corrected.
V1.30.2 - 2011-12-21
Program corrections-
[EW22619] The linker configuration files for the STM8S903 devices had incorrect RAM region setup. This is now corrected.
-
[EW22772] Interrupt vectors for the STM8L151x8, STM8L152x8 and STM8L162x8 was defined incorrect in the configuration files. This is now corrected.
V1.30.1 - 2011-04-05
Program corrections-
[EW22193] Some register offsets in the Common Information Entry of interrupt handlers were wrong. This is now corrected.
V1.20.1 - 2010-11-03
New features-
EC++ and EEC++ support
The compiler now has support for Embedded C++ and Extended Embedded C++. -
New extended keyword
__ramfunc
The__ramfunc
keyword makes a function execute in RAM. If a function declared__ramfunc
tries to access ROM, the compiler will issue a warning.
Functions declared__ramfunc
are by default stored in the section named*_func.textrw
.
Example:__ramfunc int FlashPage(char * data, char * page);
-
[EW21775]
#pragma vector=31
is added to the library files. -
[EW21865] Using non-initialized variables in arrays with
struct
could generate an internal error. This is now corrected. -
[EW21895] Declaring local arrays as
volatile
generated an internal error. This has been corrected. -
[EW21928] Declaring local variables as
__far
generated an internal error. This has been corrected. -
[EW21941]
__section_begin
on overlays sometimes returns 0 despite the actual start address of the section. This is now corrected.
V1.10.1 - 2010-05-05
Program corrections-
New ILINK configuration files with corrected placement and initializations of
.tiny.rodata
sections.
V1.10.0 - 2010-04-16
- First official release