The Simple Code output format

Updated: Sep 15, 2004 [IJYB]
Archived: $Revision: 42975 $

Introduction

Simple-code is a generic flash loader format that has been developed by IAR Systems. It is a simple binary format with a few tags. The information in this document should be enough to write a flash loader.

The file structure

The flash loader format file has a simple structure. The file starts with a file header that contains information about the entire program. After the file header records containing the bytes of the program and their location follow. All fields in the file are unsigned big endian values.

The file header

The file header uses a magic number to identify the file as a simple-code file and it also contains the program's entry address and program flags. The program entry is a 4 byte address but because there might be several address spaces, a segment type field for the entry address is also needed. Finally, the file header contains a version information field.

The records

The first byte in the record is the record tag, it is used to identify the different record types. Currently, (version 0) there are three record types, data records that contain the program bytes, entry records that contains the program's entry point and end record that marks the end of the file and the file's checksum. This might change in the future.

Note that there is no alignment since the size of the data record's program bytes not necessarily is a multiple of four.


Copyright 2004 IAR Systems. All rights reserved.