Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

not initializeable variable in AVR IAR C

Status
Not open for further replies.

7rots51

Advanced Member level 4
Joined
May 17, 2002
Messages
1,183
Helped
25
Reputation
50
Reaction score
12
Trophy points
1,318
Activity points
9,636
Hello

How we can define a not initialized variable in IAR AVR C compiler?

I want to have a variable in AVR internal SRAM that the program does not reset it to 0 at startup.
 

Define your variable with __no_init prefix.
 

When I use __no_init like as:

__no_init INT16U SendOkCounter,SendFailCounter;

the compiler give this error:

Error[e16]: Segment NEAR_N (size: 0x4 align: 0) is too long for segment definition. At least 0x4 more bytes needed.
The problem occurred while processing the segment placement command
"-Z(DATA)NEAR_N=_..X_EXT_NV_BASE:+_..X_EXT_NV_SIZE", where at the moment of placement the available
memory ranges were "DATA:10ff--1"


How I can solve the problem?


note:
typedef unsigned short INT16U; /* Unsigned 16 bit value */
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top