DolphinV4 API  1.6.1.0
Configuration area (CFG)

Flash page from code addresses 0xFC00 to 0xFDFF where the application can store non volatile information. The configuration area can be always read with the programmer even if the CodeprotectionBit is set.

For instance the application can store firmware specific configuration values.
Upon a Flash erase the configuration area contents is also lost. Therefore prior erasing the Flash EOPX2 always reads out the contents of this area and merges the existing data with the application cfg file. For the exact process see ProgrammingFlow.

The following examples demonstrates how to access a constant stored in the configuration area.

typedef struct
{
// Minimum cycle number of redundant retransmissions \n
// Located in CFG-Area offset 0x00 \n
// Default 20; 0: no redundant retransmission, 1...255 minimum cycle [min]
uint8 u8TCycleMin;
// Maximum cycle number of redundant retransmissions \n
// Located in CFG-Area offset 0x01 \n
// Default 28; 0: no redundant retransmission, 1...255 maximum cycle [min]
uint8 u8TCycleMax;
} CFG_VALUES;
CFG_VALUES code cfg _at_ CFG_ADDR; //allocation of the variable cfg in address 0xFC00. CFG_ADDR specified in EO3100_API.h
void main()
{
//send the API version through uart
uart_sendByte(&cfg.u8TCycleMin);
}

The variable cfg needs to be global and the memory type specifier code is required.

To initialise the constants stored in the configuration area use the postbuild.txt file. The following example code shows how:

setBist
setVersion
#Initialise 16 bytes from address 0xFC00 + 0x0000 offset with the value 0xFF
fillCfg 0x0000, 0x10, 0xFF
#Initialise some CFG area addresses. The value can be expressed in decimal or hexadecimal format
#0xFC00:
writeCfg 0x00,20
#0xFC01:
writeCfg 0x01,28
#0xFC02:
writeCfg 0x02,2
#0xFC03:
writeCfg 0x03,3
#0xFC04:
writeCfg 0x04,0
#0xFC05:
writeCfg 0x05,102
#0xFC06:
writeCfg 0x06 0x00

Be sure to have the postbuild tool script correctly set up. Refer to Post-buildTools.