Flash programming?

Started by hc12meyer September 2, 2005
Hi,

I am in the process of writing my bootloader in "C" using imageCraft
and got some bump on the road. So, I wondering now that "is it
actualy possible to have my bootloader in $C000 - $FFFF Flash
location and erase the the rest of the area?". Of cause using the
sector erase method. The bootloader is similar to the one described
in the AN2400.

Please let me know! The MCU is 9S12E128 device and it has eight 16K pages. The $C000 -
$FFFF Flash location is a page. The flash memory contains 1 block of
128k bytes organized as 1024 rows of 128 bytes. The erase sectior
size is 8 rows (1024 bytes).


I wrote a similar bootloader for a 128 chip and I believe I had to protect
the bootloader block, f800 -ffff, and then block erase the first block
followed by an iterative sector erase on everything but the protected area
of the block in which the bootloader resides. This worked fine but you have
to remember to switch the block through the FCNFG register when performing
the block erase. Likewise, in sector erase you must remember to increment
the PPAGE register.

I know I had a few hiccups but since then it has worked very reliably.

-dWILD
-----Original Message-----
From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf Of
hc12meyer
Sent: Friday, September 02, 2005 7:58 AM
To: 68HC12@68HC...
Subject: [68HC12] Flash programming?

Hi,

I am in the process of writing my bootloader in "C" using imageCraft and got
some bump on the road. So, I wondering now that "is it actualy possible to
have my bootloader in $C000 - $FFFF Flash location and erase the the rest of
the area?". Of cause using the sector erase method. The bootloader is
similar to the one described in the AN2400.

Please let me know! The MCU is 9S12E128 device and it has eight 16K pages. The $C000 - $FFFF
Flash location is a page. The flash memory contains 1 block of 128k bytes
organized as 1024 rows of 128 bytes. The erase sectior size is 8 rows (1024
bytes).
Yahoo! Groups Links



Thank you!! I will protect the block and give a shot!

--- In 68HC12@68HC..., "David Wild" <david.wild@a...> wrote:
> I wrote a similar bootloader for a 128 chip and I believe I had to
protect
> the bootloader block, f800 -ffff, and then block erase the first
block
> followed by an iterative sector erase on everything but the
protected area
> of the block in which the bootloader resides. This worked fine but
you have
> to remember to switch the block through the FCNFG register when
performing
> the block erase. Likewise, in sector erase you must remember to
increment
> the PPAGE register.
>
> I know I had a few hiccups but since then it has worked very
reliably.
>
> -dWILD >
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On
Behalf Of
> hc12meyer
> Sent: Friday, September 02, 2005 7:58 AM
> To: 68HC12@68HC...
> Subject: [68HC12] Flash programming?
>
> Hi,
>
> I am in the process of writing my bootloader in "C" using
imageCraft and got
> some bump on the road. So, I wondering now that "is it actualy
possible to
> have my bootloader in $C000 - $FFFF Flash location and erase the
the rest of
> the area?". Of cause using the sector erase method. The bootloader
is
> similar to the one described in the AN2400.
>
> Please let me know! > The MCU is 9S12E128 device and it has eight 16K pages. The $C000 -
$FFFF
> Flash location is a page. The flash memory contains 1 block of 128k
bytes
> organized as 1024 rows of 128 bytes. The erase sectior size is 8
rows (1024
> bytes). >
> Yahoo! Groups Links