AN1836 Motorola / Freescale Semiconductor, AN1836 Datasheet - Page 8

no-image

AN1836

Manufacturer Part Number
AN1836
Description
FLASH Programming for Motorola MC68HC912 Microcontrollers
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Application Note
"lost," it is possible that the programming voltage could be applied to the
array for a time much longer than the specifications allow, resulting in
corruption of data. Obviously, implementing FLASH-modifying code,
such as bootloaders stored in FLASH, could result in such a case if the
microcontroller were to get lost and start executing code at a random
point.
NOTE:
In cases such as this, great care must be taken to test all of the code to
make certain that FLASH modification routines cannot be activated
accidentally.
If these routines must be located in non-volatile memory (NVM), other
ways to safeguard against code runaway are possible. For instance, if
assembly opcodes are interlaced with software interrupt (SWI)
instructions, splitting up the instruction which modifies the FEECTL
register to apply the programming voltage to the array prevents
accidental modification of that register. To actually run the code, that
section of code in RAM would need to be reconstructed by copying the
bytes from their interlaced location in NVM using a message from the
CAN, J1850, SCI, etc., which contains the decryption key for the
locations of the scrambled opcodes. The SWI instructions are not
essential, but would ensure that the device would execute an SWI if the
code were lost in this region, alerting the engineer to a possible
dangerous condition. This concept is complicated and is beyond the
scope of this application note. It is mentioned here only to offer one
possible alternative to avoid accidental activation of program or erase
routines.
The other major reason to simply leave the program and erase routines
out of the NVM is in the interest of software reuse. As newer devices are
developed and newer FLASH technologies emerge, the algorithms for
programming and erasing these routines also are being refined. If the
algorithms themselves are downloaded dynamically to the target
devices at the time of programming, the newest algorithms can be
utilized with little impact to the target system. This allows the target
system software to remain FLASH technology independent, minimizing
engineering time required for code development and testing.
AN1836
8
MOTOROLA

Related parts for AN1836