EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

disabling security in bootloader

Started by Steve Letkeman July 6, 2004
Chris, Steve,

I have some further notes around the subject.

At 03:46 PM 7/7/2004, Chris Knight wrote:
> 1. The BDM programmer enters special single chip mode and uses the
> hardware BDM command, WRITE_BD_WORD, to write the backdoor key bytes into
> the fixed RAM locations. This is permitted even if the flash is secured.

The MC9S12XDP512 (the new "S12X" ) security documentation explicitly says
that BDM can only access the registers in Special Single Chip Mode, so this
won't work with S12X parts. This probably won't be a problem for a few years.

Could you meet your goals with reading back the flash contents after
programming, but before the first reset after programming flash?

Would this procedure:

1. Store a checksum value in flash. (This needs to be calculated after
linking. It could be by some program that reads the load file and can
output a new load file with the correct checksum in the checksum value
location. The neatest way would be to modify the flash programming program
to do it on the fly.)

2. Calculate a flash checksum as part of normal startup.

3. If the checksum does not agree with a stored value, decide flash is
corrupt, and don't start.

4. If the checksum agrees with the stored value, output the program
version and checksum value on some suitable output device such as SCI, CAN,
or a display. (This allows confirmation that the version is still in flash
and not corrupted.)

(This gives you the extra security of a flash checksum check on each
startup, but does not require BDM access to RAM.)

Would this procedure meet your goals?

>this implies that NONE of the 4 backdoor key words can be either 0x0000 or
>0xFFFF

That is my reading, but I haven't tested it.

Hope this helps

Steve Russell
Nohau Emulators
*************************************************************************
Steve Russell mailto:
Senior Software Design Engineer http://www.nohau.com
Nohau Corporation phone: (408)866-1820 ext. 1873
51 East Campbell Avenue fax: (408)378-7869
Campbell, CA 95008
*************************************************************************



The 2024 Embedded Online Conference