AN2295 Freescale Semiconductor / Motorola, AN2295 Datasheet - Page 49

no-image

AN2295

Manufacturer Part Number
AN2295
Description
Developers Serial Bootloader for M68HC08 and HCS08 MCUs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Bootloading Procedure Demonstration
Main Programming Loop
int
The core of the bootloader’s programming capabilities is implemented in the function
prg_area(unsigned start, unsigned end)
. The task of this routine is to read data from an image and
split the data into blocks of appropriate size (minimum erase/write block sizes). Then the erase block and
write block routines are called, in that order.
The routine also prints the progress information to the standard I/O (for example, block boundary
addresses, progress indicator).
int prg_mem(void)
One additional auxiliary function,
, is included. It retrieves the lowest and highest
memory addresses that must be programmed because those addresses are used for calling the
int
prg_area(unsigned start, unsigned end)
function.
Final Unhook
int unhook(void)
Function
sends out the
Quit
Command.
Bootloading Procedure Demonstration
The bootloader binary code (S19 file) is loaded in the MCU like any other regular 8-bit MCU (using
MON08 serial programmer or other, for HCS08 using BDM interface). Then the MCU is soldered (or
socketed) in the application.
Using the bootloader that was pre-programmed into the MCU, the user can download the 8-bit MCU user
application code via SCI interface using the bootloader utility.
Bootloading Operation
hc08sprg
Open a command prompt in the Linux or Windows directory where the copy of
executable
and S19 files are.
Assuming the serial board is connected to—for example—second serial port (COM2, /dev/ttyS1) and is
not yet powered on, invoke the bootloader using following sequence: hc08sprg.exe 2:D test.s19
Developer’s Serial Bootloader for M68HC08 and HCS08 MCUs, Rev. 6
Freescale Semiconductor
49

Related parts for AN2295