Program space related
Discussion in "AVR Discussion Forum" started by abbas1707 Jan 17, 2008.
Thu Jan 17 2008, 10:17 am
hello everybody!!
i have some confusion...please help
what happens when i do like this
does all the strings in it get stored to program space or data space?? i read some where dat strings here go to data space... but im not getting it :-s
i have some confusion...please help
what happens when i do like this
char *string_table[] PROGMEM = { "String 1", "String 2", "String 3", "String 4", "String 5" };
does all the strings in it get stored to program space or data space?? i read some where dat strings here go to data space... but im not getting it :-s
Thu Jan 17 2008, 12:16 pm
store them with keyword "const"
const char....
you have already specified PROGMEM so will go to program memory if you are not getting any compiler error.. check the list file if available..
const char....
you have already specified PROGMEM so will go to program memory if you are not getting any compiler error.. check the list file if available..
Wed Jan 23 2008, 01:28 am
Ajay here is some problem
when i do like this
after compiling i get from "map" file
which means it does not store all those strings in program memory.it is just storing that
pointer.
please correct me if im wrong.is there some way to store all strings to program way
Thanx in advance
when i do like this
const char *string_table[] PROGMEM = { "String 1", "String 2", "String 3", "String 4", "String 5" };
after compiling i get from "map" file
*(.progmem*)
.progmem.data 0x00000054 0x4e2 glcdc2.o
0x0000005e font5x8
0x00000054 string_table
0x0000023e font8x8
0x00000536 . = ALIGN (0x2)
0x00000536 __trampolines_start = .
which means it does not store all those strings in program memory.it is just storing that
pointer.
please correct me if im wrong.is there some way to store all strings to program way
Thanx in advance
Wed Jan 23 2008, 10:30 am
while using keil sometimes i use
10 bytes of POINTER data in RAM rest in code section ie. rom
unsigned char code *string_table[] = { "String 1", "String 2", "String 3", "String 4", "String 5" };
10 bytes of POINTER data in RAM rest in code section ie. rom
Powered by e107 Forum System