13
6174B–ATARM–07-Nov-05
AT91FR40162S Preliminary
6.7
AT91 Flash Memory Uploader (FMU) Software
All Flash-based AT91 devices are delivered with pre-programmed software called the AT91
Flash Memory Uploader, which resides in the first sector of the embedded Flash. The Flash
Memory Uploader allows programming to the embedded flash through a serial port. Either of the
on-chip USARTs can be used by the Flash Memory Uploader. The purpose of the AT91 Flash
Memory Uploader is to provide a Flash programming solution during small and medium produc-
tiion. The FMU is “one-time usable”. This means that once the customer’s code is written in
sector 0 of the Flash, the FMU is overwritten. If IAP functionality is needed, customers need to
use the JTAG port or implement their own boot loader with IAP capability.
Figure 6-1.
Flash Memory Uploader
6.7.1
Flash Memory Uploader Operations
The Flash Memory Uploader requires the encapsulated Flash to be used as the AT91FR40162S
boot memory and a valid clock to be applied to MCKI. After reset, the Flash Memory Uploader
immediately recopies itself into the internal SRAM and jumps to it. The following operation
requires this memory resource only. External accesses are performed only to program the
encapsulated Flash.
When starting, PIO input change interrupts are initialized on the RXD lines of both USARTs.
When an interrupt occurs, a Timer Counter channel is started. When the next input change is
detected on the RXD line, the Timer Counter channel is stopped. This is how the first character
length is measured and the USART can be initiated by taking into account the ratio between the
device master clock speed and the actual communication baud rate speed.
The Programming System, then, can send commands and data following a proprietary protocol
for the Flash device to be programmed. It is up to the Programming System to erase and pro-
gram the first sector of the Flash as the last step of the operation, in order to reduce, to a
minimum, the risk that the Flash Memory Uploader is erased and the power supply shuts down.
AT91R40008
USART0
USART1
Flash Memory
AT91FR40162S
Target System
NCSF
NCS0
Programming System
Serial
Port
RS232
Driver
RXD0
RXD1