DSPRelated.com
Forums

Running from flash with DSP56F827

Started by atid2 February 20, 2003
Hi All,

This is a very desperate call for help!!!
I am struggling for several month now to run my software from the
flash.
I am using the flash for program memory and the internal and
external X RAM memory.
At first I could run it from the flash but not after power down.
Then, after Metrowerks support offered to copy all my initialized
data from ROM to RAM I changed the LCF (see below). But then nothing
worked - before or after power down.
When I run it from the debugger nothing makes sense.
I'm getting very close to my deadline and I am pretty desperate.
Please have a look at my LCF and tell me what you thing is the
problem.

MY LCF
============
# Changed by Ari Tidhar - 23/10/2002
#********************************************
# Linker.cmd file for DSP56827EVM
# using internal & external data memory ( EX = 0, Boot
Mode 0A )
# DSP56F827 does not have a dedicated Boot Flash
Section. .bBootFlash section
# is part of .pFlash2.

#********************************************************************
***********
MEMORY {

.pInterruptVector (RX) : ORIGIN = 0x0000, LENGTH = 0x0086
.pFlash (RX) : ORIGIN = 0x0086, LENGTH =
0x7B7A
.pIntRAM (RWX) : ORIGIN = 0x7C00, LENGTH =
0x0400
.pIntRAM_Mirror (RWX) : ORIGIN = 0x7C00, LENGTH = 0x0400

.pFlash2 (RX) : ORIGIN = 0x8000, LENGTH = 0x7800
.pBootFlash (RX) : ORIGIN = 0xF800,
LENGTH = 0x0800 #Part of pFlash2

.xAvailable (RW) : ORIGIN = 0x0000, LENGTH = 0x0030
.xCWRegisters (RW) : ORIGIN = 0x0030, LENGTH = 0x0010
.xStack (RW) : ORIGIN = 0x0040, LENGTH =
0x0FC0
.xPeripherals (RW) : ORIGIN = 0x1000, LENGTH = 0x0400
.xReserved1 (R) : ORIGIN = 0x1400, LENGTH = 0x0C00
.xFlash (R) : ORIGIN = 0x2000, LENGTH =
0x1000
.xReserved2 (R) : ORIGIN = 0x3000, LENGTH = 0x1000
.xExtRAM (RW) : ORIGIN = 0x4000, LENGTH = 0xB200
.xExtRAM_Mirror (RW) : ORIGIN = 0x4000, LENGTH =
0xBF80
.xCoreRegisters (RW) : ORIGIN = 0xFF80, LENGTH = 0x0080
}
#********************************************************************
***********

FORCE_ACTIVE {FconfigInterruptVector}

SECTIONS {

.ApplicationInterruptVector :
{
vector.c (.text)

} > .pInterruptVector
#********************************************************************
***********
.ApplicationCode :
{
# Place code into Program Flash 1

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

} > .pFlash
#********************************************************************
***********
.ApplicationCode2 :
{
# Place code into Program Flash 2
# It is necessary to have two Program Flash sections
for the 827
# since the memory map is not continuous from the
first Program Flash
# section to the second.

# Locate C functions by referencing the filename
# Example: Cfilename.c (.text)
# Locate Assembly functions by referencing the
section name
# Example: * (section_name.text)

} > .pFlash2
#********************************************************************
***********
.InitializedConstData :
{
const.c (.data)
appconst.c (.data)

} > .xFlash
#********************************************************************
***********
.InitializedDataForProgramRAM : AT (ADDR(.pFlash) + 1 +
SIZEOF(.pFlash) / 2)
{
# Define variables for C initialization code of
Program RAM data

F_Pdata_start_addr_in_ROM = ADDR(.pFlash) + 1 +
SIZEOF(.pFlash) / 2;

F_Pdata_start_addr_in_RAM = .;
_P_DATA_ADDR = .; # SDK initialized data to be placed into Program RAM

pramdata.c (.data)
F_Pdata_ROMtoRAM_length = . - _P_DATA_ADDR;

} > .pIntRAM_Mirror
#********************************************************************
***********
.DataForProgramRAM :
{
# allocates space for .InitializedDataForPRogramRAM section

. = (ADDR(.pIntRAM_Mirror) + SIZEOF(.pIntRAM_Mirror) / 2) + 1;

# Define variables for C initialization code

F_Pbss_start_addr = .;
_P_BSS_ADDR = .;

# SDK uninitialized data to be placed into Program RAM

pramdata.c (.bss)

F_Pbss_length = . - _P_BSS_ADDR;

} > .pIntRAM
#********************************************************************
***********
.ApplicationInitializedData : AT (ADDR(.pFlash) + 1 + SIZEOF
(.pFlash) / 2 + SIZEOF(.pIntRAM_Mirror) / 2 + 1 )
{
# Define variables for C initialization code

F_Xdata_start_addr_in_ROM = ADDR(.pFlash) + 1 +
SIZEOF(.pFlash) / 2 + SIZEOF(.pIntRAM_Mirror) / 2 + 1;
F_StackAddr = ADDR(.xStack);
F_StackEndAddr = ADDR(.xStack) + SIZEOF
(.xStack) / 2 - 1;

F_Xdata_start_addr_in_RAM = .;
_X_DATA_ADDR = .; # Place rest of the data into External RAM

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

F_Xdata_ROMtoRAM_length = . - _X_DATA_ADDR;

} > .xExtRAM_Mirror
#********************************************************************
***********
.ApplicationData :
{
# allocates space for .ApplicationInitializedData
section

. = (ADDR(.xExtRAM_Mirror) + SIZEOF(.xExtRAM_Mirror) /
2); F_Xbss_start_addr = .;
_X_BSS_ADDR = .;

# .bss sections

* (rtlib.bss.lo)
* (rtlib.bss)
* (.bss)

F_Xbss_length = . - _X_BSS_ADDR; # Copy DATA

} > .xExtRAM
#********************************************************************
*********** FArchIO = ADDR(.xPeripherals);
FArchCore = ADDR(.xCoreRegisters);
}

=============================================

Thank you in advance,
Ari Tidhar