Hello,
It seems I have difficulties interfacing the TMS320C6746 with a Winbond W9725G6KB 256 Mb DDR2 on my custom board. In order to accomplish this, I have used the C6748.gel from the C6748_StarterWare_1_20_04_01 package. Since the oscillator on my custom board is 25MHz, I have slightly modified the PLL registers using:
http://processors.wiki.ti.com/index.php/File:SYS_CLK_CALC_OMAP-L137_C674X_AM17X_v1p0.zip
The proposed operating speeds are the following:
Core speed: 75Mhz; DDR speed: 50 Mhz.
(I have also tried to use the preconfigured core settings).
The memory map was configured (both in the .cmd and .gel files) in order to meet the 256 Mb specifications:
- GEL_MapAddStr( 0xC0000000, 0, 0x10000000, "R|W|AS4", 0 ); (gel)
- DDR2 o = 0xC0000000 l = 0x10000000 /* 256MB DDR2 Data */ (cmd)
Moreover, I have adjusted the EMIFDDR_SDRC mask in order to meet my DDR specifications:
- IBANK set to 0x2, corresponding to 4 internal memory banks
- PAGESIZE set to 0x1, corresponding to 512 bits
Furthermore, the DDR debug value was set:
- #define DDR_DEBUG 1 // Set this to "1" to program DDR with more timing slack
In order to test the DDR, I used a simple program that puts a vector in the external memory:
C6746.cmd:
SECTIONS
{
.text > SHDSPL2RAM
.stack > SHDSPL2RAM
.bss > SHDSPL2RAM
.cio > SHDSPL2RAM
.const > SHDSPL2RAM
.data > DDR2
.switch > SHDSPL2RAM
.sysmem > SHDSPL2RAM
.far > SHDSPL2RAM
.args > SHDSPL2RAM
.ppinfo > SHDSPL2RAM
.ppdata > SHDSPL2RAM
/* COFF sections */
.pinit > SHDSPL2RAM
.cinit > SHDSPL2RAM
/* EABI sections */
.binit > SHDSPL2RAM
.init_array > SHDSPL2RAM
.neardata > SHDSPL2RAM
.fardata > SHDSPL2RAM
.rodata > SHDSPL2RAM
.c6xabi.exidx > SHDSPL2RAM
.c6xabi.extab > SHDSPL2RAM
}
main.c:
#pragma DATA_SECTION(data1, ".data");
int data1[20];
int main(void) {
unsigned char length = 20;
int i, j;
for (i=0;i<20;i++)
data1[i] = 0;
data1[0] = 0x4;
data1[1] = 0x8;
data1[2] = 0xBC;
data1[3] = 0xF2;
data1[4] = 0x5;
data1[5] = 0x12;
data1[8] = 0xFE;
data1[9] = 0x2A;
while(1){
}
}
The values that appear in the watch window however are the following:
data1 int[20] 0xC0000000 (Hex) 0xC0000000
[0] int 0x10001005 (Hex) 0xC0000000
[1] int 0x10001012 (Hex) 0xC0000004
[2] int 0x100010BC (Hex) 0xC0000008
[3] int 0x100010F2 (Hex) 0xC000000C
[4] int 0x10001005 (Hex) 0xC0000010
[5] int 0xD6BB5763 (Hex) 0xC0000014
[6] int 0x7FF39FF1 (Hex) 0xC0000018
[7] int 0x39371515 (Hex) 0xC000001C
[8] int 0x5313B509 (Hex) 0xC0000020
[9] int 0x1000102A (Hex) 0xC0000024
[10] int 0x10001000 (Hex) 0xC0000028
[11] int 0x10001000 (Hex) 0xC000002C
[12] int 0x100010FE (Hex) 0xC0000030
[13] int 0xF3335317 (Hex) 0xC0000034
[14] int 0xB177915F (Hex) 0xC0000038
[15] int 0xF16FFB77 (Hex) 0xC000003C
[16] int 0xFFE75793 (Hex) 0xC0000040
[17] int 0x10001000 (Hex) 0xC0000044
[18] int 0x10001000 (Hex) 0xC0000048
[19] int 0x10001000 (Hex) 0xC000004C
The first problem is the ‘1’ at the beginning of each WORD. Secondly, if I use breakpoints after each assignment, I can see some values being overwritten (e.g.: data[0] is written correctly – ignoring the ‘1’ at the beginning of the word – 0x10001004; when data[4] is assigned a value, data[0] will be overwritten with the same vale).
Do you know what can be the cause of the problem? Do you recommend a .gel file that better suits my needs?
I am looking forward to your answer.
Regards,