[WIP] How to use Renode

The Renode simulator is a software tool developed by Antmicro that the Controls team uses to run unmodified binaries identical to the ones one would normally flash onto target hardware. Put simply, it simulates the hardware and allows us to run and debug tests in preparation for hardware testing. It supports GDB (GNU Debugger) and Telnet usage and is incredibly useful for ironing out higher level software bugs.

Step-by-step guide

In order to use Renode:

  1. Open your codespace
  2. Open a terminal by pressing control+tilde.
  3. Compile code for the Renode simlulator by running make leader TEST=test_name_here (exclude Test_ and .c, ex: compile Test_ReadCarCan.c with )
  4. To start Renode, run Scripts/start_renode.sh 
  5. At this point, Debugger can also be used to debug the code. Additionally, telnet can be use to view the UART (?) output in terminal. 

Renode has commands that allows us to start and quit. They also have single letter aliases.

  • To start the simulation, enter start or s 
  • To exit or quit the simultaion, enter quit  or q . Renode will then ask you to confirm if you want to exit the simulation by entering y  or n  for yes or no. 

Troubleshooting

  • "Please add your load_env_vars.sh script to your .bashrc file.": The script is looking for certain environment variables that need to be set. This is done in the load_env_vars.sh script. We can fix this issue by running this script in the .bashrc file, which runs every time we start up a new terminal.
    • Find your .bashrc script using cd ~ and then ls -a (since it is usually in the home folder): 

    • Type code .bashrc to edit the file
    • At the end of the file, add . <path/to/load_env_vars.sh/from/.bashrc/file>load_env_vars.sh
      • <path/to>load_env_vars.sh is the script to run
      • . means to run the script in the current session rather than a new session
      • If this doesn't work, check the bash message to make sure it was able to find the script. If it says "no such file or directory is found," it means the path to the file is incorrect
in progress