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
  1. Open a Windows command prompt or Linux shell.
  2. 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.cfg
    Linux:
    <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.cfg
    The OpenOCD server connects and begins listening on port 4444.

Legacy Eclipse IDE Selected

  1. Open a Windows command prompt or Linux shell.
  2. Change to SDK_Windows or SDK_Ubuntu.
  3. Execute the setup.bat (Windows) or setup.sh (Linux) script.
  4. Change to the directory that has the cpu0.yaml file.
  5. 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.cfg
    Linux:
    openocd -f bsp/efinix/EfxSapphireSoc/openocd/ftdi.cfg 
      -c "set CPU0_YAML cpu0.yaml" 
      -f bsp/efinix/EfxSapphireSoc/openocd/flash.cfg
    The OpenOCD server connects and begins listening on port 4444.

Set Up Terminal 2

  1. Open a second command prompt or shell.
  2. Enable telnet if it is not turned on. Turn on telnet (Windows)
  3. Open a telnet host on port 4444 with the command telnet localhost 4444.
  4. To test the on-chip RAM, use the mdw command to get the bootloader binary. Type the command mdw <address> <number of 32-bit words> to display the content of the memory space. For example: mdw 0xF900_0000 32.
  5. To test the DRAM:
    • Use the mww command to write to the memory space: mww <address> <data>. For example: mww 0x00001000 16.
    • Then, use the mdw command 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.

Close Terminals

When you finish:
  • Type exit in 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