luben111
Advanced Member level 1
Hello,
I can't realize how to define persistent variables (that will be not reset after power up) in IAR compiler for AVR.
What I found in the manual is to use __no_init keyword before the definition of variable.
So...
__no_init char my_var;
should be declared like persistent variable.
When I compile the project I don't get errors, but when I link it I got the following:
Error[e16]: Segment NEAR_N (size: 0x1 align: 0) is too long for segment definition. At least 0x1 more bytes needed. The problem occurred while processing the segment placement command "-Z(DATA)NEAR_N=_..X_EXT_NV_BASE-_..X_EXT_NV_END", where at the moment of placement the available memory ranges were "-none-"
Please, can you explain what I'm doing wrong? I will be very thankful for any help, because I need badly to finish one project where I hav eto define persistent variable.
best regards
Luben
I can't realize how to define persistent variables (that will be not reset after power up) in IAR compiler for AVR.
What I found in the manual is to use __no_init keyword before the definition of variable.
So...
__no_init char my_var;
should be declared like persistent variable.
When I compile the project I don't get errors, but when I link it I got the following:
Error[e16]: Segment NEAR_N (size: 0x1 align: 0) is too long for segment definition. At least 0x1 more bytes needed. The problem occurred while processing the segment placement command "-Z(DATA)NEAR_N=_..X_EXT_NV_BASE-_..X_EXT_NV_END", where at the moment of placement the available memory ranges were "-none-"
Please, can you explain what I'm doing wrong? I will be very thankful for any help, because I need badly to finish one project where I hav eto define persistent variable.
best regards
Luben