DSPRelated.com
Forums

Running code from different memory

Started by Bhaskar Reddy N June 7, 2006
Our custom board has 6711DSP with external flash and SRAM.
Presently we are running from internal memory and is in ROM boot mode. Now because of code constraints we want move some part of the code to SRAM.
Thad i could able to achieve with linker cmd file as bellow

MEMORY
{
BOOT_RAM: o = 00000000h l = 00000400h fill = 0
VECTOR: o = 00000400h l = 00000200h fill = 0
IRAM: o = 00000600h l = 0000f9ffh fill = 0
SLOWMEM: o = 0A0000000h l = 00004000h fill = 0
SRAM: o = 0A0004000h l = 0003C000h
}
SECTIONS
{
.boot_load > BOOT_RAM fill = 0
.vectors > VECTOR fill = 0
.text : { *rts6701.lib(.text) }>> 0x0000600
.text2 : { *sport.obj(.text), *gbus.obj(.text) }>> SLOWMEM
.stack > IRAM fill = 0
.bss > IRAM fill = 0
.cinit > IRAM fill = 0
.const > IRAM fill = 0
.data > IRAM fill = 0
.far > SRAM
.switch > IRAM fill = 0
.sysmem > IRAM fill = 0
.tables > IRAM fill = 0
.cio > IRAM fill = 0
}

The problem is, i could not able to generate the binary file for the same to burn onto ROM. I could able burn the code onto Flash using JTAG by using flash burn routine (modified version of asm routine that ti supplies with examples). At the same time i modified boot loader so that it will copy from Flash to IRAM/SRAM appropriately.
But my only concern is how to generate single binary files using hex6x and .cmd.

Apart from this i request for some help on Cache utilization so that i can run my complete code from SDRAM and enable internal memory as Cache. I tried to do it by just initializing CCFG and MAR registers. i also tried with block-write back invalidate but no effect.
pls help me if anybody worked on it

BHASKAR REDDY . N
Mysore
Mobile: +91 9880 177365
__________________________________________________
Hi bhaskar,
Below peice of code is for tms320c64xx processor, check this out.
CSL_init();
CACHE_clean(CACHE_L2ALL, 0, 0);
CACHE_setL2Mode(CACHE_64KCACHE); change 64K to your desired size.
CACHE_enableCaching(CACHE_EMIFA_CE00);
CACHE_enableCaching(CACHE_EMIFA_CE01);

#define L2ALLOC3 0x0184200C
*(int *) L2ALLOC3 = (*(int *) L2ALLOC3) | 0x00000007;
#define L2ALLOC2 0x01842008
*(int *) L2ALLOC2 = (*(int *) L2ALLOC2) | 0x00000007;
#define L2ALLOC1 0x01842004
*(int *) L2ALLOC1 = (*(int *) L2ALLOC1) | 0x00000007;
CACHE_setPriL2Req(CACHE_L2PRIHIGH);

regards
bharath
Bhaskar Reddy N wrote:
Our custom board has 6711DSP with external flash and SRAM.
Presently we are running from internal memory and is in ROM boot mode. Now because of code constraints we want move some part of the code to SRAM.
Thad i could able to achieve with linker cmd file as bellow

MEMORY
{
BOOT_RAM: o = 00000000h l = 00000400h fill = 0
VECTOR: o = 00000400h l = 00000200h fill = 0
IRAM: o = 00000600h l = 0000f9ffh fill = 0
SLOWMEM: o = 0A0000000h l = 00004000h fill = 0
SRAM: o = 0A0004000h l = 0003C000h
}
SECTIONS
{
.boot_load > BOOT_RAM fill = 0
.vectors > VECTOR fill = 0
.text : { *rts6701.lib(.text) }>> 0x0000600
.text2 : { *sport.obj(.text), *gbus.obj(.text) }>> SLOWMEM
.stack > IRAM fill = 0
.bss > IRAM fill = 0
.cinit > IRAM fill = 0
.const > IRAM fill = 0
.data > IRAM fill = 0
.far > SRAM
.switch > IRAM fill = 0
.sysmem > IRAM fill = 0
.tables > IRAM fill = 0
.cio > IRAM fill = 0
}

The problem is, i could not able to generate the binary file for the same to burn onto ROM. I could able burn the code onto Flash using JTAG by using flash burn routine (modified version of asm routine that ti supplies with examples). At the same time i modified boot loader so that it will copy from Flash to IRAM/SRAM appropriately.
But my only concern is how to generate single binary files using hex6x and .cmd.

Apart from this i request for some help on Cache utilization so that i can run my complete code from SDRAM and enable internal memory as Cache. I tried to do it by just initializing CCFG and MAR registers. i also tried with block-write back invalidate but no effect.
pls help me if anybody worked on it

BHASKAR REDDY . N
Mysore
Mobile: +91 9880 177365