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

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.