Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

erasing and programming flash memory in runnning system

1 view
Skip to first unread message

Georg Schmitt

unread,
Sep 10, 2002, 7:53:02 AM9/10/02
to
Hello,

we want to use the 28F128J3 flash memory with an infineon 80C167
microcontroller.
My question is, if it is possible to store the programm in the first
block of the flash memory and to erase und programm the other blocks
while the microcontroller works with the programm in the first block?

Georg

Tauno Voipio

unread,
Sep 10, 2002, 8:03:16 AM9/10/02
to

"Georg Schmitt" <google...@georg-schmitt.de> wrote in message
news:80de58f5.02091...@posting.google.com...

No. The whole chip is unreadable during the programming or erasing phase.
Copy the core of the code (relocating if needed) to RAM and run it from
there.

HTH

Tauno Voipio
tauno voipio @ iki fi


Meindert Sprang

unread,
Sep 10, 2002, 8:39:44 AM9/10/02
to
"Tauno Voipio" <tauno....@iki.fi.SPAMBAIT_REMOVE.invalid> wrote in
message news:8clf9.166$gM5....@read2.inet.fi...

It's even worse: you won't get to the programming or erasing state since the
code fetches screw up the programming sequences.

Meindert

Ken Lee

unread,
Sep 10, 2002, 6:53:02 PM9/10/02
to
On 10 Sep 2002 04:53:02 -0700, google...@georg-schmitt.de (Georg
Schmitt) wrote:

By the way you have phrased the question, the answer is NO. However it
is possible to program the remaining sectors of your Flash in-situ
with the first sector block intact. The way we do it is to have the
embedded application run a bootstrap program in RAM which erases and
programs the remaining sectors. We've done it so that the bootstrap
accepts the new code in Motorola S-Record format via the serial comms.

By running the bootstrap from RAM, the various data signatures that
the Flash requires are not interrupted. However some compromises are
required in the System Architecture. If the chosen micro has a
hard-coded Interrupt Vector Table, which cannot be relocated to RAM,
then the interrupts would have to be disabled during this operation.
Also if you have 100's of Kbytes to program via the serial comms, then
this will take minutes to perform. This implies that the normal
operation of the device would be suspended until the Flash programming
is complete. Also one has to ensure that system integrity services
such that Watchdog timer are properly maintained during the program
operation.

Ken.

+====================================+
I hate junk email. Please direct any
genuine email to: kenlee at hotpop.com

Simon J Fisher

unread,
Sep 11, 2002, 7:25:29 AM9/11/02
to
Don't forget that by running code from RAM you could have an extra
benefit - if the code in the RAM (to programme the flash) is also
loaded via your serial link then not only do you save flash space but
you then have no code in the flash that can change the flash (code
that could get run by accident by software crash etc.)

postm...@noname.com (Ken Lee) wrote in message news:<3d7e722e....@News.CIS.DFN.DE>...

Matthew S. Staben

unread,
Sep 11, 2002, 7:07:37 PM9/11/02
to
postm...@noname.com (Ken Lee) wrote in message news:<3d7e722e....@News.CIS.DFN.DE>...

You might want to get a 8051+CPLD core, or add a CPLD to your
circuitry and use the CPLD to switch memory modes; (1) PSEN = FLASH,
READ/WRITE = XRAM, (2) PSEN = XRAM, READ = XRAM, WRITE = FLASH, (3)
PSEN = XRAM, READ = FLASH, WRITE = XRAM, and PSEN = XRAM, READ/WRITE =
FLASH. This way, you can use these modes to (a) Copy Code to XRAM,
(b) switch to XRAM (I do this by having program memory start at FFFF
and grow downwards, and then copying code into free XRAM -- hence
seamless switching) (c) switch between the other modes as required;
you want to be able to stream data from XRAM to the FLASH, and
vice-versa. You do not want to give up your interrupt vectors; you
want to be able to still use your serial ports, timers, etc. The
other response where Motorola EXORMacs 87 format files could be read
was apt.

FYI, some of the more advanced Dallas CPUs (eg, 80C490?) allow the
processor to run code in its internal XRAM for the duration of a FLASH
write cycle. You can't execute code from the FLASH (ie, PSEN=FLASH)
while the FLASH pins are toggling as it saves its sector data. We've
found that using a CPLD possibly may be the most elegant method
available for low-cost CPUs, and may allow the most secure environment
in which to operate.

Matt
m00...@SkpAMGuardatt.net

Luba Voronova

unread,
Sep 11, 2002, 7:26:03 PM9/11/02
to
Check "MSP430 Flash Self-Programming Technique"
http://www-s.ti.com/sc/psheets/slaa103/slaa103.pdf

L.


Nick Chapple

unread,
Sep 12, 2002, 9:00:32 AM9/12/02
to
I never figured out how to do this with 28Fxxx memories, but we now
use a C167 with an ST Microelectronics PSD954 flash device - this is a
combined Flash and RAM device with the Flash divided into two areas,
one for the main app. and one for the reprogramming algorithm.

Karen and Stephane

unread,
Sep 12, 2002, 8:31:43 PM9/12/02
to
If you can use a different flash, AMD has some Simultaneous Read/Write flash

http://www.amd.com/us-en/FlashMemory/ProductInformation/0,,37_1447_1453,00.html

0 new messages