<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.14.1">
</HEAD>
<BODY>
It seems to me as someone who designs and makes embedded devices (mainly using the Freescale MC9S12 processors) that you need another lower level bootstrap loader that is small, can be protected and will either jump to the main bootstrap loader if it is functional or be able to download a new 2nd stage bootstrap loader and program it into flash via the USB port.<BR>
<BR>
Here is a flow chart for the proposed loader<BR>
<BR>
RESET<BR>
1. Turn protection on for this first level bootstrap code (if necessary)<BR>
2. Check if user wants to download new 2nd stage bootstrap (could use AUX button), if so goto 5<BR>
3. Check if 2nd stage bootstrap exists (is 2nd stage bootstrap flash blank?), if so goto 5<BR>
4. Check 2nd stage bootstrap code in Flash via checksum, if OK load into RAM and jump to else goto 5<BR>
5. Download new second stage bootstrap image from the USB port and store into FLASH. I would use some simple HEX format like Intel or Motorola HEX format.<BR>
<BR>
I have used a similar scheme for some time now and it has been bullet proof for me.<BR>
<BR>
Simon Matthews<BR>
<BR>
<BR>
<BR>
<BR>
On Wed, 2007-05-16 at 19:55 -0300, Werner Almesberger wrote: 
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Marcin Wiacek wrote:</FONT>
<FONT COLOR="#000000">&gt; Of I see that we think about different things....</FONT>

<FONT COLOR="#000000">Yup :-)</FONT>

<FONT COLOR="#000000">&gt; I was thinking about protecting memory with main phone software (like</FONT>
<FONT COLOR="#000000">&gt; kernel, boot loader, main apps).</FONT>

<FONT COLOR="#000000">You'll (almost certainly) be able to do this as well: the new MCU</FONT>
<FONT COLOR="#000000">will allow you to specify which NAND Flash area can be written to.</FONT>
<FONT COLOR="#000000">Once this is set, it cannot be changed without a reset. So this</FONT>
<FONT COLOR="#000000">would be a &quot;hardware assisted&quot; solution. Unfortunately, you can</FONT>
<FONT COLOR="#000000">probably bypass it if you're determined.</FONT>

<FONT COLOR="#000000">- Werner</FONT>

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>