# Cortex-M MCU Emulation with Renode | Interrupt

**URL:** <https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163>\
**Category:** Blog\
**Created:** [March 25, 2020, 7:40am UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163 "2020-03-25T07:40:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![discobot](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.memfault.com/discobot/32/1_2.png) [@discobot](https://community.memfault.com/u/discobot)\
**Post date:** [March 25, 2020, 7:40am UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/1 "2020-03-25T07:40:17Z")

</div>

In this new era of work-from-home, firmware engineer may not have all the equipment and development board they are used to having at the office. One way around this? Emulation!

* * *
This is a companion discussion topic for the original entry at [https://interrupt.memfault.com/blog/intro-to-renode](https://interrupt.memfault.com/blog/intro-to-renode)

---

<div class="post-metadata">

**Author:** ![Rajah](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rajah](https://community.memfault.com/u/Rajah)\
**Post date:** [March 26, 2020, 7:17pm UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/2 "2020-03-26T19:17:06Z")

</div>

Great post, thanks, I have been looking for something like this for embedded emulation

---

<div class="post-metadata">

**Author:** ![gsf](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@gsf](https://community.memfault.com/u/gsf)\
**Post date:** [March 28, 2020, 1:40am UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/3 "2020-03-28T01:40:04Z")

</div>

thanks for sharing.

I have a try and it’s quite impressive.

seems quite promising to solve the “I do not have xxx board yet” problem : )

---

<div class="post-metadata">

**Author:** ![mastupristi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.memfault.com/mastupristi/32/32_2.png) [@mastupristi](https://community.memfault.com/u/mastupristi)\
**Post date:** [March 28, 2020, 4:56pm UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/4 "2020-03-28T16:56:02Z")

</div>

This is a great post and renode is a great tool.  
I can’t find a community to ask questions about renode.  
The question is probably the most popular: _is my controller/board supported?_  
I think I found the answer to that question: (unfortunately) no. I am referring to the [NXP i.MX RT105x](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/i-mx-rt-crossover-mcus/i-mx-rt1050-crossover-mcu-with-arm-cortex-m7-core:i.MX-RT1050) controller. The board is custom, but I’d be fine with [EVKB](https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1050-evaluation-kit:MIMXRT1050-EVK) support, too.

So let’s move on to the second question: _is it possible (and how) to add support for the i.MX RT105x controller and its peripherals like UART, Eth, etc.?_  
Is it enough to write some `.repl` files or is it necessary to modify the source code?

best regards  
Max

---

<div class="post-metadata">

**Author:** ![francois](https://avatars.discourse-cdn.com/v4/letter/f/77aa72/32.png) [@francois](https://community.memfault.com/u/francois)\
**Post date:** [March 31, 2020, 1:52am UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/5 "2020-03-31T01:52:20Z")

</div>

It looks like the NXP i.MX is not yet supported. To add support, you’ve got a few options as best I can tell:

1. Write Peripherals in C# (e.g. [https://github.com/renode/renode-infrastructure/blob/master/src/Emulator/Peripherals/Peripherals/I2C/STM32F4\_I2C.cs](https://github.com/renode/renode-infrastructure/blob/master/src/Emulator/Peripherals/Peripherals/I2C/STM32F4_I2C.cs))
2. There is also a way to implement peripherals as Python scripts, but I’m not sure the interface is complete enough to implement a full MCU peripheral
3. Get in touch with the folks at Antmicro and convince/pay them to add support (which they do as part of their business).

I’m sorry this isn’t the answer you were hoping for. The silver lining here is that the peripheral interface is simple & clean, so it’s much simpler to implement your own than it would be for QEMU.

Cheers,

François.

---

<div class="post-metadata">

**Author:** ![adamsanta](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@adamsanta](https://community.memfault.com/u/adamsanta)\
**Post date:** [August 30, 2022, 2:13pm UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/6 "2022-08-30T14:13:09Z")

</div>

Hello, great introduction to Renode, thanks a lot !  
From my side I had to enter “showAnalyzer sysbus.usart2” instead of “showAnalyzer sysbus.uart2” to show the “hello world”.  
Also, I had to launched Renode in telnet mode (-T) so I could use a french keyboard mapping (apparently not available directly in the Renode terminal).

---

<div class="post-metadata">

**Author:** ![Jimmy2027](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jimmy2027](https://community.memfault.com/u/Jimmy2027)\
**Post date:** [January 10, 2024, 2:28pm UTC](https://community.memfault.com/t/cortex-m-mcu-emulation-with-renode-interrupt/163/7 "2024-01-10T14:28:59Z")

</div>

I’m trying out the example and everything works fine when running the sim manually: I see “hello world” and the “button pressed” prompt.

However, when I try to run `renode-test tests/test-button.robot` it gets stuck at:

```auto
Preparing suites
Started Renode instance on port 49152; pid 8998
Starting suites
Running tests/test-button.robot
+++++ Starting test 'test-button.Should Handle Button Press'

```

When I kill it I get the following output:

```auto
Second signal will force exit.
!!!!! Emulation's state saved to "/home/hendrik/projects/renode/hello_world/renode/snapshots/test-button.Should_Handle_Button_Press.fail.save"
!!!!! Log saved to "/home/hendrik/projects/renode/hello_world/renode/logs/test-button.Should_Handle_Button_Press.log"
+++++ Finished test 'test-button.Should Handle Button Press' in 16.30 seconds with status failed
      ╔═
      ║ Execution terminated by signal
      ║
      ║ Also teardown failed:
      ║ Several failures occurred:
      ║
      ║ 1) Connection to remote server broken: [Errno 104] Connection reset by peer
      ║
      ║ 2) Connection to remote server broken: [Errno 111] Connection refused
      ║
      ║ 3) Connection to remote server broken: [Errno 111] Connection refused
      ║
      ║ 4) Connection to remote server broken: [Errno 111] Connection refused
      ╚═
Suite tests/test-button.robot failed in 16.62 seconds.
Cleaning up suites
Closing Renode pid 8998
Aggregating all robot results
Output: /home/hendrik/projects/renode/hello_world/renode/robot_output.xml
Log: /home/hendrik/projects/renode/hello_world/renode/log.html
Report: /home/hendrik/projects/renode/hello_world/renode/report.html
Some tests failed :( See the list of failed tests below and logs for details!
Failed robot critical tests:
        1. Test Suite.Should Handle Button Press
------

```

Does someone know what I might be missing?
