This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

.ebss段比较大,导致程序无法从flash复制到RAM跑,请问有无好的解决办法。

Flash CMD文件如下:

/*
// TI File $Revision: /main/9 $
// Checkin $Date: August 28, 2007 11:23:38 $
//###########################################################################
//
// FILE: F28335.cmd
//
// TITLE: Linker Command File For F28335 Device
//
//###########################################################################
// $TI Release: DSP2833x Header Files V1.01 $
// $Release Date: September 26, 2007 $
//###########################################################################
*/

/* ======================================================
// For Code Composer Studio V2.2 and later
// ---------------------------------------
// In addition to this memory linker command file,
// add the header linker command file directly to the project.
// The header linker command file is required to link the
// peripheral structures to the proper locations within
// the memory map.
//
// The header linker files are found in <base>\DSP2833x_Headers\cmd
//
// For BIOS applications add: DSP2833x_Headers_BIOS.cmd
// For nonBIOS applications add: DSP2833x_Headers_nonBIOS.cmd
========================================================= */

/* ======================================================
// For Code Composer Studio prior to V2.2
// --------------------------------------
// 1) Use one of the following -l statements to include the
// header linker command file in the project. The header linker
// file is required to link the peripheral structures to the proper
// locations within the memory map */

/* Uncomment this line to include file only for non-BIOS applications */
/* -l DSP2833x_Headers_nonBIOS.cmd */

/* Uncomment this line to include file only for BIOS applications */
/* -l DSP2833x_Headers_BIOS.cmd */

/* 2) In your project add the path to <base>\DSP2833x_headers\cmd to the
library search path under project->build options, linker tab,
library search path (-i).
/*========================================================= */

/* Define the memory block start/length for the F28335
PAGE 0 will be used to organize program sections
PAGE 1 will be used to organize data sections

Notes:
Memory blocks on F28335 are uniform (ie same
physical memory) in both PAGE 0 and PAGE 1.
That is the same memory region should not be
defined for both PAGE 0 and PAGE 1.
Doing so will result in corruption of program
and/or data.

L0/L1/L2 and L3 memory blocks are mirrored - that is
they can be accessed in high memory or low memory.
For simplicity only one instance is used in this
linker file.

Contiguous SARAM memory blocks can be combined
if required to create a larger memory block.
*/


MEMORY
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
//RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */
//RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
RAML0 : origin = 0x008000, length = 0x001000 /* on-chip RAM block L0 */
RAML1 : origin = 0x009000, length = 0x003000 /* on-chip RAM block L1 */
/* RAML2 : origin = 0x00A000, length = 0x001000 /* on-chip RAM block L2 */
/* RAML3 : origin = 0x00B000, length = 0x001000 /* on-chip RAM block L3 */
// RAML4 : origin = 0x00C000, length = 0x003000 /* on-chip RAM block L4 *///keybo
RAML4 : origin = 0x00C000, length = 0x003000 /* on-chip RAM block L4 */
/* RAML5 : origin = 0x00D000, length = 0x001000 /* on-chip RAM block L5 */
/* RAML6 : origin = 0x00E000, length = 0x001000 /* on-chip RAM block L6 */
ZONE0 : origin = 0x004000, length = 0x001000 /* XINTF zone 0 */
// ZONE6A : origin = 0x100000, length = 0x00FC00 /* XINTF zone 6 - program space*///keybo
ZONE6A : origin = 0x100000, length = 0x00FC00 /* XINTF zone 6 - program space*/
ZONE7 : origin = 0x200000, length = 0x100000 /* XINTF zone 7 */
FLASHH : origin = 0x300000, length = 0x008000 /* on-chip FLASH 28335*/
FLASHG : origin = 0x308000, length = 0x008000 /* on-chip FLASH 28335*/
FLASHF : origin = 0x310000, length = 0x008000 /* on-chip FLASH 28335*/
FLASHE : origin = 0x318000, length = 0x000800 /* on-chip FLASH 28335*///keybo
// FLASHE : origin = 0x318000, length = 0x001000 /* on-chip FLASH 28335*/
FLASHD : origin = 0x320000, length = 0x018000 /* on-chip FLASH 28234 28335*/
// FLASHD : origin = 0x319000, length = 0x01F000 /* on-chip FLASH 28234 28335*///keybo
/* FLASHC : origin = 0x328000, length = 0x008000 */ /* on-chip FLASH 28234 28335*/
/* FLASHB : origin = 0x330000, length = 0x008000 */ /* on-chip FLASH 28234 28335*/
FLASHA : origin = 0x338000, length = 0x007F80 /* on-chip FLASH 28234 28335*/
CSM_RSVD : origin = 0x33FF80, length = 0x000076 /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
BEGIN : origin = 0x33FFF6, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
CSM_PWL_ : origin = 0x33FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */
OTP : origin = 0x380400, length = 0x000400 /* on-chip OTP */
ADC_CAL : origin = 0x380080, length = 0x000009 /* ADC_cal function in Reserved memory */

