Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

PlatformIO and Renode platforms

for embedded development

System On Chip Architecture


2022 - 2023
Outline

● Introduction to the tools


● Installation
● Usage and live demo
Outline

● Introduction to the tools


● Installation
● Usage and live demo
3 key components for embedded development
What kind of software/firmware:
• Firmware from a specific vendor (STM, NXP)
• OS, RTOS (Arm Mbed, Zephyr)

Where will it run:


• Hardware: DevKit (STM, NXP) or custom solution.
• Emulation (Renode)

How will you produce it and flash it:


• Custom IDE from vendor (STM32Cube Dev)
• IDE of preference (VSCODE) + CLI commands.
• Integrated platform (Platformio)
Renode & PlatformIO

Renode will allow us to emulate hardware, so we


can test and debug our code without the need for
physical boards.

PlatformIO will help us with the development,


building, flashing, debugging and general
management of our project.

(we will look at Zephyr in the next session)


Renode
Is a physical system emulator, which allows you to run firmware intended for
an embedded target in your PC.
The system is assembled from building blocks.
Layer 1: System On Chip (Like a STM32 chip)
• CPU (ARM)
• Buses and interfaces
• Memories and Memory interfaces
Layer 2: The device (Like a devkit from STM)
• SoC
• Sensor
• Actuators
• Radio module
Layer 3: Multi node systems (Full solution, for example a sensor network)
• Sensor Node
• Gateway and central processing unit.
Renode

Advantages of using Renode:


• Start development before your hardware is ready.
• Test your firmware without deploying racks of hardware.
• Shorten your iteration cycles by cutting out flash loading delays.
• Automate testing.
Some of the supported hardware
https://renode.readthedocs.io/en/latest/introduction/supported-boards.html
PlatformIO
Platform to enhance the design of embedded software / firmware:
• Pure Python so you can use it on any OS.
• CLI commands
• Multiple targets for the same source (configuration files)
• Plugin that allows integration with IDEs like VSCode
• Integrated debugger and Unit testing.

Currently supports:
• 48 platforms (STM32, raspberrypi etc)
• 25 development frameworks (STM32Cube, Zephyr)
• 1438 boards
• User can extend the support.

Currently Provides:
• 222 examples
• 13008 libraries (for specific components or tasks, like sensor
management)
Outline

● Introduction to the tools


● Installation
● Usage and live demo
Getting Renode
https://renode.io/#downloads

neon:~$ which renode neon:~$ renode --help


/usr/bin/renode usage: Renode.exe [options] [script]

neon:~$ renode --version Options:


Renode, version
1.13.2.18007 (9ab53ff7-
202210031000)
Configuration and Simple run.
/home/user/.config/renode/config
● Termsharp (default, developed by Renode)
[general] ● XTerm
terminal = GnomeTerminal
collapse-repeated-log-entries = True ● GnomeTerminal
log-history-limit = 1000 ● TerminalApp for macOS.

Termsharp includes several features (like displaying images)


and is by far the most tested front-end.

https://github.com/renode/renode/issues/173

https://github.com/antmicro/TermSharp/issues/5

neon:~/.platformio/penv$ renode
15:37:27.4942 [INFO] Loaded monitor
commands from:
/opt/renode/scripts/monitor.py
Getting PlatformIO
There are two options for installation:

● Install only PlatformIO Core: core and Command Line Tool.


● Install PlatformIO plugin for your IDE of choice
VSCode, Atom, CLion etc.

https://platformio.org/install
PlatformIO Core Only
PlatformIO is a python package, so for installation, as usual:
● Create a virtual Env
● Install the package with pip.

PlatformIO provides a script for this task, but you can also do it manually,
with your env manager of choice (conda or venv).
For MacOS you can use HomeBrew as well.

https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html

https://docs.platformio.org/en/latest/core/installation/methods/pypi.html

https://docs.platformio.org/en/latest/core/installation/methods/brew.html
PlatformIO Plugin for IDEs (VSCode)
Search and install the Platformio IDE extension.
Reboot VSCode.
https://docs.platformio.org/en/latest/integration/ide/vscode.html

