Flasher - Background information
This chapter provides background information about flash programming in general.
Flash programming
Flasher comes with a DLL, which allows - amongst other functionalities - reading and writing RAM, CPU registers, starting and stopping the CPU, and setting breakpoints.
How does flash programming via Flasher work?
This requires extra code. This extra code typically downloads a program into the RAM of the target system, which is able to erase and program the flash. This program is called RAM code and "knows" how to program the flash; it contains an implementation of the flash programming algorithm for the particular flash. Different flash chips have different programming algorithms;the programming algorithm also depends on other things, such as endianess of the target system and organization of the flash memory (for example 1 * 8 bits, 1 * 16 bits, 2 * 16 bits or 32 bits). The RAM code requires data to be programmed into the flash memory. The data is supplied by downloading it to RAM.
Data download to RAM
The data (or part of it) is downloaded to another part of the RAM of the target system. The Instruction pointer (PC) of the CPU is then set to the start address of the Ram code, the CPU is started, executing the RAM code. The RAM code, which contains the programming algorithm for the flash chip, copies the data into the flash chip. The CPU is stopped after this. This process may have to be repeated until the entire data is programmed into the flash.
Available options for flash programming
In general, there are two possibilities in order to use Flasher for flash programming:
- Using Flasher stand-alone to program the target flash memory (stand-alone mode)
- Using Flasher in combination with J-Flash to program the target flash memory (Flasher in "PC-based mode")
Using Flasher in stand-alone mode
In order to use the Flasher in stand-alone mode, it has to be configured first. For more information about how to setup Flasher for using in "stand-alone mode", please refer to Setting up Flasher for stand-alone mode.
J-Flash - Complete flash programming solution
J-Flash is a stand-alone Windows application, which can read / write data files and program the flash in almost any ARM system. For more information about J-Flash please refer to the J-Flash User Guide, which can be downloaded from our website http://www.segger.com.
How does the universal flash programming work?
In universal flash programming mode, the flasher typically communicates with a boot loader running on the device using a vendor specific protocol, rather than using the debug interface.
Universal flash programming is available only for stand-alone mode.