Hi All,
One of the customer is trying to transfer a data block in memory from L2 SRAM to L1D or L1P SRAM on OMAP-L137 (TI DSP 6747) platform using IDMA Channel 1. But there is no data transfer after execution of the code on CCS Version 3.3.
The code and IDMA config looks fine as per the reference guide. Is anything else needs to be taken care while dealing with L2, L1P, L1D SRAM??
Code Snip Shot:
#include
#define IDMA1_STAT *((unsigned int *)0x01820100)
#define IDMA1_SRC *((unsigned int *)0x01820108)
#define IDMA1_DEST *((unsigned int *)0x0182010C)
#define IDMA1_CNT *((unsigned int *)0x01820110)
#pragma DATA_SECTION(data, ".tData")
unsigned char data[]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
void main()
{
unsigned int dest = 0;
unsigned int count = 0;
printf("IDMA Block Transfer Start\n");
count = 0x7<<29 | 0x20; // PRI=0x7,INT=0,Reserved=0,FILL=0,COUNT=0x20
dest = 0x00F00000 << 2; // DESTADDR=0x00F00000,Reserved=0
// IDMA Channel 1 Configuration
IDMA1_SRC = 0x00809F88; // Addr of data[] from map file
IDMA1_DEST = dest;
IDMA1_CNT = count;
while(IDMA1_STAT)
{
; // NOP
}
printf("IDMA Block Transfer Complete\n");
while(1);
}
By default all 256K L2 region is SRAM (cache = 0).
I have executed a gel script to configure L1P and L1D regions as 8K cache and remaining 24K SRAM.
This gel script gets executed on “File->Load Program”. My gel script snip shot and linker.cmd file snip shot are as mentioned below:
Gel Script:
setupCache()
{
unsigned int l1p, l1d;
GEL_TextOut("Setup Cache...\n");
#define L1PCFG (unsigned int*)(0x01840020)
#define L1DCFG (unsigned int*)(0x01840040)
*(L1PCFG) = 2; // L1P on, size 8K
*(L1DCFG) = 2; // L1D on, size 8K
l1p = *(L1PCFG);
if ( l1p == 0 )
GEL_TextOut("L1P = 0K\n");
if ( l1p == 1 )
GEL_TextOut("L1P = 4K\n");
if ( l1p == 2 )
GEL_TextOut("L1P = 8K\n");
if ( l1p == 3 )
GEL_TextOut("L1P = 16K\n");
if ( l1p >= 4 )
GEL_TextOut("L1P = 32dK\n");
l1d = *(L1DCFG);
if ( l1d == 0 )
GEL_TextOut("L1D = 0K\n");
if ( l1d == 1 )
GEL_TextOut("L1D = 4K\n");
if ( l1d == 2 )
GEL_TextOut("L1D = 8K\n");
if ( l1d == 3 )
GEL_TextOut("L1D = 16K\n");
if ( l1d >= 4 )
GEL_TextOut("L1D = 32K\n");
GEL_TextOut("Cache Setup Completed\n");
}
/* ------------------------------------------------------------------------ *
* *
* OnPreFileLoaded( ) *
* This function is called automatically when the 'Load Program' *
* Menu item is selected. *
* *
* ------------------------------------------------------------------------ */
OnPreFileLoaded( )
{
/*
* GEL_Reset() is used to deal with the worst case senario of
* unknown target state. If for some reason a reset is not desired
* upon target connection, GEL_Reset() may be removed and replaced
* with something "less brutal" like a cache initialization
* function.
*/
GEL_Reset( );
setupCache();
// Disable_EDMA( ); // Disable EDMA
GEL_TextOut( "\n" );
}
linker.cmd file:
-stack 0x00000400 /* Stack Size */
-heap 0x00000800 /* Heap Size */
MEMORY
{
L2SRAM : o = 0x00800000 l = 0x00040000 // 256 K SRAM
L1PSRAM : o = 0x00E00000 l = 0x00006000 // 24 K SRAM
L1DSRAM : o = 0x00F00000 l = 0x00005C00 // 23 K SRAM
STACK : o = 0x00F05C00 l = 0x00000400 // 1 K STACK in L1DSRAM
SHAREDRAM : o = 0x80000000 l = 0x00020000
}
SECTIONS
{
.bss > L2SRAM
.cinit > L2SRAM
.cio > L2SRAM
.const > L2SRAM
.stack > STACK
.tData > L2SRAM
.sysmem > L2SRAM
.text > L2SRAM
.switch > L2SRAM
.far > L2SRAM
}