hippo, I also build a memory test project with the standard .ptf file, and it runs in IDE. This project can test flash, sram and sdram in dev board.
type, begin address , end address, size
flash 0x00000000 , 0x008FFFFF, 8M
sram 0x02000000, 0x020FFFFF, 1M
sdram 0x01000000, 0x01FFFFFF, 16M
The flash and sram are OK, but when I test the sdram, nothing responsing. The following is the information in console.
nios2-terminal: connected to hardware target using JTAG UART on cable
nios2-terminal: "USB-Blaster ", device 1, instance 0
nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate)
<----> Nios II Memory Test. <---->
This software example tests the memory in your system to assure it
is working properly. This test is destructive to the contents of
the memory it tests. Assure the memory being tested does not contain
the executable or data sections of this code or the exception address
of the system.
----------------------------------
Memory Test Main Menu
----------------------------------
a: Test RAM
b: Test Flash
q: Exit
----------------------------------
Select Choice (a-b): b
Enter the name of the CFI flash device to be opened,
or just press <enter> to open "/dev/ext_flash")
>
-Successfully opened /dev/ext_flash
-Region 0 contains 128 blocks.
-Checking Region 0 for erased blocks.
-Block 92, at address 0x5C0000 is erased.
-Would you like to test this block? (y/n)y
-Starting Flash Test.
-Testing "alt_write_flash" and "alt_read_flash".
pass 1 - passed.
pass 2 - passed.
-Testing "alt_erase_flash_block". passed.
-Testing "alt_write_flash_block". passed.
-Testing unaligned writes. passed.
-Returning block 92 to its erased state.
-Flash tests complete.
-Closing flash device "/dev/ext_flash".
----------------------------------
Memory Test Main Menu
----------------------------------
a: Test RAM
b: Test Flash
q: Exit
----------------------------------
Select Choice (a-b): a
Base address to start memory test: (i.
e. 0x800000)
>0x02000000
End Address:
>0x020FFFFF
Testing RAM from 0x2000000 to 0x20FFFFF
-Data bus test passed
-Address bus test passed
-Byte and half-word access test passed
-Testing each bit in memory device. . . passed
Memory at 0x2000000 Okay
----------------------------------
Memory Test Main Menu
----------------------------------
a: Test RAM
b: Test Flash
q: Exit
----------------------------------
Select Choice (a-b): a
Base address to start memory test: (i.e. 0x800000)
>0x01000000
End Address:
>0x01FFFFFF
Testing RAM from 0x1000000 to 0x1FFFFFF
No result about sdram! I tries many times and got the same thing.