IQTABLES : origin = 0x3FE000, length = 0x000b50 /* IQ Math Tables in Boot ROM */
IQTABLES2 : origin = 0x3FEB50, length = 0x00008c /* IQ Math Tables in Boot ROM */
FPUTABLES : origin = 0x3FEBDC, length = 0x0006A0 /* FPU Tables in Boot ROM */
ROM : origin = 0x3FF27C, length = 0x000D44 /* Boot ROM */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */

PAGE 1 : /* Data Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE0 for program allocation */
/* Registers remain on PAGE1 */

BOOT_RSVD : origin = 0x000000, length = 0x000050 /* Part of M0, BOOT rom will use this for stack */
RAMM0 : origin = 0x000050, length = 0x0003B0 /* on-chip RAM block M0 */
RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
// RAML7 : origin = 0x00F000, length = 0x001000 /* on-chip RAM block L7 */
RAML7 : origin = 0x008000, length = 0x007000 /* on-chip RAM block L7 *///keybo
// ZONE6B : origin = 0x10FC00, length = 0x000400 /* XINTF zone 6 - data space */
ZONE6B : origin = 0x10FC00, length = 0x000400 /* XINTF zone 6 - data space *///keybo

}

/* Allocate sections to memory blocks.
Note:
codestart user defined section in DSP28_CodeStartBranch.asm used to redirect code
execution when booting to flash
ramfuncs user defined section to store functions that will be copied from Flash into RAM
*/

