Reply by Art Johnson October 7, 20022002-10-07
I would suggest doing the following:

1. Have a look in your Linker Map File, it is in the {Project}\Debug directory,
it's named {Target}.elf.xMAP, where {Target} is the name of your build target
(eg Flash). You can see where the linker has placed your data, and what type of
section it was put into.

2. Make the following setting in {Target}->Target Settings Panels->Code
Generation->M56800 Processor:
- Write constant data to .rodata section
Then change your Linker Command File "linker.cmd" as follows:
.constant_coef:
{
filtercnt.asm (.rodata)
filtercnt.asm (.data)
} > .xConstFlash
This works for us in all our applications.

Regards,

Art Johnson
Senior Systems Analyst
PMC Prime Mover Controls Inc.
3600 Gilmore Way
Burnaby, B.C., Canada
V5G 4R8
Phone: 604 433-4644
FAX: 604 433-5570
Email:
http://www.pmc-controls.com
-----Original Message-----
From: ljube20022000 [mailto:]
Sent: Monday, October 07, 2002 7:30 AM
To:
Subject: [motoroladsp] Linking constant to x flash Hi,
I am trying to link constant coefficients that i declared in my
filtercnt.asm file to x.flash between locations 0x2000 and 0x200A. I
am using this constants in interrupt service routine. All my other
initilaized data from my main.c file is linked at address location
0x200F. After linking I got FFFF between 0x2000 and 0x200A. I would
appreciate any help with this. I listed linker.cmd and filtercnt.asm
file.

MEMORY {
.isr (RWX) : ORIGIN = 0x0004,
LENGTH = 0x7C
.text (RWX) : ORIGIN = 0x1000,
LENGTH = 0x00000000
.xConstFlash (RW) : ORIGIN = 0x2000, LENGTH = 0xA
.boot (RWX) : ORIGIN = 0xF800,
LENGTH = 0x00000800
.data (RW) : ORIGIN = 0x200F,
LENGTH = 0x00000000
}

FORCE_ACTIVE {FIntVec56807}
FORCE_ACTIVE {FResetVec}

SECTIONS {
.reset_vectors :
{
ResetVec.c (.text)
} > .boot

.interrupt_vectors :
{
IntVec.c (.text)
} > .isr

.constant_coef:
{
filtercnt.asm (constant.data)
} > .xConstFlash

.main_application :
{
# .text sections

* (.text)
* (rtlib.text)
* (fp_engine.text)
* (user.text)
} > .text

.main_application_data :
{
# .data sections

* (.data)
* (fp_state.data)
* (rtlib.data)

# .bss sections

* (rtlib.bss.lo)
* (.bss)
} > .data
}
; filtercnt.asm
section constant
org X:
; xdef coefp,cpsize
;coefp
;-----------------------------
dc 0.00004382519631
dc -0.9866725194468
dc 0.00008765039263
dc 0.48684782023210
dc 0.00004382519631

;lowcp dc 0.5 ; memory filler

;cpsize equ lowcp-coefp+1
endsec
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/motoroladsp

More Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/


Reply by ljube20022000 October 7, 20022002-10-07
Hi,
I am trying to link constant coefficients that i declared in my
filtercnt.asm file to x.flash between locations 0x2000 and 0x200A. I
am using this constants in interrupt service routine. All my other
initilaized data from my main.c file is linked at address location
0x200F. After linking I got FFFF between 0x2000 and 0x200A. I would
appreciate any help with this. I listed linker.cmd and filtercnt.asm
file.

MEMORY {
.isr (RWX) : ORIGIN = 0x0004,
LENGTH = 0x7C
.text (RWX) : ORIGIN = 0x1000,
LENGTH = 0x00000000
.xConstFlash (RW) : ORIGIN = 0x2000, LENGTH = 0xA
.boot (RWX) : ORIGIN = 0xF800,
LENGTH = 0x00000800
.data (RW) : ORIGIN = 0x200F,
LENGTH = 0x00000000
}

FORCE_ACTIVE {FIntVec56807}
FORCE_ACTIVE {FResetVec}

SECTIONS {
.reset_vectors :
{
ResetVec.c (.text)
} > .boot

.interrupt_vectors :
{
IntVec.c (.text)
} > .isr

.constant_coef:
{
filtercnt.asm (constant.data)
} > .xConstFlash

.main_application :
{
# .text sections

* (.text)
* (rtlib.text)
* (fp_engine.text)
* (user.text)
} > .text

.main_application_data :
{
# .data sections

* (.data)
* (fp_state.data)
* (rtlib.data)

# .bss sections

* (rtlib.bss.lo)
* (.bss)
} > .data
}
; filtercnt.asm
section constant
org X:
; xdef coefp,cpsize
;coefp
;-----------------------------
dc 0.00004382519631
dc -0.9866725194468
dc 0.00008765039263
dc 0.48684782023210
dc 0.00004382519631

;lowcp dc 0.5 ; memory filler

;cpsize equ lowcp-coefp+1
endsec