Specifications
CAVR-4
Part1. Using the compiler
The CLIB runtime environment
89
FORMATTERS USED BY SCANF AND SSCANF
Similar to the printf and sprintf functions, scanf and sscanf use a common
formatter, called
_formatted_read. The full version of _formatted_read is very
large, and provides facilities that are not required in many embedded applications. To
reduce the memory consumption, an alternative smaller version is also provided.
_medium_read
The _medium_read formatter has the same functions as the full version, except that
floating-point numbers are not supported.
_medium_read is considerably smaller than
the full version.
Specifying the scanf formatter in IAR Embedded Workbench
1
Choose Project>Options and select the General Options category. Click the Library
options tab.
2 Select the appropriate Scanf formatter option, which can be either Medium or Large.
Specifying the read formatter from the command line
To use the _medium_read formatter, add the following line in the linker command file:
-e_medium_read=_formatted_read
To use the full version, remove the line.
System startup and termination
This section describes the actions the runtime environment performs during startup and
termination of applications.
The code for handling startup and termination is located in the source files
cstartup.s90 and _exit.s90, and low_level_init.c located in the
avr\src\lib directory.
SYSTEM STARTUP
When an application is initialized, a number of steps are performed:
● The custom function __low_level_init is called, giving the application a chance
to perform early initializations
● Enables the external data and address buses if needed
● Initializes the stack pointers to the end of CSTACK and RSTACK, respectively