SECTIONS
{

/* Allocate program areas: */
//.cinit : > FLASHD PAGE = 0
.cinit : > FLASHD PAGE = 0//keybo
//.pinit : > FLASHD, PAGE = 0
.pinit : > FLASHD, PAGE = 0//keybo
//.text : > FLASHD PAGE = 0
.text : > FLASHD PAGE = 0
codestart : > BEGIN PAGE = 0

/* ramfuncs : LOAD = FLASHD,//LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
*/
ramfuncs : LOAD = FLASHD,//LOAD = FLASHD,
RUN = RAML0,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0

ramfuncs1 : LOAD = FLASHD,//LOAD = FLASHD,
RUN = RAML1,
LOAD_START(_Ramfuncs1LoadStart),
LOAD_END(_Ramfuncs1LoadEnd),
RUN_START(_Ramfuncs1RunStart),
PAGE = 0

ramfuncs2 : LOAD = FLASHD,//LOAD = FLASHD,
RUN = RAML4,
LOAD_START(_Ramfuncs2LoadStart),
LOAD_END(_Ramfuncs2LoadEnd),
RUN_START(_Ramfuncs2RunStart),
PAGE = 0

csmpasswds : > CSM_PWL_ PAGE = 0
csm_rsvd : > CSM_RSVD PAGE = 0

/* Allocate uninitalized data sections: */
.stack : > RAMM1 PAGE = 1
.ebss : > RAML7 PAGE = 1 //keybo
// .ebss : > FLASHA PAGE = 0
.esysmem : > RAMM1 PAGE = 1

/* Initalized sections go in Flash */
/* For SDFlash to program these, they must be allocated to page 0 */
//.econst : > FLASHD PAGE = 0//keybo
.econst : > FLASHD PAGE = 0
//.switch : > FLASHD PAGE = 0//keybo
.switch : > FLASHD PAGE = 0

/* Allocate IQ math areas: */
IQmath : > FLASHA PAGE = 0 /* Math Code */
IQmathTables : > IQTABLES, PAGE = 0, TYPE = NOLOAD
IQmathTables2 : > IQTABLES2, PAGE = 0, TYPE = NOLOAD
FPUmathTables : > FPUTABLES, PAGE = 0, TYPE = NOLOAD

/* Allocate DMA-accessible RAM sections: */
/* DMARAML6 : > RAML6, PAGE = 1 */

/* Allocate 0x400 of XINTF Zone 6 to storing data */
ZONE6DATA : > ZONE6B, PAGE = 1

/* .reset is a standard section used by the compiler. It contains the */
/* the address of the start of _c_int00 for C Code. /*
/* When using the boot ROM this section and the CPU vector */
/* table is not needed. Thus the default type is set here to */
/* DSECT */
.reset : > RESET, PAGE = 0, TYPE = DSECT
vectors : > VECTORS PAGE = 0, TYPE = DSECT

/* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
.adc_cal : load = ADC_CAL, PAGE = 0, TYPE = NOLOAD

}

/*
//===========================================================================
// End of file.
//===========================================================================
*/

map文件如下

MEMORY CONFIGURATION

name origin length used unused attr fill
---------------------- -------- --------- -------- -------- ---- --------
PAGE 0:
ZONE0 00004000 00001000 00000000 00001000 RWIX
RAML0 00008000 00001000 0000001b 00000fe5 RWIX
RAML1 00009000 00003000 00000000 00003000 RWIX
RAML4 0000c000 00003000 00000000 00003000 RWIX
ZONE6A 00100000 0000fc00 00000000 0000fc00 RWIX
ZONE7 00200000 00100000 00000000 00100000 RWIX
FLASHH 00300000 00008000 00000000 00008000 RWIX
FLASHG 00308000 00008000 00000000 00008000 RWIX
FLASHF 00310000 00008000 00000000 00008000 RWIX
FLASHE 00318000 00000800 00000000 00000800 RWIX
FLASHD 00320000 00018000 00012cc5 0000533b RWIX
FLASHA 00338000 00007f80 0000006b 00007f15 RWIX
CSM_RSVD 0033ff80 00000076 00000076 00000000 RWIX
BEGIN 0033fff6 00000002 00000002 00000000 RWIX
CSM_PWL_ 0033fff8 00000008 00000008 00000000 RWIX
ADC_CAL 00380080 00000009 00000007 00000002 RWIX
OTP 00380400 00000400 00000000 00000400 RWIX
IQTABLES 003fe000 00000b50 00000b50 00000000 RWIX
IQTABLES2 003feb50 0000008c 00000000 0000008c RWIX
FPUTABLES 003febdc 000006a0 00000000 000006a0 RWIX
ROM 003ff27c 00000d44 00000000 00000d44 RWIX
RESET 003fffc0 00000002 00000000 00000002 RWIX
VECTORS 003fffc2 0000003e 00000000 0000003e RWIX

PAGE 1:
BOOT_RSVD 00000000 00000050 00000000 00000050 RWIX
RAMM0 00000050 000003b0 00000000 000003b0 RWIX
RAMM1 00000400 00000400 00000400 00000000 RWIX
DEV_EMU 00000880 00000180 000000d0 000000b0 RWIX
FLASH_REGS 00000a80 00000060 00000008 00000058 RWIX
CSM 00000ae0 00000010 00000010 00000000 RWIX
ADC_MIRROR 00000b00 00000010 00000010 00000000 RWIX
XINTF 00000b20 00000020 0000001e 00000002 RWIX
CPU_TIMER0 00000c00 00000008 00000008 00000000 RWIX
CPU_TIMER1 00000c08 00000008 00000008 00000000 RWIX
CPU_TIMER2 00000c10 00000008 00000008 00000000 RWIX
PIE_CTRL 00000ce0 00000020 0000001a 00000006 RWIX
PIE_VECT 00000d00 00000100 00000100 00000000 RWIX
DMA 00001000 00000200 000000e0 00000120 RWIX
MCBSPA 00005000 00000040 00000025 0000001b RWIX
MCBSPB 00005040 00000040 00000025 0000001b RWIX
ECANA 00006000 00000040 00000034 0000000c RWIX
ECANA_LAM 00006040 00000040 00000040 00000000 RWIX
ECANA_MOTS 00006080 00000040 00000040 00000000 RWIX
ECANA_MOTO 000060c0 00000040 00000040 00000000 RWIX
ECANA_MBOX 00006100 00000100 00000100 00000000 RWIX
ECANB 00006200 00000040 00000034 0000000c RWIX
ECANB_LAM 00006240 00000040 00000040 00000000 RWIX
ECANB_MOTS 00006280 00000040 00000040 00000000 RWIX
ECANB_MOTO 000062c0 00000040 00000040 00000000 RWIX
ECANB_MBOX 00006300 00000100 00000100 00000000 RWIX
EPWM1 00006800 00000022 00000022 00000000 RWIX
EPWM2 00006840 00000022 00000022 00000000 RWIX
EPWM3 00006880 00000022 00000022 00000000 RWIX
EPWM4 000068c0 00000022 00000022 00000000 RWIX
EPWM5 00006900 00000022 00000022 00000000 RWIX
EPWM6 00006940 00000022 00000022 00000000 RWIX
ECAP1 00006a00 00000020 00000020 00000000 RWIX
ECAP2 00006a20 00000020 00000020 00000000 RWIX
ECAP3 00006a40 00000020 00000020 00000000 RWIX
ECAP4 00006a60 00000020 00000020 00000000 RWIX
ECAP5 00006a80 00000020 00000020 00000000 RWIX
ECAP6 00006aa0 00000020 00000020 00000000 RWIX
EQEP1 00006b00 00000040 00000040 00000000 RWIX
EQEP2 00006b40 00000040 00000040 00000000 RWIX
GPIOCTRL 00006f80 00000040 0000002e 00000012 RWIX
GPIODAT 00006fc0 00000020 00000020 00000000 RWIX
GPIOINT 00006fe0 00000020 0000000a 00000016 RWIX
SYSTEM 00007010 00000020 00000020 00000000 RWIX
SPIA 00007040 00000010 00000010 00000000 RWIX
SCIA 00007050 00000010 00000010 00000000 RWIX
XINTRUPT 00007070 00000010 00000010 00000000 RWIX
ADC 00007100 00000020 0000001e 00000002 RWIX
SCIB 00007750 00000010 00000010 00000000 RWIX
SCIC 00007770 00000010 00000010 00000000 RWIX
I2CA 00007900 00000040 00000022 0000001e RWIX
RAML7 00008000 00007000 0000698a 00000676 RWIX
ZONE6B 0010fc00 00000400 00000000 00000400 RWIX
CSM_PWL 0033fff8 00000008 00000008 00000000 RWIX