The PlatformIO IDE extension will also create a venv and install the PlatformIO core. In
Linux, this venv will be under:

/home/user/.platformio/penv

You can also access the core directly from VSCode, using the command:
PlatformIO: Open PlatformIO Core CLI
This will automatically open a VSCode terminal with the penv activated.
To discover where the penv is, you can use which from this terminal:

$ which platformio
/home/user/.platformio/penv/bin/platformio
PlatformIO CLI commands
After you have installed PlatformIO following one of the two
methods, you can check if platformIO is working. From a terminal
with the penv activated you can use the platformio or pio
commands:
(penv) neon:~/.platformio/penv$ pio --help
Usage: pio [OPTIONS] COMMAND [ARGS]...

Options:
--version Show the version and exit.
-c, --caller TEXT Caller ID (service)
--no-ansi Do not print ANSI control characters
-h, --help Show this message and exit.

Commands:
access Manage resource access
account Manage PlatformIO account
boards Board Explorer
PlatformIO CLI / IDE commands.
Any of the PlatformIO IDE commands that you use from VSCode actually
executes a CLI command. You will not interact directly with the CLI most of
the time, but it is good to know at least some basic commands:

# Build project
$ pio run

# Upload firmware
$ pio run --target upload

# Build specific environment frdm_k64f


$ pio run -e frdm_k64f

# Upload firmware for the specific environment frdm_k64f


$ pio run -e frdm_k64f --target upload

# Clean build files


$ pio run --target clean
PlatformIO udev rules (for HW deployment)
(For Linux only)
If you want to use platformIO to flash / debug physical boards, you
need to install first the platformio udev rules.

$ curl -fsSL https://raw.githubusercontent.com/platformio/platformio-


core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-
platformio-udev.rules

Full instructions here:


https://docs.platformio.org/en/latest/core/installation/udev-rules.html
Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Sources for the demo at https://github.com/SoC-Arch-polito/ex22-pio-renode-uart
Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
PlatformIO project creation

Open a new VSCODE


window and use the
PlatformIO wizard to create
a new project:

● Name
● Board
● Framework
● Location
PlatformIO project structure
● .pio folder use for build files

● .vscode folder for configuration:


○ C/C++ configurations
○ Use platformio IDE as extension
○ Run / debug configurations.
● include / lib / test to be used by your
project

● src with and empty main.c

● zephyr folder (specific for the framework)

● .gitignore with .vscode and .pio folders

● platformio.ini
platformio.ini
Main configuration file for platformio.

INI format.

https://docs.platformio.org/en/latest/projectconf/index.html#

Allows you to define different environments. For each environment, you


must define:
● Platform (general architecture)
● Framework
● Board

[env:frdm_k64f]
platform = freescalekinetis
board = frdm_k64f
framework = zephyr
Sources
We now implement our app. It is a simple echo app, based on the zephyr
example “console_getline”.
https://docs.zephyrproject.org/2.6.0/samples/subsys/console/getline/README.html
The app will simply read lines from an UART, and will echo the lines back to the
user with some additional info.

For a zephyr app, we need three files:

CMakeLists.txt Already configured by platformio

prj.conf To be created, inside zephyr folder

main.c To be modified
prj.conf

CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETLINE=y
sources
main.c
#include <zephyr.h>
#include <version.h>
#include <string.h>
#include <sys/printk.h>
#include <console/console.h>

void main(void)
{
printk("Hello! I'm running Zephyr %s on %s, a %s board.\n\n ",
KERNEL_VERSION_STRING, CONFIG_BOARD, CONFIG_ARCH);

console_getline_init();
printk("Enter a line finishing with Enter:\n");
while (1)
{
printk("> ");
char *s = console_getline();
printk("Typed line: %s\n", s);
printk("Last char was: 0x%x\n", s[strlen(s) - 1]);
}
}
Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Building
There are several ways to trigger the building task from VSCode (by command, from the left
side panel, from the status bar)

