#include <avr/pgmspace.h> not found ??

#include <avr/pgmspace.h>
fatal error: avr/pgmspace.h: No such file or directory
compilation terminated. :cold_sweat:

What did you expect? You're not using an AVR.

is there then a similar method to keep text out of RAM?

asking in relation to my previous post, if i have a sketch for a webserver and i have 70 to 75 kilo-bytes of text information for all the web pages, is there a way to keep this out of RAM? i know the Due has 96K of RAM, so i will not use all of it, but possibly having 70-75K of RAM being used just for my web-page information, then that kinda sucks...

i have noticed that if i have my web-page information as a char, the compiler does not add that information to the "sketch size" but if i make it a const char then it does. i plan on having all the web-page information be const char since the information should never change while the program is running, but i am not sure if the const char is making it keep it all in flash?

sorry for double post.

No matter what you do the data will be in the flash memory and therefore affect the "sketch size".

However on an ARM constants should not be copied to RAM, have you verified that indeed 75k of RAM is used by the data?


Rob

Graynomad: No matter what you do the data will be in the flash memory and therefore affect the "sketch size".

However on an ARM constants should not be copied to RAM, have you verified that indeed 75k of RAM is used by the data?


Rob

thanks for your response, i would normally agree with you that everything is stored in flash as so should affect the "sketch size" but i experimented a dozen times where i changed a "char" to a "const char" and saw the sketch size increase by the number of words within my variable, and if i change it back from a "const char" to a "char" the sketch size decreases back to the original size. i am not sure if this is a bug in the IDE or not, but i thought i would point it out.

as i am only familar so far with the 8-bit arduinos, i was not aware that ARM processor constants are not loaded to RAM, this is great to know :)

i have "verified" the size by removing all the web-page html code, compiling, recording the sketch size, adding the html code back in, compiling, and comparing the new sketch size.

That's pretty strange, all constant data has to go into flash, there's no other way for it to get into the processor and also to be persistent across power cycling (well except EEPROM but the SAM doesn't have any), so I suspect the change in size is the IDE/GCC not adding up all the right numbers. Unless there's something else afoot I'm not aware of.


Rob

I'm not sure if it is strange - if, say, a global is declared but not given an initial value (other than zero), it will be set to zero by crt0 as part of a memset-like operation, so the actual value won't increase the size of the ROM image. On the other hand, if you give it a value, that value has to be stored explicitly in ROM to be copied to RAM by crt0.

Ah yes, I was assuming initialised variables.


Rob