Echelon Neuron C User Manual

Page 245

Advertising
background image

Neuron C Programmer’s Guide

233

file. The output files are directed (with the "-o" switch) to files named

"myimage.*."

nld –c –b c:\LonWorks\Images\Ver13\sys3150 –t 3150 –Z 4F –V 128 –o

myimage [email protected]
After using the linker as described above, the following custom system
image files are created:

• The myimage.sym file contains a list of the image’s exported

symbols for use when linking an application program to the

image.

• The myimage.nx file is an Intel hex-format file containing the

binary linked system image.

• The myimage.map file (if requested) is a link map and report for

the image.

2

Move the system image files into the appropriate Ver

nnn

directory

corresponding to the version number you supplied in step 1.

Following are additional guidelines for constructing custom system images:
1

You can use libraries when constructing custom system images, but only
to the extent that they are referenced. The complete library contents are

not automatically transferred into the custom system image. Any global

variables defined in the library must be declared as far (RAM) variables
in order to be used in constructing a custom system image.

2

You cannot program PROMs directly with a custom system image. To

program a PROM, you must build a ROM image file that is based on the
custom system image using the NodeBuilder tool. You can use an empty

application to build the image if you just want to load the custom system

image into PROM.

3 Use

the

static keyword to declare functions or data items that are not to

be exposed to the application program. This declaration effectively hides
that symbol.

4

Construct include files containing extern function prototypes and extern

data declarations for the users of the custom system image to include in
their programs. You must use the extern keyword for each declaration to

allow the compiler to establish the correct calling sequence and use the

appropriate assembler commands to permit linking to the data object or
function contained in the custom system image.

Then, include these include files in the custom system image source files

that define these functions and data objects so that the Neuron C
compiler can ensure that your extern declarations and prototypes match

your actual declarations and function definitions. You can have a specific

extern declaration precede the actual declaration, as long as the
declarations match. This technique can help prevent calling a function

with incorrect parameters (due to an incorrect extern prototype, for
example), which could result in an overwritten data stack and thus a

device which repeatedly experiences a watchdog timer reset, overwritten

variables, or similar software failures.

5

You can use a maximum of 64 bytes of RAM within a custom system

image. If one custom system image is used as a base for another, this

Advertising