Download Embedded System Development and Labs for ARM

Transcript
Embedded Systems Development and Labs; The English Edition
Uart_Printf(" Memory Read/Write(C code =>Word) Test. \n");
Uart_Printf(" Base Address is: %x\n",RWBase);
Uart_Printf(" Memory Units is: %x\n",RWNum);
Uart_Printf(" Access Memory Times is: %d\n",i);
Uart_Printf("\n Press any key to continue... \n");
Uart_Getch();
step=sizeof(short);
// Access by half Word.
for(i=0;i<RWNum/step;i++)
{
(*(short *)(RWBase +i*step)) = 0xFF00;
(*(short *)(RWBase +RWNum+i*step)) = (*(short *)(RWBase +i*step));
}
Uart_Printf(" Memory Read/Write(C code =>halfWord) Test. \n");
Uart_Printf(" Base Address is: %x\n",RWBase);
Uart_Printf(" Memory Units is: %x\n",RWNum);
Uart_Printf(" Access Memory Times is: %d\n",i);
Uart_Printf("\n Press any key to continue... \n");
Uart_Getch();
step=sizeof(char);
// Access by Byte.
for(i=0;i<RWNum/step;i++)
{
(*(char *)(RWBase +i*step)) = 0xBB;
(*(char *)(RWBase +RWNum+i*step)) = (*(char *)(RWBase +i*step));
}
Uart_Printf(" Memory Read/Write(C code =>Byte) Test. \n");
Uart_Printf(" Base Address is: %x\n",RWBase);
Uart_Printf(" Memory Units is: %x\n",RWNum);
Uart_Printf(" Access Memory Times is: %d\n",i);
Uart_Printf("\n Press any key to continue... \n");
Uart_Getch();
Uart_Printf(" Memory Test Success! \n");
Uart_Printf("\n << CACHE >> Test. Y/y to continue,any key skip it.\n");
input_char = Uart_Getch();
if(input_char == 'Y' || input_char == 'y')
Test_CACHE();
}
144