We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Compiler complains when using that attribute as in example : const char MyText[] __at (0x1F00) = "TEXT AT ADDRESS 0x1F00";
Any idea ?
Not an ARM user, but:
The examples in the manual do not have parens around the address. It may not be a general expression, but rather just a literal.
(Meanwhile, I'll return to the lowly 8051 compiler, where you can have either the _at_ keyword or an initializer, but not both. So this problem can't come up :))
Doesn't work either
"Compiler complains"
In what way, precisely? Post the full text of the message; use copy-and-paste - don't manually re-type it.
with : const char MyText[] __at (0x1F00) = "TEXT AT ADDRESS 0x1F00";
Error: system.c(103): error: #65: expected a ";"
with : const char MyText[] = "TEXT AT ADDRESS 0x1F00";
Error: none
And you're sure that _at_ is supposed to work with initialized variables in your compiler?
The CARM Manual says that it should:
http://www.keil.com/support/man/docs/ca/ca_le_absvarloc.htm
But are you using CARM? or Realview? or GCC?
ya, pretty shure,
Look at this :
RealView Microcontroller Development Kit - Version 3.03a [RealView Compilation Tools V3.0 SP1] The RealView Compilation Tools V3.0 SP1 (which are part of this release) correct several issues with symbolic debugging. Corrected: a potential hang-up problem during Flash download or program load process. Added __at keyword that allows to locate constants on absolute addresses.
C Example: The following example will locate a section to address 0x1F00: #include <absacc.h>
const char MyText[] __at (0x1F00) = "TEXT AT ADDRESS 0x1F00"; Assembler Example: In assembler files you may define the location using section names composed of |.ARM.__AT_<addr>|. The following example will locate a section to address 0xFFE0: AREA |.ARM.__AT_0xFFE0|, CODE, READONLY
Check this
Menu => project => Components, Enviroments, books...,
Folders/Extentions
Check the checkbox Use Keil CARM compiler.
It looks like you are using the Realview compiler.
Regards
Luc Vercruysse
Of course I use Realview Compiler, and as pointed out (l ast post) it should work as claimed by Keil in their last release note (I use that version).
Compare that example from the manual with your code, and you might note a difference: they
#include <absacc.h>
but you didn't mention this header anywhere in your posts. It's details like this that I asked you to make sure about.
"Of course I use Realview Compiler"
Why "of course"?
Although you've been asked, you have never explicitly stated which compiler you're using.
Why of course ?
Because of my post on 3-Nov-2006 04:19
Thank you Hans-Bernhard ! You gave the solution !
Regards Viktor