Pages: [1]   Go Down
Author Topic: #include <avr/pgmspace.h> not found ??  (Read 1321 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24428
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"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.

Offline Offline
Full Member
***
Karma: 3
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Full Member
***
Karma: 3
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8458
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Full Member
***
Karma: 3
Posts: 104
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8458
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 240
Posts: 24428
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8458
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah yes, I was assuming initialised variables.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1]   Go Up
Jump to: