- 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 assembly 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 takes a pointer argument do not take the extended address byte of__far
pointers into account, which could lead to unexpected behaviour.
Program Corrections
-
Some register offsets in the Common Information Entry of interrupt handlers were wrong. This is now corrected.
[EW22193]
User guide corrections
IAR C/C++ Development Guide, DSTM-2
-
EEPROM, page 27
Additional information:
To make the automatic writes to eeprom variables work, the user must implement the three functions declared at the top of the filestm8/src/lib/eeprom_util.c
. -
Interrupt vectors and the interrupt vector table, page 37
Additional information:
The interrupt vector number, N, is the index in the interrupt vector table, counted from the reset vector address:
N = (vectorAddress - resetVectorAddress) / 4
The default interrupt handler does not call theabort
function. Rather, it loops over aNOP
where you may put a breakpoint during debugging. You can change this default behaviour by overriding the function__iar_unhandled_exception
defined in the filesrc/lib/unhandled_exception.s
. -
Choosing a library, page 67
Projects built using the large code model can use libraries built with the medium code model. These libraries are both smaller and faster, so no libraries built with the large code model are delivered. The linker will select the appropriate library automatically. -
Library files, page 68
code_model
is one of 's' or 'm' for the small and medium code model, respectively.
IAR does not provide libraries built with the large code model; projects using the large code model should use libraries built with the medium code model.
This is handled automatically by the linker unless you use your own customized library. -
Choosing formatters for printf and scanf, page 69
Additional information:
The library now have more variants for theprintf
and thescanf
formatter,_Printf
and_Scanf
, that removes the multibyte support. The new formatters are named:_PrintfNoMb
,_PrintfLargeNoMb
,_PrintfSmallNoMb
,_ScanfNoMb
,_ScanfLargeNoMb
, and_ScanfSmallNoMb
. -
Virtual registers, page 103
The number of the two-byte virtual registers should be changed:
The two-byte (16-bit) virtual registers are called?w0, ?w1, ...,?w7
. They are composed as non-overlapping pairs of one-byte virtual registers, so that for example?w1 = ?b2:?b3
-
CFI Directives, page 113
Replace?RET16:16
and?RET24:24
in Table 22 with:
PC:24
The full return address, composed from PCE:PCH:PCL.
PCL:8
The least significant byte of the return address.
PCH:8
The middle byte of the return address.
PCE:8
The most significant byte of the return address.
-
Creating assembler source with CFI support, page 114
Replace the list file with:NAME Cfi RTMODEL "__SystemLibrary", "DLib" RTMODEL "__code_model", "small" RTMODEL "__core", "stm8" RTMODEL "__data_model", "medium" RTMODEL "__rt_version", "4" EXTERN ?w4 EXTERN F EXTERN ?epilogue_w4 EXTERN ?push_w4 PUBLIC cfiExample CFI Names cfiNames0 CFI StackFrame CFA SP DATA CFI Resource A:8, XL:8, XH:8, YL:8, YH:8, SP:16, CC:8, PC:24, PCL:8 CFI Resource PCH:8, PCE:8, ?b0:8, ?b1:8, ?b2:8, ?b3:8, ?b4:8, ?b5:8 CFI Resource ?b6:8, ?b7:8, ?b8:8, ?b9:8, ?b10:8, ?b11:8, ?b12:8, ?b13:8 CFI Resource ?b14:8, ?b15:8 CFI ResourceParts PC PCE, PCH, PCL CFI EndNames cfiNames0 CFI Common cfiCommon0 Using cfiNames0 CFI CodeAlign 1 CFI DataAlign 1 CFI ReturnAddress PC CODE CFI CFA SP+2 CFI A Undefined CFI XL Undefined CFI XH Undefined CFI YL Undefined CFI YH Undefined CFI CC Undefined CFI PC Concat CFI PCL Frame(CFA, 0) CFI PCH Frame(CFA, -1) CFI PCE SameValue CFI ?b0 Undefined CFI ?b1 Undefined CFI ?b2 Undefined CFI ?b3 Undefined CFI ?b4 Undefined CFI ?b5 Undefined CFI ?b6 Undefined CFI ?b7 Undefined CFI ?b8 SameValue CFI ?b9 SameValue CFI ?b10 SameValue CFI ?b11 SameValue CFI ?b12 SameValue CFI ?b13 SameValue CFI ?b14 SameValue CFI ?b15 SameValue CFI EndCommon cfiCommon0 SECTION `.near_func.text`:CODE:REORDER:NOROOT(0) CFI Block cfiBlock0 Using cfiCommon0 CFI Function cfiExample CODE cfiExample: CALL L:?push_w4 CFI ?b9 Frame(CFA, -2) CFI ?b8 Frame(CFA, -3) CFI CFA SP+4 LDW S:?w4, X LDW X, S:?w4 CALL L:F ADDW X, L:?w4 JP L:?epilogue_w4 CFI EndBlock cfiBlock0 SECTION VREGS:DATA:REORDER:NOROOT(0) END
-
Speed versus Size, page 155
Additional information:
The IAR compiler allows the user to chose an optimization goal for each module, or even individual functions, using command line options and pragma directives (see-O
on page 198 and#pragma optimize
on page 258). For a small embedded application this makes it possible to achieve acceptable speed performance while minimizing the code size: Typically, only a few places in the application need to be fast, such as the most frequently executed inner loops, or the interrupt handlers.
Rather than compiling the whole application with High (Balanced) optimization, you can use High (Size) in general, but override this to get High (Speed) optimization only for those functions where the application needs to be fast.
Because of the unpredictable way in which different optimizations interact, where one optimization can enable other optimizations, sometimes a function becomes smaller when compiled with High (Speed) optimization than if High (Size) is used. Also, using multi-file compilation (see--mfc
, page 193) can enable many optimizations to improve both speed and size performance. It is recommended that you experiment with different optimization settings so that you can pick the best ones for your project. -
New compiler option --use_c++_inline, page 180
Standard C uses slightly different semantics for theinline
keyword than C++ does.
Use this option to get C++ semantics when compiling a Standard C source code file. -
New linker option --search, page 207
The--search path
command line option wherepath
is the directory where the linker should search for object and library files. -
Added parameters for the linker option --log, page 216
libraries Lists all decisions taken by the automatic library selector. redirects Lists redirected symbols. unused_fragments Lists those sections fragments that were not included in the application.
-
Data pointers, page 232
Replace Table 34 with:Keyword Pointer size Index type Address range __tiny 8 bits signed char 0x0-0xFF __near 16 bits signed short 0x0000-0xFFFF __far 24 bits signed short 0x000000-0xFFFFFF (16-bit arithmetics) __huge 24 bits signed long 0x000000-0xFFFFFF __eeprom 16 bits signed short 0x0000-0xFFFF
-
Descriptions of extended keywords, __eeprom, page 242
Additional information:
Data with the__eeprom
attribute must also be__no_init
. -
Descriptions of extended keywords, __interrupt, page 244
Additional information:
To make sure the interrupt handler executes as fast as possible, you should compile it with-Ohs
, or use#pragma optimize=speed
if the module is compiled with another optimization goal. -
Descriptions of extended keywords, __noreturn, page 246
Additional description:
The__noreturn
object attribute is now disabled on low optimizations and when building a library. Ifabort()
orexit()
is called, you can see from where it was called. -
Library overview, page 275
Additional information:
The default implementation ofcos
,sin
,tan
, andpow
is designed to be fast and small. As an alterative, there are versions designed to provide better accuracy. They are named__iar_xxx_accuratef
forfloat
variants of the functions and__iar_xxx_accuratel
for long double variants of the functions, where xxx iscos
,sin
, etc.
To use any of the more accurate functions use--redirect
linker option. -
Summary of sections, page 305
In Table 44:
Rename.difunct
to.init_array
Add.iar.init_table
Holds the table of initializations to perform at application start. Created by the linker. -
Descriptions of sections and blocks, page 307
Add
.iar.init_table
Description Holds a table of initializations to perform at application start. This section is created by the linker if any initializations are needed. In the linker map file theINIT TABLE
section describes the contents of this section. Memory placement In ROM anywhere in the 16 Mbytes of memory, but separated into 64-Kbyte sections.
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
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);
-
#pragma vector=31
is added to the library files.
[EW21775] -
Using non-initialized variables in arrays with
struct
could generate an internal error. This is now corrected.
[EW21865] -
Declaring local arrays as
volatile
generated an internal error. This has been corrected.
[EW21895] -
Declaring local variables as
__far
generated an internal error. This has been corrected.
[EW21928] -
__section_begin
on overlays sometimes returns 0 despite the actual start address of the section. This is now corrected.
[EW21941]
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