At the end , all are going to execute the run command. You should see in the terminal the
following output:

Executing task: platformio run

Processing frdm_k64f (platform: freescalekinetis; board: frdm_k64f; framework: zephyr)

. . . . .

. . . . .

Linking .pio/build/frdm_k64f/firmware.elf
Checking size .pio/build/frdm_k64f/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 1.7% (used 4420 bytes from 262144 bytes)
Flash: [ ] 1.7% (used 17362 bytes from 1048576 bytes)
Building .pio/build/frdm_k64f/firmware.bin

=================================== [SUCCESS] Took 16.95 seconds=======================================

After a successful build, you should have a firmware.elf file in the .pio/build/env/ folder.
Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Very basic K64F platform description | .repl files

basic_k64f.repl
The absolute minimum The K64F has:
1MB of flash
components that we need to cpu: CPU.CortexM @ sysbus 256 KB of RAM
cpuType: "cortex-m4f"
describe a soc: nvic: nvic The size is expressed in bytes.

● CPU sram: Memory.MappedMemory @ sysbus 0x20000000


size: 0x30000
● RAM
● Storage sram_l: Memory.MappedMemory @ sysbus 0x1fff0000
size: 0x10000
● Clock
flash: Memory.MappedMemory @ sysbus 0x0
size: 0x100000
Specifically for our app:
● UART mcg: Miscellaneous.K6xF_MCG @ sysbus 0x40064000

uart0: UART.K6xF_UART @ sysbus 0x4006A000


Create a file with extension IRQ -> nvic@31
.repl (renode platform) and
nvic: IRQControllers.NVIC @ sysbus 0xE000E000
describe the k64f: systickFrequency: 120000000
IRQ -> cpu@0
Creating a machine
● Open renode monitor
● Create a new machine (node)

Once a machine is created, it contains only one peripheral - the system bus called simply
sysbus. There is no memory or CPU, so the machine is not yet ready to execute any code.

● Load the platform description


● Examine the peripherals

https://renode.readthedocs.io/en/latest/basic/machines.html#working-with-machines

(monitor) mach create “name”

(name) machine LoadPlatformDescription @file.repl

(name) peripherals

(name) sysbus.<peripheral>
Creating a machine
(monitor) help
Available commands:
Name | Description
================================================================================
alias : sets ALIAS.
allowPrivates : allow private fields and properties manipulation.
analyzers : shows available analyzers for peripheral.
commandFromHistory: executes command from history.
createPlatform : creates a platform.
currentTime : prints out and logs the current emulation virtual and real time
displayImage : Displays image in Monitor
execute : executes a command or the content of a VARIABLE.
help : prints this help message or info about specified command.
history : prints command history.
include : loads a monitor script, python code or a plugin class.
lastLog : Logs last n logs.
log : logs messages.
logFile : sets the output file for logger.
logLevel : sets logging level for backends.
mach : list and manipulate machines available in the environment.
macro : sets MACRO.
numbersMode : sets the way numbers are displayed.
path : allows modification of internal 'PATH' variable.
pause : pauses the emulation.
peripherals : prints list of registered and named peripherals.
python : executes the provided python command.
quit : quits the emulator.
require : verifies the existence of a variable.
runMacro : executes a command or the content of a MACRO.
set : sets VARIABLE.
showAnalyzer : opens a peripheral backend analyzer.
start : starts the emulation.
string : treat given arguments as a single string.
using : expose a prefix to avoid typing full object names.
verboseMode : controls the verbosity of the Monitor.
version : shows version information.
Creating a machine
Renode, version 1.13.2.18007 (9ab53ff7-202210031000)

(monitor) mach create "basic_k64f_mach"

(basic_k64f_mach) machine LoadPlatformDescription @Documents/polito/courses/soc-arch/tests/basic_k64f.repl

(basic_k64f_mach) peripherals
Available peripherals:

sysbus (SystemBus)

├── cpu (CortexM)
│ Slot: 0

├── flash (MappedMemory)
│ <0x00000000, 0x000FFFFF>

