⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stone.c

📁 Embest EudKit-II教学系统配Samsung S3C2410处理器的部分测试程序。
💻 C
字号:
/*********************************************************************************************
* File:	stone.c
* Author:	embest
* Desc:	NAND Internal RAM test (4KByte)
* History:	
*			R.X.Huang, Programming modify, March 12, 2005
*********************************************************************************************/

/*------------------------------------------------------------------------------------------*/
/*                                     include files	                                    */
/*------------------------------------------------------------------------------------------*/
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "stone.h"

/*********************************************************************************************
* name:		test_isram
* func:		inner sram test
* para:		none
* ret:		none
* modify:
* comment:		
*********************************************************************************************/
void test_isram(void)
{
    UINT32T i, j, error=0;
    UINT32T *pStepSram=(void *)0x40000000;

    uart_printf("[Internal Stepping Stone test (4Kbyte)]\n");
    uart_printf("\nTest Pattern : 0x0 , 0x55555555 , 0xaaaaaaaa , 0xffffffff\n\n");    
    for(i=0;i<0x1000/4;i++)
	*(pStepSram+i)=0x0;
	
	uart_printf("Waitting 1 Sec \n");
	delay(10000);
	uart_printf("Read Start\n");

    for(i=0;i<0x1000/4;i++)
    {
	    j=*(pStepSram+i);
	    if(j!=0x0)
	    {
	        uart_printf("Error --> Address= 0x%8x  , Write= 0x0000000  , Read= 0x%8x\n",(pStepSram+i),j);
	        error++;
	   }
//	    uart_printf("0");
   }
    
//---------------------------------------------------------------------------------------------    
    for(i=0;i<0x1000/4;i++)
	*(pStepSram+i)=0x55555555;

	uart_printf("\nWaitting 1 Sec \n");
	delay(10000);
	uart_printf("Read Start\n");

    for(i=0;i<0x1000/4;i++)
    {
	    j=*(pStepSram+i);
	    if(j!=0x55555555)
	    {
	        uart_printf("Error --> Address= 0x%8x  , Write= 0x55555555  , Read= 0x%8x\n",(pStepSram+i),j);
	        error++;
	   }
//	    uart_printf("5");	    
   }
     
//---------------------------------------------------------------------------------------------
    for(i=0;i<0x1000/4;i++)
	*(pStepSram+i)=0xaaaaaaaa;

	uart_printf("\nWaitting 1 Sec \n");
	delay(10000);
	uart_printf("Read Start\n");

    for(i=0;i<0x1000/4;i++)
    {
	    j=*(pStepSram+i);
	    if(j!=0xaaaaaaaa)
	    {
	        uart_printf("Error --> Address= 0x%8x  , Write= 0xAAAAAAAA  , Read= 0x%8x\n",(pStepSram+i),j);
	        error++;
	   }
//	    uart_printf("a");	    
   }

//---------------------------------------------------------------------------------------------
    for(i=0;i<0x1000/4;i++)
	*(pStepSram+i)=0xffffffff;

	uart_printf("\nWaitting 1 Sec \n");
	delay(10000);
	uart_printf("Read Start\n");

    for(i=0;i<0x1000/4;i++)
    {
	    j=*(pStepSram+i);
	    if(j!=0xffffffff)
	    {
	        uart_printf("Error --> Address= 0x%8x  , Write= 0xFFFFFFFF  , Read= 0x%8x\n",(pStepSram+i),j);
	        error++;
	   }
//	    uart_printf("f");
   }

    if(error)
	    uart_printf("\nFailed Total Count : %3d\n",error);   
    else
	    uart_printf("\nInternal Stepping Stone is OK.\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -