MKW30Z GATT store nonvolatile attribute

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKW30Z GATT store nonvolatile attribute

626 Views
lucianfiran
Contributor V

KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0) IAR 7.5

For my current application I need to store (with some wear and tear mechanism)

the state of an RGB lamp set from a GATT profile attribute.

The function  GattDb_WriteAttribute can be use to store in NVMemory an attribute ?

This define is related to this attribute storage ?

ble_constants.h

/*! Number of bytes reserved for storing application-specific information about a device */
#define gcReservedFlashSizeForCustomInformation_c (50)

Thank you,

Lucian

Labels (1)
Tags (4)
1 Reply

387 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Lucian,

 

In the Connectivity Software, attributes are stored in RAM so they can be modified at application time. Initially, the value of these attributes are loaded with the values you specified in the gatt_db file, but you can also initialize them with a different value when the service is started.

 

On POR or exit of any low power mode that does not retain RAM, any value previously written to these attributes is lost. In order to keep them you will need to reserve a section of FLASH and backup the attribute values there.

 

The Connectivity Framework Reference Manual (CONNFWKRM) in the section 3.5 has information on the Flash Management that includes some APIs to store/get data in FLASH.

 

Saludos

 

Santiago