[Icc-avr] Placing text in an absolute locations in the AT90CAN128

Milender, Jeff Jeff.Milender at goodrich.com
Tue Feb 5 12:44:55 PST 2008


Not sure way but this seems to work if I add the -bfunc_lit:0x100.20000
after "my areas" with the setting still as AT90CAN128.
 
-bmytext:0x50.0x6f -bmytext1:0x70.0xff -bfunc_lit:0x100.0x20000
 
With this in main.c
// FLASH Assignment of Absolute Addresses
// "mytest" is placed at 0x50 in the AVR project file <Other Options>
// -bmytext:0x50.0x6f -bmytext1:0x70.0xff -bfunc_lit:0x100.0x20000
#pragma text:mytext
// located @ 0x050
const INT16U APP_CHECKSUM_VALUE = 0x01234;
// located @ 0x052
const INT16U APP_CRC_VALUE = 0x0ABCD; 
// located @ 0x054 {((0x01FFFF - 0x0100) + 1) + ((0x04F - 0x00) + 1)}
const INT32U APP_LENGTH = 0x01FF50;
#pragma text:text

#pragma text:mytext1
// Located @ 0x070
const INT8U SWPartNumber[24] =  {"GCP787S014-001"};
#pragma text:text


The map is then
Area                               Addr   Size   Decimal Bytes
(Attributes)
--------------------------------   ----   ----   ------- -----
------------
                          mytext   0050   0008 =      8. bytes
(rel,con,rom)

       Addr  Global Symbol
      -----  --------------------------------
       0050  _APP_CHECKSUM_VALUE
       0052  _APP_CRC_VALUE
       0054  _APP_LENGTH
       0058  __mytext_end

Area                               Addr   Size   Decimal Bytes
(Attributes)
--------------------------------   ----   ----   ------- -----
------------
                         mytext1   0070   0018 =     24. bytes
(rel,con,rom)

       Addr  Global Symbol
      -----  --------------------------------
       0070  _SWPartNumber
       0088  __mytext1_end


I guess I will have to get the bootloader updated and try this.
 
Thanks
Jeff
 
Jeff Milender
Systems Engineer
Cargo Systems
Goodrich Interiors
2604 Highway 20 North
Jamestown, ND 58401
Tel: 701-253-7569
jeff.milender at goodrich.com <mailto:jeff.milender at goodrich.com> 
www.goodrich.com <http://www.goodrich.com/> 
 
 
________________________________

From: icc-avr-bounces at imagecraft.com
[mailto:icc-avr-bounces at imagecraft.com] On Behalf Of Richard Man
Sent: Tuesday, February 05, 2008 2:18 PM
To: Discussion list for ICCAVR and ICCtiny Users. You do NOT need
tosubscribe to icc-announce if you are a member of this.
Subject: Re: [Icc-avr] Placing text in an absolute locations in the
AT90CAN128
 
Jeff, you can put things in arbitrary address, or put another way, the
linker doesn't create a hole for you, so 0x100 is already used for text
area purpose.

You should look at the .mp file, and find an address well outside of
your normal usage, then you can use that.

You can also put it at the beginning of your normal flash, after the
vectors, but then you need to change your device setting to Custom and
change the starting address accordingly.

Hope this helps.

At 11:17 AM 2/5/2008, Milender, Jeff wrote:



I'm sure that this has been covered here but I couldn't find anything in
the archives.
 
I'm using ICCAVR 7.00, and my processor is an AT90CAN128
 
How do I go about placing a const String into Flash at an absolute
location?
 
In the example below I am trying to place a Software Part Number in
FLASH starting at address 0x0100. 
 
Here is what I thought would work but I get an error message "Code
address 0x100 already contains a value"
 
#pragma text :mytext
const INT8U SWPartNumber[ 24 ] =   { "GCP787S014-001" } ;
#pragma text :text
 
With the following in the Project Options <Other Options> set to:
-bmytext:0x100
 
Thanks
Jeff

 
// richard (This email is for mailing lists. To reach me directly,
please use richard at imagecraft.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dragonsgate.net/pipermail/icc-avr/attachments/20080205/b4e2df28/attachment-0001.html


More information about the Icc-avr mailing list