How to place Variables into flash instead of RAM?

Guest #1172220
Rate this post
useful
not useful
well, after a search in the GCC Docs I've found that
"__attribute__ ((section (".text")))" (where ".text" is the sectionname
for my Flashdata)works fine for me. The Compiler issues a warning, but
the Section placement is done correct.

..

LG
Guest #1172221
Rate this post
useful
not useful
Gast wrote:
> well, after a search in the GCC Docs I've found that
> "__attribute__ ((section (".text")))" (where ".text" is the sectionname
> for my Flashdata)works fine for me. The Compiler issues a warning, but
> the Section placement is done correct.

If you link for flash/ROM: did you try just to add const? Works for me.
No need for an attribute.
Guest #1172222
Rate this post
useful
not useful
Martin Thomas wrote:

> If you link for flash/ROM: did you try just to add const? Works for me.
> No need for an attribute.

Hello Martin.

Sure, I tried. It doesn't work for me :( The mapfile shows the Data in
the .data Section and a Adresslookup from running Program does too.
I use CrossStudio for ARM with the GNU-C/C++ 4.1.0. Can you give any
Hint to get it work? Maybe a Linkeroption or something.. Just adding
const keyword for placing such Data into Flash sounds realy good.

Thanks in Advance
Guest #1172223
Rate this post
useful
not useful
It's me again ;)

After a short search if found the Fault on my Side. In the Project
Propertys the Section for constant Data was antered as .data instead of
.rodata.
Dont know how this happens, but it works fine now.

Thanks again

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now