Compiling An Application - Silicon Laboratories Si4010 Software Programming Manual

Hide thumbs Also See for Si4010:
Table of Contents

Advertisement

AN370

4.9. Compiling an Application

To use the Si4010 API to build a user application in C, the user must do the following:
1. To be able to use the Silicon Laboratories IDE for debugging, the user must use the Keil BL51 linker or toolchain
with the standard OMF-51 output file format. The user cannot use the LX51 linker, since the Keil proprietary
output format, OMF-2, is not understood by the Silicon Laboratories IDE.
2. Add the path
...\common\src\
installed.
3. Include
and
si4010.h
include the
si4010_types.h
#include "si4010.h"
#include "si4010_api_rom.h"
4. Add the following files, which have to be assembled or compiled, into the application build, and/or those files
must be linked with the user application:
si4010_rom_keil.a51
si4010_data.c
si4010_link.c
startup.a51
si4010_fix_rom_keil.lib only for Rev B.
For Keil toolchain, if the user does not desire to use some of the Keil library functions in the ROM, then the file
si4010_rom_all.a51
5. The user must use the stack pointer setting directive manually on a linker command line or from the compilation
IDE. Since the end of the IDATA memory is reserved and used by the API, the stack segment for stack pointer
setting as defined in
startup.a51
Optionally, the
startup.a51
Then the user will have to set the stack pointer manually to a fixed location in
beginning of the application.
The following shows linker command line directives to place a stack manually using the address
example:
For Keil BL51:
STACK(?STACK(0x80))
For Keil LX51:
SEGMENTS(?STACK(I:0x80))
For Raisonance:
IDATA(?STACK(0x80))
6. The user must make sure that the application is not using the CODE/XDATA reserved area of RAM as
described above. To achieve this, the user may either control the XDATA reserved area directly on a linker
command line, or edit the
since the file contains a commented section at its end explaining how to do that), or create additional file with
dummy fixed address XDATA byte array.
7. The user must make sure that the CODE and XDATA areas as provided to the linker are not overlapping since
the CODE and XDATA share the same physical RAM. For example, the CODE and XDATA linker directives
should set as shown below. In this example, the code size is limited to
variable area:
For Keil BL51:
CO(0x0000-0x0CFF) XD(0x0D00-0x107F)
For Keil LX51:
CLASSES(CODE(C:0X0-C:0XCFF), CONST(C:0X0-C:0XCFF)
XDATA (X:0XD00-X:0X107F),
8. The API uses part of both DATA/IDATA and XDATA memories for data storage and the user application code
must not change content of those areas. Those areas must be completely avoided by the user application. The
provided file si4010_link.c reserves API space in DATA/IDATA memories as used by API, since the API regions
18
to the C compiler and include directive. This is where the Si4010 files are
headers in every C source file of the application. These files
si4010_api_rom.h
header automatically:
or for non-Keil compilers
must be used with the Keil toolchain instead.
must be done manually.
can be modified not to include stack pointer setting using a stack segment.
.. while using the supplied
si4010_link.c
file to add the reserved XDATA area there (preferred solution,
... )
Rev. 1.0
si4010_rom_all.a51
startup.a51
startup.a51
0x0D00
length, followed by XDATA
or at the
0x80
as an
,

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Si4010 and is the answer not in the manual?

Questions and answers

Table of Contents