By Heiko Riessland, Programmierbare Logick & Systeme GmbHedadesignline.com (August 12, 2008)Introduction
A high level of data integrity and data security is essential when using FLASH memory in automotive control units. Indeed, to guarantee this for the entire life cycle of the control unit, attention should be given to a few rules. It is not only the harsh environmental conditions that can cause an end to this endeavor. For those that do not consider, at an early stage, how often and to which purpose a reprogramming of the FLASH content in the phases of production, operation and service takes place can sometimes experience nasty surprises.How does in-system programming of FLASH essentially function?
On-chip FLASH memories are in vogue. At the same time, they first of all require a certain amount of rethinking by the user. To change the content of a FLASH memory certainly requires much more effort than to change the content of a random access memory (RAM). The reason: whereas for the writing of a RAM, a single machine command is sufficient; for FLASH programming a special algorithm, which typically is implemented via special registers, is required. In addition, the FLASH memory must be erased before each reprogramming.
Fundamentally, a FLASH device can be programmed via any target interface, which can read and write registers — for example, programming via JTAG. However, this possibility is in practice hardly ever used because it is simply too slow and inflexible. Nowadays, more often, the algorithm for programming the FLASH is usually downloaded direct in an on-chip RAM of the microcontroller and then also executed in it. With this method, significantly higher speeds can be achieved compared to direct programming via JTAG. This is because typical cyclical register polling by the MCU in the FLASH algorithm can be processed many times faster than via the JTAG connection. An additional advantage of this variant: because it functions independent of the respective target interface the connection can not only be achieved via JTAG, but also - for example - via the CAN bus.
The smallest structural unit of a FLASH memory is the page. It can be programmed at once. Furthermore, a typical on-chip FLASH memory is logically divided into various sectors, whereby the number and size of the sectors are dependent on the microcontroller type. Erasing can only be carried out by sector or also the entire FLASH. Attention should be paid that the execution of the programming routine can not take place in the memory, which is to be programmed.
Click here to read more ...