cancel
Showing results for 
Search instead for 
Did you mean: 

Putting variables in flash?

jonny_bee_henry
Associate II
Posted on January 29, 2007 at 17:04

Putting variables in flash?

3 REPLIES 3
jonny_bee_henry
Associate II
Posted on May 17, 2011 at 09:35

I need to have some variables that retain their values when the CPU is reset or powered off. I'm using the IAR dev. system, and the only way I can see to do it is by using their ''@'' and ''__no_init'' C extensions that allow you to specify an actual memory location for a variable and leave it uninitialized by the compiler. So I tried the following code:

__no_init char NonVolatile[40] @ 0x20000;

....

NonVolatile[0] = 'A';

putchar(NonVolatile[0]);

I have tried a lot of different memory addresses beside 0x20000, with the same results -- the contents of NonVolatile[0] is always a blank (32).

Can anyone tell me how to do this properly?

mark9
Associate II
Posted on May 17, 2011 at 09:35

Read chapter 4 (FMI) in

''UM0233

User manual

STR91x software library''

jonny_bee_henry
Associate II
Posted on May 17, 2011 at 09:35

Lakata -- Thanks.