├── mcg (K6xF_MCG)
│ <0x40064000, 0x40065000>

├── nvic (NVIC)
│ <0xE000E000, 0xE000EFFF>

├── sram (MappedMemory)
│ <0x20000000, 0x2002FFFF>

├── sram_l (MappedMemory)
│ <0x1FFF0000, 0x1FFFFFFF>

└── uart0 (K6xF_UART)
<0x4006A000, 0x4006AFFF>
Creating a machine
(basic_k64f_mach) sysbus.mcg

The following methods are available:


- Void DebugLog (String message)
- Endianess GetEndianness (Endianess? defaultEndianness = null)
- IEnumerable<Tuple<String,IGPIO>> GetGPIOs ()
- Machine GetMachine ()
- String GetName ()
- Boolean HasGPIO ()
- Boolean IsHostEndian ()
- Void Log (LogLevel type, String message)
. . .
- Void WriteByteNotTranslated (Int64 address, Byte value)
- Void WriteDoubleWordNotTranslated (Int64 address, UInt32 value)
- Void WriteDoubleWordUsingByte (Int64 address, UInt32 value)
- Void WriteDoubleWordUsingByteBigEndian (Int64 address, UInt32 value)
- Void WriteWordNotTranslated (Int64 address, UInt16 value)
- Void WriteWordUsingByte (Int64 address, UInt16 value)
- Void WriteWordUsingByteBigEndian (Int64 address, UInt16 value)

Usage:
sysbus.mcg MethodName param1 param2 ...

(basic_k64f_mach) sysbus.sram Size


The following properties are available: 0x0000000000030000
- Int64 Size
available for 'get' (basic_k64f_mach) sysbus.sram_l Size
0x0000000000010000
Usage: (basic_k64f_mach) sysbus.flash Size
- get: sysbus.mcg PropertyName 0x0000000000100000
- set: sysbus.mcg PropertyName Value
Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Load binary

● Load the firmware


● Start the execution

https://renode.readthedocs.io/en/latest/basic/machines.html#working-with-machines

(name) sysbus LoadELF @firmware.elf


(name) start

(basic_k64f_mach) sysbus LoadELF @Documents/polito/courses/soc-


arch/tests/ConsoleEcho_k64f/.pio/build/frdm_k64f/firmware.elf

(basic_k64f_mach) start
Starting emulation...
Interact with the application: analyzers
The application is running, but nothing happened.
We need to open a communication with the UART. The easiest way is to use the
Analyzer capabilities of the UART peripheral.
(basic_k64f_mach) help analyzers
Usage:
------
analyzers [peripheral]
lists ids of available analyzer for [peripheral]

analyzers default [peripheral]


writes id of default analyzer for [peripheral]

(basic_k64f_mach) analyzers sysbus.cpu


No backend found for sysbus.cpu

(basic_k64f_mach) analyzers sysbus.uart0


Antmicro.Renode.UI.ConsoleWindowBackendAnalyzer (default)
Antmicro.Renode.Analyzers.LoggingUartAnalyzer

(basic_k64f_mach) using sysbus


(basic_k64f_mach) analyzers uart0
Antmicro.Renode.UI.ConsoleWindowBackendAnalyzer (default)
Antmicro.Renode.Analyzers.LoggingUartAnalyzer
Interact with the application: analyzers
(basic_k64f_mach) help showAnalyzer
Usage:
------
showAnalyzer ([externalName]) [peripheral] ([typeName])
shows analyzer for [peripheral]

[externalName] (optional) - if set, command will create external named [externalName]; this can be used
only for analyzers implementing IExternal interface

[typeName] (optional) - if set, command will select analyzer provided in class [typeName]; this must be
used when there are more than one analyzers available and no default is set

(basic_k64f_mach) showAnalyzer uart0


Interact with the application: exposing the UART
The analyzer is just a console, and it is hard to interact with it using scripts.
An alternative is to expose the UART to the host.

https://renode.readthedocs.io/en/latest/host-integration/uart.html

● Using a pty device (Linux/macOS only),


