User`s manual

Rabbit 4000 Designer’s Handbook rabbit.com 57
7. The System Identification and User
Blocks
The BIOS supports a System Identification block and a User block. These blocks are placed at the top of
the primary flash memory. Identification information for each device can be placed in the System ID block
for access by the BIOS, flash driver, and users. This block contains specific part numbers for the flash and
RAM devices installed, the product’s serial number, Media Access Control (MAC) address if an Ethernet
device, and so on. The earliest version of the System ID for Rabbit 4000 products is version 4, which is a
mirrored images type.
When mirrored, there are two combined ID/User blocks images placed contiguously at the top of the pri-
mary flash, from the top down as follows: ID “A” + User “A” + ID “B” + User “B.” Ordinarily, only one
of the ID/User blocks images is valid at a time, and the valid ID/User blocks image alternates between “A”
and “B” at each call to the writeUserBlock() function. If both “A” and “B” images are simultane-
ously marked valid, the “A” (topmost) image is taken to be correct. Version 5 ID blocks can be configured
as described above and can also be configured so that the User block is mirrored and the System ID block
is not. If a version 5 ID block is configured so that only the User block is mirrored, the images will be ID +
User “A” + User “B”.
If Dynamic C does not find a System ID block on a device, the compiler will assume that it is a BL1810
(Jackrabbit) board. It is recommended that board designers include System ID blocks in their products
with unused fields zeroed out to maximize future compatibility.
The System ID block has information about the location of the User block. The User block is for storage of
calibration constants and other persistent data the user wishes to keep in flash. It is strongly recommended
that the User block (using writeUserBlock()) or the Flash File System be used for storage of persis-
tent data. Writing to arbitrary flash addresses at run-time is possible using WriteFlash() or
WriteFlash2(), but could lead to compatibility problems if the code were to be used on a different
type of flash, such as a huge, non-uniform sector size flash.
For example, some flash types have a single sector as big as 128K bytes at the bottom. Writing to any part
of the sector generally requires erasing the whole sector, so a write to store data in that sector would have
to save the contents of the whole sector in RAM, modify the section to be changed, and write the whole
sector back. This is obviously impractical. Although Rabbit does not currently sell products with this type
of flash, there is no guarantee that future flash market conditions won’t require that such flash types be
used. Other board designers may have to deal with the same flash market issues. The User block is imple-
mented in a way that preserves forward binary compatibility with a wide range of flash devices.