avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] ROM data and far and huge ptrs


From: Baffaut Pierre-antoine
Subject: [avr-gcc-list] ROM data and far and huge ptrs
Date: Fri, 9 Apr 2004 18:34:50 +0200

Hello,

I work on an embedded SW for ATmega128 (in fact the CAN version AT90CAN128) 
with WINAVR including avr-gcc v3.3.2. In our SW we usually define a lot of 
const data tables containing easily modifiable configuration data. As I'm 
trying to do it with avr-gcc I have a lot of problems :

1/ When defining something like "const unsigned char toto=0x5A", the compiler 
puts it in the .bss RAM segment and generates some code to initialize the 
value. I don't want it to happen so, to spare RAM space, initialization time 
and safety (risk of data corruption by SW bugs). I used the following 
workaround : defining const (ROM) data in one file, and allocating the .data 
segment of this file at a ROM address at link time.
Anyone has a better solution ?

2/ If I declare a pointer (e.g. unsigned char * pXxxx), then avr-gcc generates 
a 16-bits ptr allowing only indirect accesses to the RAM. Usually, on other 
microcontroller, one needs to declare FAR or HUGE pointers so that these 
pointers are actually able to address any memory space (usually through a 
dedicated routine).
Anyone can tell me how to define far or huge pointers, or how to define 
pointers on ROM constants ?

Thanks,

-------------------------------------------------
Pierre-Antoine BAFFAUT   -   SV.P.ED.DT
mailto : address@hidden
tel : (33).561.19.80.68 - fax : (33).561.19.25.80
SIEMENS VDO - SIEMENS Automotive S.A.
BP 1149 - 1 av Paul Ourliac
31036 TOULOUSE Cedex 1
-------------------------------------------------

_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list


reply via email to

[Prev in Thread] Current Thread [Next in Thread]