Скачал простенький тест с сайта bipom.com
Код
/*******************************************************************************
;
; This module is presented here only to serve as a sample for
; AT91SAM9260 program development.
; BiPOM Electronics provides this module as is and
; does not guarantee its functionality or suitability for a particular purpose.
; Please e-mail any questions and suggestions to tech@bipom.com
;
; Module: mmarm9_sdram.c
;
; Revision: 1.01
;
; Description: The example allows to check all 64-MByte SDRAM on Mini-Max/ARM9
; Target processor: AT91SAM9260
;
; This program is written using GNU ARM Compiler (www.gnuarm.org)
;
********************************************************************************
*/
#include "Bootstrap/include/part.h"
#include "Bootstrap/include/main.h"
#include "Bootstrap/include/debug.h"
#include "Bootstrap/include/dataflash.h"
#include "mmarm9_hw_init.h"
//
#include "mmarm9_sdram.h"
//
void TestValue_SDRAM(unsigned long value,unsigned long test)
{
unsigned long *ptSDRAM;
unsigned long ndx;
unsigned char flag=0;
unsigned long memStart = 0x20000000; /* SDRAM starts here */
unsigned long memSize = (16*1024*1024); /* 16x4=64-MByte SDRAM */
char testStr[3];
//
testStr[0]=test+'0';
testStr[1]=' ';
testStr[2]=0;
dbg_print("\n\rTEST");
dbg_print(testStr);
//
ptSDRAM=(unsigned long*)memStart;
for(ndx=memStart;ndx<memStart+memSize;ndx++)
{
// Special tests 5,6
if(test == 5) value = ndx;
if(test == 6) value = ((ndx & 0xFFFF)<<16)|(ndx & 0xFFFF);
if(test == 7) value = ((ndx & 0xFFFF)<<16);
if(test == 8) value = (ndx & 0xFFFF);
//
*ptSDRAM++=value;
}
//
ptSDRAM=(unsigned long*)memStart;
for (ndx=memStart;ndx<memStart+memSize;ndx++)
{
// Special tests 5,6
if(test == 5) value = ndx;
if(test == 6) value = ((ndx & 0xFFFF)<<16)|(ndx & 0xFFFF);
if(test == 7) value = ((ndx & 0xFFFF)<<16);
if(test == 8) value = (ndx & 0xFFFF);
//
if((*ptSDRAM++)!=value) flag= 1;
}
//
if( flag) dbg_print("FAILED");
else dbg_print("PASSED");
}
//
int main(void)
{
/* Hardware Initialization */
hw_init();
/* Download some code to process DF recovery feature */
load_df(AT91C_SPI_PCS_DATAFLASH, IMG_ADDRESS, IMG_SIZE, JUMP_ADDR);
/* Loop forever */
while(1)
{
dbg_print("\n\rStart Mini-Max/ARM9 SAM9260 SDRAM test...");
TestValue_SDRAM(0x00000000,1);
TestValue_SDRAM(0xFFFFFFFF,2);
TestValue_SDRAM(0xAAAAAAAA,3);
TestValue_SDRAM(0x55555555,4);
TestValue_SDRAM(0x00000000,5);
TestValue_SDRAM(0x00000000,6);
TestValue_SDRAM(0x00000000,7);
TestValue_SDRAM(0x00000000,8);
dbg_print("\n\rStop SDRAM test");
}
}
/*EOF*/
Буду тестить...