NHS3100 mods : storage

cancel
Showing results for 
Search instead for 
Did you mean: 

NHS3100 mods : storage

Jump to solution
68 Views
SnoZek
Contributor II

Hello,

 

i'm trying to store data in EEPROM and i found the mod storage which look convenient to use.

I have few questions about this :

- If i want to reset the counter of Storage_GetCount() and the index, should i have to do a Storage_Reset(false) ?

- I want to store signed data but in the function Storage_Write in storage.c it accept only unit8_t should i change STORAGE_SIGNED and STORAGE_TYPE ? (if i do this i still have an warning of argument differ in signedness)

I would be grateful if you could help me,

thank you for your time and yours answers,

Yvan

0 Kudos
1 Solution
58 Views
driesmoors
NXP Employee
NXP Employee

Hi,

 

Yes, you can use the storage module for this.

The only way to clear the old data and start anew is by calling Storage_Reset. If you're sure never to use flash, you can set bool checkFlash to false.

 

The storage module is influenced at compile time by defines that you add to your applications app_sel.h header file. There is normally never a need to change any code in storage.c, storage.h and storage_dft.h.

The demo application app_demo_dp_tlogger stores signed data - temperatures - using the storage module. These defines should do the trick:

#define STORAGE_TYPE int16_t /* or whatever signed type you need */
#define STORAGE_SIGNED 1

 

You may also want to set the size of one sample, to avoid storing bits that are never used:

#define STORAGE_BITSIZE 11

After that, there should be no warnings when building. If you still see them, can you post your changes and your warning here?

 

Best,
Dries.

 

View solution in original post

0 Kudos
1 Reply
59 Views
driesmoors
NXP Employee
NXP Employee

Hi,

 

Yes, you can use the storage module for this.

The only way to clear the old data and start anew is by calling Storage_Reset. If you're sure never to use flash, you can set bool checkFlash to false.

 

The storage module is influenced at compile time by defines that you add to your applications app_sel.h header file. There is normally never a need to change any code in storage.c, storage.h and storage_dft.h.

The demo application app_demo_dp_tlogger stores signed data - temperatures - using the storage module. These defines should do the trick:

#define STORAGE_TYPE int16_t /* or whatever signed type you need */
#define STORAGE_SIGNED 1

 

You may also want to set the size of one sample, to avoid storing bits that are never used:

#define STORAGE_BITSIZE 11

After that, there should be no warnings when building. If you still see them, can you post your changes and your warning here?

 

Best,
Dries.

 

View solution in original post

0 Kudos