Running an emulator with Renode

2026-06-18

Contents:

This blog is to try out emulating a board in renode. We’ll pick a sample board, go over the entire process of emulation end-to-end which includes peripherals and see how things work, exactly.

# Setup

I already explained the renode setup here at this blog, so you can follow that to reach the stage where I am right now.

# Runing renode

I am the following the documentation over here. So, let’s launch the terminal:

renode

Now in there we can create an empty machine:

# Typed inside the monitor
mach create "stm32f4-discovery-test"

You should see the <Timestamp> [INFO] System bus created. being logged in your terminal. This is the machine creating just the sysbus and it has no other peripherals, not even the CPU or memory. So, let’s get that first:

machine LoadPlatformDescription @platforms/cpus/stm32f4.repl

This loads the CPU and peripherals for stm32f4. You can verify that by running peripherals. It should have a bunch of stuff other than sysbus. We can inspect the memory:

peripherals memory
sysbus.sram Size
sysbus.sram ZeroAll

Now we have to load the binary, this can be done via LoadELF:

sysbus LoadELF @firmware.elf

The question is, what is this firmware? Well we’ll have to come up with something that can be run on an stm32f4.

To do this I am using this repo here. This is a sample project for educational purposes. I am also installing the GNU Arm embedded toolchain for this. Or if you’re confused like I am, just do this:

sudo apt-get install gcc-arm-none-eabi

Once this is installed, you can do this and get the firmware:

cd stm32f4-assembly
make
ls # Should see a template.elf there

Then in the renode CLI you need to do:

sysbus LoadELF @template.elf
start

Not impressed? I agree, this makes for a shitty demo. I need to find a better firmware which is more chattier so we can talk over UART or something. The easiest to verify is:

start @scripts/single-node/stm32f4_discovery.resc

And you can observe it do a bunch of stuff.


Did you like this blogpost? Then consider catching up via LinkedIn or Github!