Go Down

Topic: #include <avr/pgmspace.h> not found ?? (Read 2076 times) previous topic - next topic

got_extra

#include <avr/pgmspace.h>
fatal error: avr/pgmspace.h: No such file or directory
compilation terminated.  :smiley-roll-sweat:

AWOL

What did you expect?
You're not using an AVR.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

wallaceb

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

wallaceb

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.

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
Rob Gray aka the GRAYnomad www.robgray.com

wallaceb


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.

Graynomad

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
Rob Gray aka the GRAYnomad www.robgray.com

AWOL

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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Graynomad

Ah yes, I was assuming initialised variables.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up