On 19 May 2012 05:30, Hanen Rekik <[email protected]> wrote: > Hi, > I use TOS 2.1.1 and I am trying to read/write flash memory in tinyos > application. > I included the following head in my source: #include <avr/pgmspace.h> > then, to store the data in flash: > unsigned char number[] PROGMEM = { 31, 0, 6, 107, 2, 6, 116} > But I have this error : error: avr/pgmspace.h: No such file or directory.
Hi there, You don't mention what type of mote you're using, so I can't give you any specifics, but: - Only motes based on AVR chips will have avr/pgmspace.h available. This would be motes like the micaz, but not the telosb. - The header file avr/pgmspace.h comes from your avr-libc package. Make sure you have a sufficiently recent version of it (I don't know when it was introduced, sorry). - Tagging things as PROGMEM only allows you to place constants into program memory, it does not work for variables since AVR uses a Harvard architecture (separate ROM/RAM address spaces). - Depending on what you're trying to accomplish, you might want to look at using the TinyOS interfaces BlockRead/Write, ConfigStorage, or LogStorage. TEP 103 has good information on these (http://www.tinyos.net/tinyos-2.1.0/doc/html/tep103.html). Regards, /Johny -- Johny Mattsson Senior Software Engineer DiUS Computing Pty. Ltd. where ideas are engineered _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
