Specifications
PC bootloader master software
Developer’s Serial Bootloader, Rev. 13
Freescale Semiconductor 61
void CRC_AddByte(unsigned short *pCrc, unsigned char data)
void CRC_AddWord(unsigned short *pCrc, unsigned short data)
void CRC_Add3Bytes(unsigned short *pCrc, unsigned long data)
void CRC_AddLong(unsigned short *pCrc, unsigned long data)
void CRC_AddByteArray(unsigned short *pCrc, unsigned char* data, int size)
void CRC_AddString(unsigned short *pCrc, unsigned char* str)
void CRC_ResetCRC(unsigned short *pCrc, unsigned short seed)
unsigned short CRC_GetCRC(unsigned short *pCrc)
9.6.1 Initial hook (waiting for MCU reset)
Immediately after all initializations are done in the PC, a loop starts to wait for communication from the
MCU. The int hook_reset(void) routine implements all necessary steps to establish initial
communication with the MCU.
9.6.2 Checking ACK
A routine int could_be_ack(unsigned b) checks if a received character fits the possible set of
characters that can be received due to a communication speed mismatch (See Unknown MCU
communication speed).
9.6.3 Speed calibration
A speed calibration loop, implemented in the int calibrate_speed(void) routine, follows the scenario
described in Slave frequency calibration. If no ACK is received from the MCU, another break character is
sent.
9.6.4 MCU information reading
Immediately after the calibration is successfully completed, the PC requests the Ident command, to which
the MCU responds with information about itself. This is achieved in the int read_mcu_info(void)
routine.
9.6.5 Image manipulations
The two functions, int setup_vect_tbl(void) and int check_image(), are described in 8-Bit and
32-Bit MCU image operations.
9.6.6 Block operations
Three main data exchange operations are performed:
• Erase block
• Read block
• Write (program) block
These basic operations are implemented in the functions:
int erase_blk(unsigned a)










