Download ST200 Micro Toolset User Manual
Transcript
Board target configuration
Note:
ST200
To load and run an application on a target board or simulator, a detailed description of the
target system in the form of an ST TargetPack or simulator pack is specified to st200xrun,
see Chapter 5: Cross development tools on page 40 for details.
To get valid results and for benchmarking purposes, time functions such as clock()
require a correct run-time configuration.
4.1.1
The sysconf code module
The toolset delivers a set of sysconf code modules located in the
<tools-dir>/target/board directory. Within the board directory there is one
subdirectory for each board.
src/sysconf.c
The module managing sysconf parameters for the corresponding
board target.
board.ld
The board target-specific linker directives, including the memory map
definition. It defines the memory configuration for the board target.
makefile
The makefile to rebuild bootboard.o and libboard.a.
A template directory within the board directory contains a template for sysconf.c The
template shows where to add code to create a new board target used by the toolset.
The sysconf parameters can be accessed directly from a user program. For example:
#include <stdio.h>
#include <machine/sysconf.h>
main()
{
unsigned int fclock, pclock, ramsize, rambase;
fclock = sysconf(_SC_LX_CORE_CLOCK_FREQ);
pclock = sysconf(_SC_LX_PERIPH_CLOCK_FREQ);
ramsize = sysconf(_SC_LX_RAMSIZE);
rambase = sysconf(_SC_LX_RAMBASE);
printf("cpu clock %dMhz periph clock %dMhz ramsize 0x%8.8x
rambase 0x%8.8\n", clock/1000000, pclock/1000000, ramsize,
rambase);
}
4.1.2
Generating code for a board target
To address an application for a given board target, a specific option must be given at link
time when generating the application.
-mcore=<core_target>
28/246
Enables the selection of a core target (a specified core
type). This option automatically adds the bootcore.o and
libcore.a files to the list of object files to link together and
automatically selects the core-specific core.ld linker file. If
the -mcore option is missing, the compiler driver assumes
“ST231” settings.
8063762 Rev 9