● Over a network socket (available on all platforms)
We will use the second approach which is available for all platforms.
We will use the emulator for this task. The emulator was not in the list of commands
we got with the help command before, because it is not a command but a
component.
To list all available commands and components, from the console simply type <TAB>
twice.
Interact with the application: exposing the UART
Type <TAB> twice: (basic_k64f_mach) emulation

The following methods are available:


(basic_k64f_mach) - Void AddExternalCamera (String device, String name = "camera")
commandFromHistory - Void AddHPSHostController (STM32F7_I2C device, String name =
"HPSHostController")
history - Void AddMachine (Machine machine, String name = "")
alias - IMACInterface CreateAndGetTap (String hostInterfaceName,
String name, Boolean persistent = False)
allowPrivates - Void CreateBLEMedium (String name)
analyzers - Void CreateCANHub (String name)
- Void CreateEnvironment (String environmentName)
connector - Void CreateFrameBufferTester (String name, Single
console_log timeoutInSeconds)
- Void CreateGPIOConnector (String name)
cpu
- Void CreateIEEE802_15_4Medium (String name)
createPlatform - Void CreateLEDTester (String name, ILed led)
- Void CreateNetworkInterfaceTester (String name, IMACInterface
currentTime
iface)
displayImage - Void CreateNetworkInterfaceTester (String name, IRadio iface)
dump - Void CreateNetworkServer (String name, String ipAddress)

dump_file - Void CreateServerSocketTerminal (Int32 port, String name,


echo Boolean emitConfig = True, Boolean flushOnConnect = False)

emulation - Void CreateSlipRadio (String name, String fileName)


EmulationManager - Void CreateSwitch (String name)
....
execute
Interact with the application: exposing the UART
Create a socket on a localhost port. Give it the name, so so can refer to it in renode. Then
connect the uart to this socket.
(basic_k64f_mach) emulation CreateServerSocketTerminal 3456 "term"
(basic_k64f_mach) connector Connect uart0 term

Then from a host terminal connect to the socket using


telnet IP PORT

neon:~$ telnet localhost 3456


Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Real K64F Platform
Renode already provides a preconfigured platform for the K64F.
When you install renode, it also downloads the preconfigured platforms.

You can access them using @platforms/…

machine LoadPlatformDescription @platforms/cpus/nxp-k6xf.repl

The @ operator allows you to access the filesystem, starting from:


● The same location where renode was launched.
● The installation folder of renode.

For this reason we can access either our own platform descriptions, or the ones provided
by renode by default.
Renode scripts and platforms: Examples
https://github.com/renode/renode

neon:~$ git clone git@github.com:renode/renode.git


neon:~$ cd renode
neon:~/renode $ git submodule update --init --recursive

.repl files describing cpus and boards

.resc and python scripts

.robot test files


https://renode.readthedocs.io/en/lat
est/introduction/testing.html
Renode scripts | .resc files
You can save all the commands you need create the emulation system in a script.
https://renode.readthedocs.io/en/latest/introduction/using.html#resc-scripts
:name: K64F
:description: This script runs a test example in the K64F

:just to type less


using sysbus

:create machine and load platform


mach create "K64F"
machine LoadPlatformDescription @platforms/cpus/nxp-k6xf.repl

:load binary
sysbus LoadELF @Documents/polito/courses/soc-
arch/tests/ConsoleEcho_k64f/.pio/build/frdm_k64f/firmware.elf

:show uart0 default analyzer


showAnalyzer uart0

:create socket for uart0 so that we can interact with it from the host
emulation CreateServerSocketTerminal 3456 "term"
connector Connect uart0 term

:start simulation
start
Renode scripts | include command
To call the script, simply use the include command.

(monitor) help include


include [ i ]
loads a monitor script, python code or a plugin class.

To load a script you have to provide an existing file name.

Supported file formats:


*.cs - plugin file
*.py - python script
other - monitor script

(monitor) include @Documents/polito/courses/soc-


arch/tests/load_consoleEcho_k64f.resc

After including the script, the simulation should start, the


