Memory Test
Your user binary may not boot correctly if there is a memory corruption problem (that is,
the communication between the DDR hard controller and memory module is not functioning).
This issue can appear when booting using the SPI flash or OpenOCD debugger. The
following instructions provide a debugging flow to determine whether your system has
this problem. You use two command prompts or shells to perform the test:
- The first terminal opens an OpenOCD connection to the SoC.
- The second connects to the first terminal for performing the test.
Important: If you are using the OpenOCD debugger in Efinity
RISC-V Embedded Software IDE, terminate any debug processes before performing this
test.
Set Up Terminal 1
To set up terminal 1, the flow varies on your IDE selection during the Sapphire SoC generation.
Efinity RISC-V Embedded Software IDE Selected
- Open a Windows command prompt or Linux shell.
- Change the directory to any of the example designs in your selected bsp
location. The default location for <efinity-riscv-ide
installation path> would be
C:\Efinity\efinity-riscv-ide-2022.2.3 for windows and
home/<user>/efinity/efinity-riscv-ide-2022.2.3 for
Linux.Note: The 2022.2.3 in the installation path may be different based on your IDE versions.Windows:
<efinity-risc-v-ide installation path>\openocd\bin\openocd.exe -f ..\..\..\bsp\efinix\EfxSapphireSoc\openocd\ftdi.cfg -c "set CPU0_YAML ..\..\..\cpu0.yaml" -f ..\..\..\bsp\efinix\EfxSapphireSoc\openocd\flash.cfgLinux:<efinity-risc-v-ide installation path>/openocd/bin/openocd -f ../../../bsp/efinix/EfxSapphireSoc/openocd/ftdi.cfg -c "set CPU0_YAML ../../../cpu0.yaml" -f ../../../bsp/efinix/EfxSapphireSoc/openocd/flash.cfgThe OpenOCD server connects and begins listening on port 4444.
Legacy Eclipse IDE Selected
- Open a Windows command prompt or Linux shell.
- Change to SDK_Windows or SDK_Ubuntu.
- Execute the setup.bat (Windows) or setup.sh (Linux) script.
- Change to the directory that has the cpu0.yaml file.
- Type the following commands to set up the OpenOCD
server:Windows:
openocd.exe -f bsp\efinix\EfxSapphireSoc\openocd\ftdi.cfg -c "set CPU0_YAML cpu0.yaml" -f bsp\efinix\EfxSapphireSoc\openocd\flash.cfgLinux:
The OpenOCD server connects and begins listening on port 4444.openocd -f bsp/efinix/EfxSapphireSoc/openocd/ftdi.cfg -c "set CPU0_YAML cpu0.yaml" -f bsp/efinix/EfxSapphireSoc/openocd/flash.cfg
Set Up Terminal 2
- Open a second command prompt or shell.
- Enable telnet if it is not turned on. Turn on telnet (Windows)
- Open a telnet host on port 4444 with the command
telnet localhost 4444. - To test the on-chip RAM, use the
mdwcommand to get the bootloader binary. Type the commandmdw<address> <number of 32-bit words> to display the content of the memory space. For example:mdw 0xF900_0000 32. - To test the DRAM:
- Use the
mwwcommand to write to the memory space:mww<address> <data>. For example:mww 0x00001000 16. - Then, use the
mdwcommand to write to the memory space:mdw<address> <data>. For example:mdw 0x00001000 16. If the memory space has collapsed, the console shows all 0s.
- Use the
Close Terminals
When you finish:
- Type
exitin terminal 2 to close the telnet session. - Type Ctrl+C in terminal 1 to close the OpenOCD session.
Important: OpenOCD cannot be running in Efinity RISC-V
Embedded Software IDE when you are using it in a terminal. If you try to run both at
the same time, the application will crash or hang. Always close the terminals when
you are done flashing the binary.
Reset the FPGA
Press the reset button on your development board:
- Trion® T120 BGA324 Development Board—SW2
- Titanium Ti60 F225 Development Board—SW3
- Titanium Ti180 J484 Development Board—SW1