Author
Topic: Getting Started with Simulation (Read 47 Times)
Role
Posts: 1
Points: 0

This guide will help getting started with the embedded simulator within Iron Coder!

 

Preface:

Iron coder supports simulation through Renode. Currently only STM32F4 boards are supported.

More information about getting started with Renode can be found here https://renode.readthedocs.io/en/latest/basic/machines.html



Navigating to the simulator:

Within the Iron Coder code editor there are three tabs in the bottom section.


Figure: When using supported board.

Clicking on the simulation tab will open the simulator tab that has two sections separated by a grey line.



Prepping simulation:

When using a supported board the simulator button will be active and clicking it will start Renode and load the necessary board and elf file from the project. After this the user can start to enter commands to get useful information from the simulator.

Figure: When using unsupported board.

 

Renode Commands:

 

logLevel

The most basic commands for monitoring the simulator is in the form of logLevel:

 

Basic Format:

 

logLevel #lvl peripheral

 

#lvl:

The level indicates at which log level messages are output by the simulator. They range from -1 to 3. This level affects the condition on which output is generated by the simulator, most cases we will want to use -1 where output will be generated on any change with the peripheral. 

 

peripheral:

This field is used to specify the peripheral which you want to monitor with the given log level. For example if you wanted to monitor a usart channel you would use usart or a specific gpio you would use gpioPortA. For specific pins it is also possible to target them with the log command by appending a . and the predefined pin name. For example the user LEDs are predefined as the colorLED for the STM32F4 so if you wanted to track the red LED state you could use logLevel -1 gpioPortG.RedLED.

 

sysbus function:

The sysbus is the main access point of all peripherals for Renode. It can be used in conjunction with any of its functions to check a peripherals state, read/write to sections of memory, and many other use cases.

 

sysbus LogAllPeripherialsAccess true

This command turns logging on for all peripherals of the loaded board. This is helpful when you want to monitor multiple peripherals on the board where setting up individual logLevels would be cumbersome.

 

start

The start command works exactly as you would expect and starts the simulated hardware producing all output that was set up before

 

pause

The pause command halts the current machine from running, this can be helpful to set up additional commands to monitor other peripherals.

 

quit

The quit command stops execution and close the Renode application

 

With all this you are now ready to tackle simulation in Iron Coder with Renode!

 

Running through a basic workflow might look like this.

1) After completing a basic starting program, like blinking LEDs, navigate to the code editor and select the simulator tab.

2) Press the simulation button and set your LEDs log level to be monitored with logLevel -1 gpioPortG.GreenLED.

3) Then run the start command and watch as the state of the LED is logged while the simulation runs.

 


You need to login to comment or reply!