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

Where to buy

Find the right distributor for our modules, components and finished products in your region!

Where to buy

Stay up to date and subscribe to our newsletter!

The EnOcean newsletter informs you regularly about exciting projects in the areas of IoT and smart buildings as well as current events and new products.

Subscribe now

More EnOcean

EnOcean Alliance
EnOceanSpaces
Easyfit by EnOcean

Visit us

© 2024 EnOcean GmbH. All rights reserved.

Contact