Firmware Operation; Avr Flash Memory Organization; The Bootloader Key; Realtime Requirements - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

7.3 Firmware Operation

The V-USB firmware is described well on the Objective Development's website
5
. Here we
cover just a few important points.

7.3.1 AVR Flash Memory Organization

Like most modern Microcontrollers, the AVR's built-in program is stored in Flash memory
and like Flash storage, individual bits can be changed from 1s to 0s, but must be erased
back to 1s in larger sectors (of 128bytes on FIGnition's firmware).
Fig 7.4
The Flash firmware is addressed as memory, not storage, so we don't shift blocks around.
Instead, we replace the entire flash memory in one go: erasing all of it, then writing a
whole, new firmware image to it.
Because the USB upgrade firmware also runs from the AVR's flash memory; we need to
protect it so that it doesn't get erased along with the firmware it's trying to upgrade. The
design of the AVR allows a separate (2Kb or 4Kb) region of Flash especially for this pur-
pose. This region is protected and also allows the bootloader to continue executing while
the other area of Flash is being erased or programmed.

7.3.2 The Bootloader Key

When FIGnition boots up, it starts running the bootloader first. This is a configuration set-
ting for the AVR. V-USB expects an input pin to be held low on bootup if the bootloader is
to be run, otherwise it jumps to the main firmware. This means it's possible to fix a failed
firmware upgrade, because the bootloader is in control to begin with.
FIGnition sets up both port C and port D at the beginning of the bootloader so that SW1 on
the keypad, rather than a separate pin, acts as the bootloader key.

7.3.3 Realtime Requirements

V-USB is an impressive piece of software because it allows an ordinary AVR microcontrol-
ler to function as a low-speed USB device. Low-speed USB is still very fast for the AVR, at
1.2Mbits/s and so the V-USB had to be designed to run as quickly as possible with the
5
http://vusb.wikidot.com/

Advertisement

Table of Contents
loading

Table of Contents