目前.out程序有两个,一个是DDR初始化程序,一个是应用程序。仿真调试的时候先加载DDR程序初始化DDR内存,然后加载应用程序,执行的时候会打印一长串地址的错误。如果加载完DDR程序之后,系统复位一下,没有这个问题。这个现象是正常的还是不正常的,还请大神们指点下?
A0=0x0 A1=0x4000
A2=0x0 A3=0xffff
A4=0x873700 A5=0x0
A6=0x42c80000 A7=0x0
A8=0x8731b8 A9=0x51
A10=0x0 A11=0x200
A12=0x510c80 A13=0x8731b4
A14=0x51 A15=0x4
A16=0x80353fd0 A17=0x0
A18=0x2744000 A19=0x4000
A20=0x81faa0 A21=0x1
A22=0x81fa94 A23=0x81fa84
A24=0x81fa9c A25=0x81fa8c
A26=0x81fa98 A27=0x81faa4
A28=0x1 A29=0x81faac
A30=0x81fa88 A31=0x81faa8
B0=0x81fa78 B1=0x81fa80
B2=0x80000036 B3=0x1
B4=0x80000036 B5=0x1
B6=0x81fa70 B7=0x816394
B8=0x81fa20 B9=0x80322f96
B10=0x81fa60 B11=0x1a
B12=0x8731b8 B13=0x8036e500
B14=0x40000000 B15=0x81fa28
B16=0x81fa68 B17=0x81fa6c
B18=0x81fa6c B19=0x81fa74
B20=0x816413 B21=0x81f990
B22=0x8036ca9c B23=0x201e2034
B24=0x30950800 B25=0x2801016
B26=0x26ab0000 B27=0x81f9b0
B28=0x0 B29=0x81f9b0
B30=0xffffffff B31=0xffffffff
NTSR=0x66666666
ITSR=0x36363636
IRP=0x0
SSR=0x8164b8
AMR=0xfffffff2
RILC=0x0
ILC=0x40000000
Exception at 0x8031680c
EFR=0x40000000 NRP=0x8031680c
ti.sysbios.family.c64p.Exception: line 255: E_exceptionMin: pc = 0x8031680c, sp = 0x0081fa28.
To see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exception.enablePrint = true;'
xdc.runtime.Error.raise: terminating execution
Nancy Wang:
我这边在开发板上试是不需要重新复位的。
你是自己的板子还是开发板?如果是开发板可以试一下GEL文件初始化DDR,如果是自己的板子参考这个链接看一下。
www.ti.com/…/sprabl2e.pdf
或者做一下memory test测试一下DDR的可靠性。
jun li:
回复 Nancy Wang:
这个问题是因为ddr可靠性导致的吗?
jun li:
回复 Nancy Wang:
我用gel文件的时候没有问题。我的gel文件:
fun1(myDelay)
{unsigned int i;for(i=0;i<1000;i++) i=i;}
StartUp()
{
}
fun2(unsigned int var1, unsigned int var2, unsigned int var3)
{int TEMP;if (var3 > 15){}if (var1 > 4095){}if (var2 > 63){}*(unsigned int*)(0x02310110)= (var1 & 0x0000003F); TEMP= (var1 & 0x1FC0) >> 6;*(unsigned int*)(0x026200328)&=~(0x0007F000);*(unsigned int*)(0x026200328)|=((TEMP << 12) & 0x0007F000);TEMP = ((var1 + 1) >> 1) – 1; *(unsigned int*)(0x02620328) &=~(0xFF000000);*(unsigned int*)(0x02620328) |=((TEMP << 24) & 0xFF000000);*(unsigned int*)(0x0262032C) &=~(0x0000000F);*(unsigned int*)(0x0262032C) |= ((TEMP >> 8) & 0x0000000F);*(unsigned int*)(0x0262032C) = 0x40;*(unsigned int*)(0x02620328)&= ~(0x0000003F);*(unsigned int*)(0x02620328)|= (var2 & 0x0000003F);*(unsigned int*)(0x02620328) = 0x070803c0;*(unsigned int*)(0x02310108)&= ~(0x00780000);*(unsigned int*)(0x02310108)|= ((var3 << 19) & 0x00780000) ;*(unsigned int*)(0x02310108) = 0x00090000;
}
fun3( int var1, int var2)
{int i, TEMP;unsigned int div2=4, div5=6, div8=80;int tmp1;int tmp2,tmp3;*(unsigned int*)(0x02620038) = 0x83E70B13;*(unsigned int*)(0x0262003C) = 0x95A4F1E0;fun1(1);TEMP = *(unsigned int*)(0x02310108) &0x00800000; if (TEMP != 0) {*(unsigned int*)(0x0262032C) = *(unsigned int*)(0x0262032C) | 0x00000040;*(unsigned int*)(0x02310100) &= ~(1 << 5);*(unsigned int*)(0x02310100) &= ~(1 << 0);fun1(1);*(unsigned int*)(0x02310108) |= 0x00800000; *(unsigned int*)(0x02310100)|= 0x00000002; fun1(1);*(unsigned int*)(0x02310100)&= ~(0x00000002); }*(unsigned int*)(0x02310100) &= ~(1 << 0);*(unsigned int*)(0x02310100) &= ~(1 << 5);fun1(1);fun2(var1, var2, 1);for (i = 0; i < 2000; i++){if ( (*(unsigned int*)(0x0231013C) & 0x00000001) == 0 ) {break;}}if ( i == 2000 ) {return(-1);}*(unsigned int*)(0x0231011C) = (0x8000) | (div2 – 1);*(unsigned int*)(0x02310164) = (0x8000) | (div5 – 1);*(unsigned int*)(0x02310170) = (0x8000) | (div8 – 1);*(unsigned int*)(0x02310140) |= ( (1 << 1) | (1 << 4) | (1 << 7));*(unsigned int*)(0x02310138)|= 0x00000001;fun1(1);for (i = 0; i < 2000; i++){if ( (*(unsigned int*)(0x0231013C) & 0x00000001) == 0 ) {break;}}if ( i == 2000 ) {return(-1);}fun1(1);*(unsigned int*)(0x02310100) |= 0x00000008;fun1(1);*(unsigned int*)(0x02310100) &= ~(0x00000008);fun1(1);*(unsigned int*)(0x02310108) &= ~(0x00800000); *(unsigned int*)(0x02310100) |= (1 << 0);tmp1 = (((125000/10) * ((var1+1)/2))/(var2+1));tmp2 = tmp1 / 100;tmp3 = ((tmp1 – tmp2 * 100) + 5) / 10;if (tmp3 > 9){tmp3 = tmp3 – 10;tmp2 = tmp2 + 1;}return (0);
}fun4( int var1, int var2)
{unsigned int reg, temp;unsigned int i=0;*(unsigned int*)(0x02620038) = 0x83E70B13;*(unsigned int*)(0x0262003C) =0x95A4F1E0;*(unsigned int*)(0x02620334) |= 0x00000040;*(unsigned int*)(0x02620330) |= 0x00800000;*(unsigned int*)(0x02620330) &= ~(0x0000003F);*(unsigned int*)(0x02620330) |= (var2 & 0x0000003F);*(unsigned int*)(0x02620330) &= ~(0x0007FFC0);*(unsigned int*)(0x02620330) |= ((var1 << 6) & 0x0007FFC0 );temp = ((var1 + 1) >> 1) – 1;*(unsigned int*)(0x02620330) &= ~(0xFF000000); *(unsigned int*)(0x02620334) &= ~(0x0000000F);*(unsigned int*)(0x02620330) |= ((temp << 24) & 0xFF000000); *(unsigned int*)(0x02620334) |= ((temp >> 8) & 0x0000000F);*(unsigned int*)(0x02620334) |= 0x00002000;for(i=0;i<10000;i++) i=i; *(unsigned int*)(0x02620334) &= ~(0x00002000); fun1(1); *(unsigned int*)(0x02620330) &= ~(0x00800000); fun1(1);
}
#define REG_52(*(unsigned int*)(0x02620000 + 0x04D4))
#define REG_53(*(unsigned int*)(0x02620000 + 0x04D8))
#define REG_54(*(unsigned int*)(0x02620000 + 0x04DC))
#define REG_55(*(unsigned int*)(0x02620000 + 0x04E0))
#define REG_56(*(unsigned int*)(0x02620000 + 0x04E4))
#define REG_57(*(unsigned int*)(0x02620000 + 0x04E8))
#define REG_58(*(unsigned int*)(0x02620000 + 0x04EC))
#define REG_59(*(unsigned int*)(0x02620000 + 0x04F0))
#define REG_60(*(unsigned int*)(0x02620000 + 0x04F4))fun5()
{
int i,TEMP;*(unsigned int*)(0x02620038) =0x83E70B13 ;*(unsigned int*)(0x0262003C) =0x95A4F1E0;fun1(1);(*(int*)(0x02620404)) &= ~(0x007FE000); (*(int*)(0x02620404)) |= 0x00200000; (*(int*)(0x02620434)) |= 0x08000000; (*(int*)(0x02620404)) |= 0xF;(*(int*)(0x02620460)) |= 0x00000200;REG_52 |= 0x00000200;REG_53 |= 0x00000200;REG_54 |= 0x00000200;REG_55 |= 0x00000200;REG_56 |= 0x00000200;REG_57 |= 0x00000200;REG_58 |= 0x00000200;REG_59 |= 0x00000200;
(*(unsigned int*)(0x0262040C)) = 0xA1;(*(unsigned int*)(0x02620410)) = 0xA1;(*(unsigned int*)(0x02620414)) = 0x94;(*(unsigned int*)(0x02620418)) = 0x94;(*(unsigned int*)(0x0262041C)) = 0x7A;(*(unsigned int*)(0x02620420)) = 0x7A;(*(unsigned int*)(0x02620424)) = 0x6D;(*(unsigned int*)(0x02620428)) = 0x6D;(*(unsigned int*)(0x0262042C)) = 0x87;(*(unsigned int*)(0x0262043C)) = 0xE0;(*(unsigned int*)(0x02620440)) = 0xE0;(*(unsigned int*)(0x02620444)) = 0xD3;(*(unsigned int*)(0x02620448)) = 0xD3;(*(unsigned int*)(0x0262044C)) = 0xB9;(*(unsigned int*)(0x02620450)) = 0xB9;(*(unsigned int*)(0x02620454)) = 0xAC;(*(unsigned int*)(0x02620458)) = 0xAC;(*(unsigned int*)(0x0262045C)) = 0xC6;
(*(unsigned int*)(0x210000E4)) &= ~(0x00008000);(*(unsigned int*)(0x210000E4)) |= (0x00008000);(*(unsigned int*)(0x210000E4)) &= ~(0x00008000);fun0(3000);(*(unsigned int*)(0x21000010)) = 0x0000515c;TEMP = 0;TEMP |= 0x8 << 25;TEMP |= 0x8 << 21;TEMP |= 0x9 << 17;TEMP |= 0x17 << 12;TEMP |= 0x20 << 6;TEMP |= 0x7 << 3;TEMP |= 0x4;(*(unsigned int*)(0x21000018)) = 0x155ffabf;TEMP = 0;TEMP |= 0x3 << 28;TEMP |= 0x70 << 16;TEMP |= 0x1ff << 6;TEMP |= 0x4 << 3;TEMP |= 0x3;(*(unsigned int*)(0x21000020)) = 0x70ef7ffc;TEMP = 0;TEMP |= 0x5 << 28;TEMP |= 0x5 << 24;TEMP |= 0x4 << 21;TEMP |= 0x3f << 15;TEMP |= 0xc7 << 4; ////TEMP |= 0xad << 4; //TEMP |= 0xf;(*(unsigned int*)(0x21000028)) = 0x55bf8d7f;
(*(unsigned int*)(0x210000E4)) = 0x0010010f;// ei – commented this line reduced calibration rate from 4c1f to 3214//(*(unsigned int*)(0x210000C8))= 0x70074c1f; (*(unsigned int*)(0x210000C8))= 0x70073214;(*(unsigned int*)(0x21000038)) = 0x0;//add new(*(unsigned int*)(0x21000010)) = 0x0000515c;fun0(3000);TEMP = 0;TEMP |= 0x3 << 29;TEMP |= 0x0 << 27;TEMP |= 0x2 << 24;TEMP |= 0x2 << 21;TEMP |= 0x1 << 18;TEMP |= 0x3 << 16;TEMP |= 0x0 << 14;TEMP |= 0xe << 10;TEMP |= 0x6 << 7;TEMP |= 0x3 << 4;TEMP |= 0x0 << 3;TEMP |= 0x2;(*(int*)(0x21000008)) = TEMP;for(i=0;i<2000;i++) i=i;fun1(1);(*(unsigned int*)(0x21000010)) = 0x00001450;//(*(unsigned int*)(0x21000010)) = 0x00001414;
//(*(unsigned int*)(0x21000010)) = 0x00000c30; (*(int*)(0x210000D8)) = 0x80000000; fun0(30000);(*(int*)(0x210000DC)) = 0x80000000;fun0(30000);
}fun0( int nloop )
{int i;for( i = 0 ; i < nloop ; i++ ){}
}fun7( )
{unsigned int i=0;fun8(0, 3, 3);fun8(0, 4, 3);fun8(1, 6, 3);fun8(2, 7, 3);fun8(2, 8, 3);fun8(2, 9, 3);fun8(3, 10, 3);fun8(5, 12, 3);fun8(7, 14, 3);
}fun8(unsigned int pd,unsigned int id,unsigned int state)
{unsigned int* tmp1;unsigned int* tmp2;unsigned int* tmp3;int ret=0;tmp1 = ( unsigned int* )(( 0x02350A00 ) + ( 4 * id ));tmp2 = ( unsigned int* )(( 0x02350800 ) + ( 4 * id ));tmp3 = ( unsigned int* )(( 0x02350300 ) + ( 4 * pd ));if ( ( *tmp2 & 0x1f ) == state ){return(0);}fun0(150);if (*( unsigned int* )( 0x02350128 ) & (0x1 << pd)){ret=1;}else{*tmp3 = (*tmp3) | 0x00000001;*tmp1 = ((*tmp1) & ~(0x1f)) | state;*( unsigned int* )( 0x02350120 ) = (*( unsigned int* )( 0x02350120 )) | (0x1<<pd);fun0(150);if ((*( unsigned int* )( 0x02350128 ) & (0x1 << pd)) != 0 ) {return 1;}fun0(150);if(( *tmp2 & 0x1f ) != state ) {if ((pd == 2) && (id == 9) ) {} else {}return 1;}}return(ret);
}
OnTargetConnect( )
{ unsigned int i; GEL_Reset();for( i=0; i<10000; i++) i=i+1;//fun3( 31, 1);fun3( 15, 0);//fun3( 49, 1);for( i=0; i<10000; i++) i=i+1;fun8(0, 3, 3);fun8(3, 10, 3);for( i=0; i<10000; i++) i=i+1;fun9();for( i=0; i<10000; i++) i=i+1;//fun4( 11, 0);fun4( 19, 0);//fun4( 23, 0);for( i=0; i<10000; i++) i=i+1;fun5();//fun6();for( i=0; i<10000; i++) i=i+1;
}
fun9()
{(*(int*)(0x08000010))= 0x100000FF;(*(int*)(0x08000014))=0x2100000B;
}fun10()
{*(int*)(0x01845028) = 1;while(( *(int*)(0x01845028) & 0x0001 ) ) fun0(150);*(int*)(0x01845048) = 1;while( ( *(int*)(0x01845048) & 0x0001 ) ) fun0(150);*(int*)(0x01845008) = 1;while( ( *(int*)(0x01845008) & 0x0001 ) )fun0(150);
}menuitem "Load Program";
hotmenu Load_Program()
{unsigned int i,j;
*(int*)(0x0274105C) = 0xFFFFFFFF;*(int*)(0x0274102C) = 0xFFFFFFFF;*(int*)(0x02741074)= 0xFFFFFFFF;*(int*)(0x0274100C)= 0xFFFFFFFF;*(int*)(0x02741058)= 0xFFFFFFFF;*(int*)(0x02741028)= 0xFFFFFFFF;*(int*)(0x02741070)= 0xFFFFFFFF;*(int*)(0x02741008)= 0xFFFFFFFF;*(int*)(0x02741050) = 0;
for(j=0;j<1;j++)
{
//*(int*)(0x23100e4)= 0x15a69;//*(int*)(0x23100ec)= 0x20001000;//*(int*)(0x23100e4)= 0x15a69;//*(int*)(0x23100e4)= 0x00003;GEL_AdvancedReset("System Reset");for( i=0; i<10000; i++) i=i+1;fun3( 15, 0);for( i=0; i<10000; i++) i=i+1;fun8(0, 3, 3);fun8(3, 10, 3);fun9();for( i=0; i<10000; i++) i=i+1;fun4( 19, 0); for( i=0; i<10000; i++) i=i+1;fun5();fun10();*(int*)(0x02740000 + 0x1050) = 0;
for( i=0; i<10000; i++) i=i+1;GEL_Load( "$(GEL_file_dir)\\Debug\\helloworld_tcp_evmc6678l.out");GEL_Go(main);for( i=0; i<10000; i++) i=i+1;}
}
Nancy Wang:
回复 jun li:
用GEL文件初始化之后还需要执行复位操作吗?
jun li:
回复 Nancy Wang:
不需要,但是gel文件中“GEL_AdvancedReset("System Reset");”这个语句是不是相当于执行了一下复位操作?
Nancy Wang:
回复 jun li:
是的,参考这个链接看看。
http://processors.wiki.ti.com/index.php/Emulation_Resets