analyzer should open, and you should be able to access the
uart from telnet.
Renode commands at startup
You can pass commands to be renode, to be executed after the monitor is configured.

neon:~$ renode --help


usage: Renode.exe [options] [script]

Options:

. . .

-e, --execute STRINGs separated by ';'


Execute command on startup (this option is exclusive with
startup script passed as an argument). May be used many times.

neon:~$ renode -e include Documents/polito/courses/soc-


arch/tests/load_consoleEcho_k64f.resc

Be careful, there is no @ in this case.


Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
Integration
We can indicate to platformIO that we want to use renode as our upload command.
https://docs.platformio.org/en/latest/plus/debug-tools/renode.html#renode
https://docs.platformio.org/en/stable/projectconf/section_env_upload.html

[env:frdm_k64f]
platform = freescalekinetis
board = frdm_k64f
framework = zephyr

; Custom upload settings for renode integration


upload_protocol = custom
upload_command = renode $UPLOAD_FLAGS
upload_flags =
-e include @load_consoleEcho_k64f.resc
Integration: a better way
There are two issues with the previous method:

1. In the previous example, there is a circular dependency between renode and


platformio, that can cause path issues.
● PlatformIO needs to know where the .resc script file is located.
● The .resc file needs to know where the .elf generated by platformIO is
located.

NOTE: in the previous example I had to modify the paths to make it work.

1. We have described a .resc file that we can not reuse for other apps that use
the same platform.

Solution:
● Common to the board: put it in the .resc file
● Specific to the application: put it in platformio.ini file
Integration: resc script with only what is common

k64f.resc

:name: K64F
:description: This script creates a machine and loads the K64F platform

:just to type less


using sysbus

:create machine and load platform


mach create "K64F"
machine LoadPlatformDescription @platforms/cpus/nxp-k6xf.repl
Integration: resc script with only what is common

We need a place to put our script file so that it can be accessed by renode easily.
You can discover the default renode path with:

(monitor) help path


path
allows modification of internal 'PATH' variable.

Current 'PATH' value is: /opt/renode;....


Default 'PATH' value is: /opt/renode

In our case is simply the installation folder. We can place our general k64f.resc file under:

/opt/renode/scripts/single-node/
Integration: platformio.ini with specific commands.

; Custom upload settings for renode integration


upload_protocol = custom
upload_command = renode $UPLOAD_FLAGS
upload_flags =
-e include @scripts/single-node/k64f.resc
-e sysbus LoadELF @$PROG_PATH
-e showAnalyzer uart0
-e emulation CreateServerSocketTerminal 3456 \"term\"
-e connector Connect uart0 term
-e start

NOTE:
$PROG_PATH resolves to our firmware.elf file.
In some platforms, $SOURCE resolves to firmware.elf

We need to escape the quotes using \


Outline

● Introduction to the tools


● Installation
● Usage and live demo
○ Create project with PlatformIO
○ Build binary with PlatformIO
○ Create emulation system in Renode
○ Run binary in Renode
○ Automatize Renode procedure
○ Integrate Platformio and Renode
○ Run binary in real hardware
platformio.ini for board
By default, platformio uploads the firmware to the board, so in our configuration we simply need to
delete everything related to renode. We can have two configurations like this:

[env]
platform = freescalekinetis
board = frdm_k64f
framework = zephyr

[env:frdm_k64f_renode]
; Custom upload settings for renode integration
upload_protocol = custom
upload_command = renode $UPLOAD_FLAGS
upload_flags =
-e include @scripts/single-node/k64f.resc
-e sysbus LoadELF @$PROG_PATH
-e showAnalyzer uart0
-e emulation CreateServerSocketTerminal 3456 \"term\"
-e connector Connect uart0 term
-e start

[env:frdm_k64f_board]
; empty as by default it will upload to the board.
platformio.ini for board

With two configurations, you need to select which


one you want to build or upload.
You can do so from the side panel of platformio:
Demo sources

The sources for the example that we have seen today are
available at:

https://github.com/SoC-Arch-polito/ex22-pio-renode-uart

You might also like