AN2295 Freescale Semiconductor / Motorola, AN2295 Datasheet - Page 46

no-image

AN2295

Manufacturer Part Number
AN2295
Description
Developers Serial Bootloader for M68HC08 and HCS08 MCUs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
PC Bootloader Master Software
8-Bit MCU Image Operations
To perform the necessary operations with the code, the master software keeps a binary image of the
memory. Also, the information about whether an actual byte is to be programmed into the MCU is stored.
This is done by following structure:
typedef struct {
} BOARD_MEM;
where image is the actual variable defined as follows:
After the source S19 files are read, this array contains the actual data to be programmed into the MCU
irrespective of its original order in the S19 file. The function
implements the S19 file opening, reading, and relocation from S19 hexadecimal format into this binary
array.
Interrupt Vector Table Relocation
After the ident information is read out of the MCU, the following operations within the image are carried
out:
These operations are executed in the function
Checking Memory Boundaries
The last check performed before the code is actually programmed into the MCU is to determine whether
the code from the S19 file is in the correct memory locations (between the memory boundaries that are
reported by the MCU in the ident table).
If any value outside the range of addresses between the start address of reprogrammable memory area
and the end address of reprogrammable memory area is found, a warning is generated.
This check is done in
46
The code is scanned to determine whether any interrupt vectors are present between the MCU
interrupt vector table address and 0xFFFF (the last existing physical address of the M68HC(S)08
MCU).
If interrupt vectors are present, relocation of these vectors is done as described in
Table
unused (thus not being reprogrammed).
BYTE d[0x10000];
BYTE f[0x10000];
Relocation. Then, the original address spaces in the interrupt vector table are marked as
int check_image(void)
Developer’s Serial Bootloader for M68HC08 and HCS08 MCUs, Rev. 6
BOARD_MEM image;
// data
// valid flag 0=empty; 1=usercode; 2=systemcode
int setup_vect_tbl(void)
also defined in the
int read_s19(char *fn)
prog.c
file.
defined in
Freescale Semiconductor
defined in
prog.c
Interrupt Vector
file.
s19.c

Related parts for AN2295