SNAP Flash Configuration
A system based on the SNAP chipset needs to have a certain configuration loaded in the read-only part of its serial flash memory in order to be able to start up and begin communicating on its serial port.
When purchasing a new SNAP module, this configuration is already present in the flash memory. This document only concerns customers who build their own designs based on the SNAP chipset, rather than use the SNAP module. Loading of the initial flash memory configuration should not be confused with loading of firmware; the latter can be done over a serial port and will still be necessary after loading the initial configuration.
There are two ways to get the initial configuration into flash, as described below. In any case, the snap_setup.zip package must be downloaded from the download area and extracted.
1 Configuring flash before soldering it to the board
The flash memory device can be configured prior to soldering it to the circuit board. This can be done using a device programmer.
In the snap_setup.zip package there is a file called flash.dat. This is a binary image file that contains the first 257 512-byte pages of the SNAP flash configuration, corresponding to the read-only portion of the flash device plus one 512-byte block in the writeable portion.
This file must be read into the device programmer so it can be downloaded into flash devices. In order to do so, the file must probably be modified first, even if the device programmer supports binary files as input. The reason for this is that the flash device has pages that are 528 bytes long, while the flash.dat file contains a consecutive sequence of 512-byte pages. This means that 16 bytes of dummy data has to be inserted between each 512-byte data chunk from the flash.dat file.
The above assumes that the flash device used is the same as on the SNAP module, the 16-Mbit AT45161B. If another device is used, with another page size, the procedure above must be modified accordingly. For instance a 64-Mbit AT45DB642 has 1056-byte pages, so in that case 32 bytes of dummy data has to be inserted between each 1024-byte block from flash.dat.
2 Configuring flash after soldering it to the board
This is the preferred method, but it requires the SNAP-IDE. The snap_setup.zip package contains an Imsys Developer project that can be used to download the configuration into the flash memory, assuming the system has a 10-pin connector to connect the trace adapter that comes with the SNAP-IDE.
Just connect the ready-built system a PC running Imsys Developer using the trace adapter and run the snap_setup project. Certain test will be run on the system, and the flash contents will be downloaded from the flash.dat file. Note that the write-protect feature of the flash memory must be disabled to be able to download into the read-only portion of flash. This is done by connecting pin 8 in the 10-pin trace adapter connector to high level.
2.1 Command line options
There are a few command line options to the snap_setup project:
-t | Skip tests. There is a hardware test function in the snap_tst.c file, setting this switch will disable calling it. This test is made for a SNAP module in a Taylec TutorIO socket board, so it probably won’t work right away with a customized system, but this is a good place to put production test routines. |
-d | Force use of default MAC address. Will use a default value as Ethernet MAC address/serial number, rather that reading a value from a MAC server. |
-e | No Ethernet. If the system has no Ethernet interface, this switch can be used to disable all use of Ethernet. This will also mean that the default MAC address must be used (only used as serial number in that case). |
-5 | No 5V components. Use this switch if the system does not contain any 5V circuits (1-wire and CAN), this will disable tests of these parts. |
-m | Set default MAC address. Must be followed by a MAC address in the form of six hexadecimal bytes separated by colons (-m 00:0B:B9:00:00:00). This address will be used if the MAC server cannot be contacted, or is the –d switch is set. If this option is not used, the default MAC address will be 00:0B:B9:FF:FF:FF. |
2.2 The MAC server
Included in the snap_setup package is a PC program (Windows only) called MACServer.exe. This is a simple server that can be used to hand out unique MAC addresses to SNAP based systems that are configured with the snap_setup IDE project. When this server is running on the same network as the system running snap_setup, a unique MAC address will be stored in each system configured.
The MAC server hands out six-byte MAC addresses. The three most significant bytes are always zero, and are replaced by the snap_setup program to the three most significant bytes of the MAC_ADDRESS define. These bytes should be changed to the OUI (Organization Unique Identifier) of the organization that owns the SNAP based design, if appropriate. Do not use Imsys Technologies OUI (00:0B:B9) in production systems without an agreement from Imsys to do so, or you might cause address clashes with SNAP modules or other SNAP based custom systems.
The three least significant bytes from the MAC server are taken from the mac_ctr.txt file, and are incremented by one every time an address is handed out. The mac_ctr.txt file can be modified by hand at any time to start a new address range.
The network settings defines at the beginning of the snap_setup.c file must be modified to values appropriate for the network at hand, otherwise the communication with the MAC server will not work.

