6.3 Configuration File
The configuration file contains a list of parameters, which are used to configure the project. The parameters are described in the following table.
Parameter | Description | Default | Required |
---|---|---|---|
PAGE_SIZE | Size of AVR Flash page in decimal bytes. This parameter is part dependent. See the data sheet. | N/A | Yes |
KEY1 | First part (128-bit) of the encryption key in hex. Should be 16 random bytes, with odd-parity bits inserted after every 8th bit, making a total of 18 bytes. | None: No encryption | No, but strongly recommended |
KEY2 | Second part (64-bit) of the encryption key in hex. Should be eight random bytes, with odd-parity bits inserted after every 8th bit, making a total of nine bytes. If omitted, AES128 will be used. | None: Use AES128 | No, but recommended |
KEY3 | Third part (64-bit) of the encryption key in hex. Should be nine random bytes, with odd-parity bits inserted after every 8th bit, making a total of nine bytes. If omitted AES128 or AES192 will be used. | None: Use AES128 or AES192 | No, but recommended |
INITIAL_VECTOR | Used for chaining cipher blocks. Should be 16 random bytes in hex. | 0 | No, but strongly recommended |
SIGNATURE | Frame validation data in hex. This can be any four bytes, but it is recommended that the values are chosen at random. | 0 | No |
ENABLE_CRC | Enable CRC checking: YES or NO. If enabled, the whole application section will be overwritten and the application must pass a CRC check before it is allowed to start. | No | No, but recommended |
MEM_SIZE | Size of application section in target AVR (in decimal bytes). | N/A | Yes, if CRC is used |
The configuration file can be given any valid file name. The name is later
given as a parameter to the application that will create the project files. Below is a
sample configuration file for the ATmega328PB. The KEY1 parameter is an example 128-bit
key (hex 0123456789ABCDEF0123456789ABCDEF) with parity bits
inserted.
PAGE_SIZE = 128
MEM_SIZE = 30720
CRC_ENABLE = YES
KEY1 = EC38ECC4C11DBC16151A5E346A872AADAD36
INITIAL_VECTOR = F24D994D5DD3E9F1EEE897616C425028
SIGNATURE = 89DBF334
Some of the parameters cannot be set without specific knowledge of the target AVR. The following table summarizes the features of some present AVR microcontrollers with bootloader functionality. For devices not present in this table, refer to the data sheet of the device.
Feature | M8 | M16 | M162 | M169 | M32 | M64 | M128 | M328PB | |
---|---|---|---|---|---|---|---|---|---|
Flash Size, bytes | 8192 | 16384 | 16384 | 16384 | 32768 | 65536 | 131072 | 32768 | |
Flash Page size, bytes | 64 | 128 | 128 | 128 | 128 | 256 | 256 | 128 | |
Flash Pages | 128 | 128 | 128 | 128 | 256 | 256 | 512 | 256 | |
BLS (max.), bytes | 2048 | 2048 | 2048 | 2048 | 4096 | 8192 | 8192 | 4096 | |
BLS (max.) Pages | 32 | 16 | 16 | 16 | 32 | 32 | 32 | 32 | |
MEM_SIZE (min.), bytes | 6144 | 14336 | 14336 | 14336 | 28672 | 57344 | 122880 | 28672 | |
PAGE_SIZE, bytes | 64 | 128 | 128 | 128 | 128 | 256 | 256 | 128 |