English
Language : 

AN1496 Datasheet, PDF (13/17 Pages) STMicroelectronics – Flash Programming / Reprogramming
AN1496 - APPLICATION NOTE
3 - EMBEDDED APPLICATION ASPECTS
This chapter advises for embedded applications where the ST10 embedded Flash memory may be the
only non volatile memory available.
Reading the Flash while programming and field reprogramming are the 2 specific points raised by single
chip embedded applications.
3.1 - Reading the Flash While Erasing or Programming
During erasing or programming, the entire Flash is not visible to the CPU, whatever the Flash-block is
erased or programmed. As a consequence on ST10 software :
– During erasing and programming, it is not possible to have access to the interrupt vector table and so
all interrupts shall be disabled.
– Before erasing and programming, a small software loop shall be copied from the Flash to the on-chip
RAM to run the minimum code needed to wait for the end of erasing or programming .
– If code protection is activated, it should be temporary disabled before executing the code copied into the
on-chip RAM.
There are 2 ways to deal with this constraint : one is minimizing the requirements in RAM space used
during erasing/programming and another one is maximizing the programming speed by duplicating all
needed software into the on-chip RAM.
3.1.1 - Minimum Software to be Copied into the On-chip RAM
The minimum software to be copied into the on-chip RAM is :
– Functions sending the erasing and or programming commands to the ST10 embedded Flash,
– Functions polling the Flash status register for completion of the command and for error (see detailled
specification).
Example of usage : This method can be implemented when it is necessary to program and/or erase
some data in the ST10 embedded Flash during normal operation.
3.1.2 - Maximizing Programming Performance at System Level
When the minimum software is copied into the on-chip RAM, during erasing and/or programming, the
CPU cannot run any other software (like communication) during that time.
To maximize programming performance, user could handle the whole part or a part only of the
communication handler. This requires :
– That more software is copied into the on-chip RAM,
– The communication handler is not using interrupts,
– The software loop polling the Flash status register is modified to handle the Communication process.
Example of usage : This method can be implemented when it is necessary to erase and program
(re-program) the whole Flash of the ST10.
3.1.3 - Suspend and Resume Commands
As stand-alone Flash memories, the 0.35µm embedded Flash controller features suspend and resume
commands; this allows to suspend at any time the erasing or the programming process and resume it
later on.
Once suspend command is completed, the ST10 can access to a needed software routine (i.e.
communication driver) which has not been relocated in the on-chip RAM.
Example of usage : the error handler of the communication driver.
Note : the time for which the Flash is not available is unchanged but this gives the possibility to suspend
the process to run specific routines during Flash erasing or programming (ex : communication protocol).
13/17