question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integrate with Renode Simulation Framework for load and debug

See original GitHub issue

What kind of issue is this?

  • Feature Request.

What is Renode?

Renode is an open source software development framework with commercial support from Antmicro that lets you develop, debug and test multi-node device systems reliably, scalably and effectively.

Renode is a fantastic tool to simulate applications on multiple boards. As an example, it supports boards from STMicro and some RISC-V boards like SiFive HiFive1, Kendryte K210 and many more.

Full board list: https://renode.readthedocs.io/en/latest/introduction/supported-boards.html

This integration would be the best of both worlds where one can develop in PlatformIO and debug/simulate on Renode without requiring hardware. Renode is available for Windows, Mac and Linux just adjusting the execution path.

I’ve started testing the available options and identified Renode can be started as a Telnet server (over a choosen port) and issued commands to it.

As an example to run the HiFive 1 ZephyrOS Hello World project, I did (on MacOS):

  1. Open Renode with Telnet option: /Applications/Renode.app/Contents/MacOS/macos_run.command -P 1234
  2. Connected to the Renode Telnet server: telnet 1234
  3. Loaded the HiFive1 board script: include @scripts/single-node/sifive_fe310.resc
  4. Started Renode remote debugger port: machine StartGdbServer 3333 True
  5. Loaded my “Hello World” ELF binary built on PlatformIO: sysbus LoadELF @/Users/cdepaula/Documents/PlatformIO/Projects/200303-171147-zephyr-hello-world/.pio/build/hifive1/firmware.elf
  6. Start simulation with: start
image

To start over, issue the command Clear on Renode console.

Another option is loading Renode with command line execute parameters as:

/Applications/Renode.app/Contents/MacOS/macos_run.command \
    -e "include @scripts/single-node/sifive_fe310.resc" \
    -e "machine StartGdbServer 3333 True" \
    -e "sysbus LoadELF @/Users/cdepaula/Documents/PlatformIO/Projects/200303-171147-zephyr-hello-world/.pio/build/hifive1/firmware.elf" \
    -e "start"

I successfully integrated the PlatformIO debugger to an existing instance of Renode by adding debug_port = localhost:3333 to platformio.ini on my project. Added a test breakpoint and interacted with the debugging on the simulation:

  1. Open Renode with Telnet option: /Applications/Renode.app/Contents/MacOS/macos_run.command -P 1234
  2. Connected to the Renode Telnet server: telnet 1234
  3. Loaded the HiFive1 board script: include @scripts/single-node/sifive_fe310.resc
  4. Started Renode remote debugger port: machine StartGdbServer 3333 True

From there, I clicked the debugger “Play” and PlatformIO built and loaded my application into Renode.

image

Continued the breakpoint:

image

I just was not able to “Reset” and start over via debugging or software without issuing the Clear command on Renode and loading everything from start (it’s fast though).

I’m wiling to help writing this support if I can get some tips.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mgieldacommented, Mar 11, 2020

Hi @carlosedp glad to see this! I already had an integration with pio written up internally and was thinking how to make this public, so glad you went along and did this 😉

We were busy with the Renode 1.9 relase which just went out this week - https://github.com/renode/renode/releases/tag/v1.9.0 - but now that it’s past, happy to support this effort - @PiotrZierhoffer bringing to your attention.

2reactions
ivankravetscommented, Mar 10, 2020

@carlosedp thanks for the great research! It can be easy integrated in PlatformIO. It will look for you as:

[env:hifive1]
platform = sifive
framework = zephyr
board = hifive1
monitor_speed = 115200
upload_tool = renode
debug_tool = renode

We will back soon to this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Renode
Renode is an open source software development framework with commercial support from Antmicro that lets you develop, debug and test multi-node device ...
Read more >
Testing with Renode
Renode is integrated with the Robot Framework testing suite and provides user-friendly scripts for running tests. It comes with a variety of prepared...
Read more >
Cortex-M MCU Emulation with Renode - Interrupt
Using that setup, we'll debug our firmware, run it through integrated tests, and shorten the iteration cycle of development. Like Interrupt?
Read more >
Renode — PlatformIO v6.1 documentation
Renode is a development framework which accelerates IoT and embedded systems development by letting you simulate physical hardware systems - including both ...
Read more >
Co-simulating ML with Springbok using Renode
IREE allows you to load models from typical ML frameworks such as ... on the target device or in a simulation environment like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found