Renode is an emulator targeting microcontroller-class devices. This port is a minimal version of CircuitPython that runs under Renode. Renode is designed to mimic full microcontrollers but CP uses more peripherals than what Renode has implemented so far. This port allows us to run on a variety of CPUs without worrying about peripherals.
- Get Renode: https://renode.io/#downloads
cd ports/renode
make BOARD=renode_cortex_m0plus
- In another tab:
tio /tmp/cp-uart
renode
- In renode:
include @renode.resc
start
pause
quit
Step 4 sets up tio
to talk to CircuitPython via UART <-> PTY bridge.
Renode modules have debug logging that can be enabled with logLevel
with an int
between -1
for NOISY
and 3
for errors only.
Renode can provide a GDB server. It is very useful for precisely controlling the emulator's execution.
machine StartGdbServer 3333 true
In renode do cpu EnableProfiler CollapsedStack $ORIGIN/profile.folded
before starting
the emulation. You can view it using Speedscope. CircuitPython calls
a lot of functions and may overwhelm speedscope. You can enable this tracing over a specific
section of CircuitPython execution to limit the capture size.
If you want to see every instruction run you can do: cpu CreateExecutionTracing "tracer_name" $ORIGIN/instruction_trace.txt Disassembly
.