Storing application calibration info to CFG Area

This article applies to:
DolphinAPI

QUESTION

I have some application specific calibration information and I don’t want to loose them when re-flashing my application. Where to store it?

ANSWER

You can store it in the user part of the CFG area (between the address 0x80 – 0xFF counted relative from the PAGE start). The API does not provide write access to the CFG area therefore make sure to use the object attached to this note: FLASH_WRITE

To use the object you need to specify in your source code the following function:

//---------------------------------------------------------------------------------------------
//! \\brief  Writes a buffer to the flash when the program is executed from XRAM
//! 
//! Description: This function writes a buffer with given size to an address.
//!              
//!
//! \\param u8Buffer      Pointer to a data buffer in XRAM or IDATA or DATA
//! \\param u16Addr       Address to write the data to
//! \\param u8Size        Size of the data buffer
//! \\return u8Err        1-operation failed. 0-success
//---------------------------------------------------------------------------------------------
uint8 FLASH_CONTROL_write_buffer_XRAM(const uint8 *u8Buffer, uint16 u16Addr, uint8 u8Size);

EXAMPLE CODE:
This example sotres the u16CfgValue in configuration area to the 0x80 address.

  uint16 u16CfgValue;
 
 
  uint8 u8Result; 
 
  u8Result = FLASH_CONTROL_write_buffer_XRAM(&u16CfgValue, CFG_ADDR+0x80, sizeof(u16CfgValue)-1);

FAQ Single Template

EnOcean Produkte kaufen

Finden Sie den richtigen Händler für unsere Module, Komponenten und Endprodukte in Ihrer Region!

EnOcean Produkte kaufen

Bleiben Sie auf dem Laufenden mit dem EnOcean-Newsletter

Der EnOcean-Newsletter informiert Sie regelmäßig über spannende Projekte aus den Bereichen IoT und Smart Building sowie über aktuelle Veranstaltungen und neue Produkte.

Jetzt abonnieren

Mehr von EnOcean

EnOcean Alliance
EnOceanSpaces
Easyfit by EnOcean

Besuchen Sie uns

© 2024 EnOcean GmbH. Alle Rechte vorbehalten.

Kontakt