[Tinyos-help] program memory v data memory

Neil Hancock neilh10tos at biomonitors.com
Mon Mar 28 14:41:21 PST 2005


I'm having a bit of an issue with the separated data and program space of
the ATmega128.
The issues is how to get constants/tables and const strings in program
memory and not in data memory.

Having 128K flash, and 4K ram in an ATMega128 does mean that the ANSI 'C'
concept of consts in data memory is a tiny bit of a problem.

'C' doesn't overload to figure out what it should do between a const program
memory and data memory, I'm trying to use some of the concepts/hacks from
AVR-Lib, which uses macros.
  *( http://savannah.nongnu.org/download/avr-libc/ )->
(avr-libc-1.2.3.tar.gz)-> pgmspace.h

nesC isn't very happy with (const char PROG_MEM *) but only warns and
doesn't reject it. However compiling with "make pc" does cause it to break
the simulator which isn't very useful.

Anybody coming up with an easier solution in nesC for the ATmega128.



More information about the Tinyos-help mailing list