We’re happy to announce the next release of PlatformIO Core 4.3!
What is new
- Initial support for an official PlatformIO for CLion IDE plugin:
- Smart C and C++ editor
- Code refactoring
- On-the-fly code analysis
- “New PlatformIO Project” wizard
- Building, Uploading, Testing
- Integrated debugger (inline variable view, conditional breakpoints, expressions, watchpoints, peripheral registers, multi-thread support, etc.)
-
Device Monitor 2.0
- Added PlatformIO Device Monitor Filter API (dev-platforms can extend base device monitor with a custom functionality, such as exception decoding) (pull #3383)
- Configure project device monitor with monitor_filters option
-
Capture device monitor output to a file with
log2file
filter (issue #670) - Show a timestamp for each new line with
time
filter (issue #981) - Send a text to device on ENTER with
send_on_enter
filter (issue #926) - Show a hexadecimal representation of the data (code point of each character) with
hexlify
filter
- New standalone (1-script) PlatformIO Core Installer
- Initial support for Renode simulation framework (issue #3401)
- Added support for Arm Mbed “module.json”
dependencies
field (issue #3400) - Improved support for Arduino “library.properties”
depends
field - Other improvements and bug fixes.
See PlatformIO 4.3.0 Release Notes for details.
PlatformIO for CLion
The CLion is a cross-platform C/C++ IDE for Linux, OS X, and Windows. CLion includes such features as a smart editor, code generation, code quality assurance, automated refactorings, on-the-fly code analysis, project manager, integrated version control systems and debugger.
We are thrilled to announce a new native IDE’s plugin for PlatformIO - it’s PlatformIO for CLion! This is an official plugin by JetBrains Team. It’s still experimental but we would be thankful for your feedback!
Device Monitor 2.0
We have finally found a time and extended PlatformIO Device Monitor with a new feature called Filters. You can apply an unlimited number of filters to the device’s I/O.
We also introduced Device Monitor Filter API which can be used for writing the custom filters for dev-platform. A great example is the exception decoder for ESP8266/ESP32 (big THANK YOU to Vojtěch Boček for his huge contribution!):
- platform-espressif32/monitor at develop · platformio/platform-espressif32 · GitHub
- platform-espressif8266/monitor at develop · platformio/platform-espressif8266 · GitHub
Please note that you can configure filters per-project environment using “platformio.ini” (Project Configuration File) and monitor_filters:
[env:log_output_to_file]
...
platform = ...
monitor_filters = log2file, time, default
Here are a few useful filters:
Filter “time”
Show timestamp with milliseconds for each new line. Please do not forget to apply the default
filter too.
$ pio device monitor -b 115200 -f time -f default
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on /dev/cu.usbmodem0009790006261 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
15:43:24.907 > threadA: Hello World from hifive1_revb!
15:43:24.912 > threadB: Hello World from hifive1_revb!
15:43:25.459 > threadA: Hello World from hifive1_revb!
15:43:26.005 > threadB: Hello World from hifive1_revb!
15:43:26.552 > threadA: Hello World from hifive1_revb!
15:43:27.099 > threadB: Hello World from hifive1_revb!
Filter “log2file”
Log data to a file “platformio-device-monitor-%date%.log” located in the current working directory
$ pio device monitor -b 115200 -f log2file -f time -f default
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Logging an output to platformio-device-monitor-200320-154738.log
--- Miniterm on /dev/cu.usbmodem0009790006261 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
15:47:38.660 > threadA: Hello World from hifive1_revb!
15:47:38.665 > threadB: Hello World from hifive1_revb!
15:47:39.213 > threadA: Hello World from hifive1_revb!
15:47:39.759 > threadB: Hello World from hifive1_revb!
15:47:40.307 > threadA: Hello World from hifive1_revb!
Filter “hexlify”
Show a hexadecimal representation of the data (code point of each character)
$ pio device monitor -b 115200 -f hexlify
--- Available filters and text transformations: colorize, debug, default, direct, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at http://bit.ly/pio-monitor-filters
--- Miniterm on /dev/cu.usbmodem0009790006261 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
0000 | 74 68 72 65 61 64 42 3A 20 48 65 6C 6C 6F 20 57
0010 | 6F 72 6C 64 20 66 72 6F 6D 20 68 69 66 69 76 65
0020 | 31 5F 72 65 76 62 21 0D 0A 74 68 72 65 61 64 41
0030 | 3A 20 48 65 6C 6C 6F 20 57 6F 72 6C 64 20 66 72
0040 | 6F 6D 20 68 69 66 69 76 65 31 5F 72 65 76 62 21
0050 | 0D 0A 74 68 72 65 61 64 42 3A 20 48 65 6C 6C 6F
0060 | 20 57 6F 72 6C 64 20 66 72 6F 6D 20 68 69 66 69
0070 | 76 65 31 5F 72 65 76 62 21 0D 0A 74 68 72 65 61
0080 | 64 41 3A 20 48 65 6C 6C 6F 20 57 6F 72 6C 64 20
0090 | 66 72 6F 6D 20 68 69 66 69 76 65 31 5F 72 65 76
Renode Hardware Simulation
Renode is a development framework which accelerates IoT and embedded systems development by letting you simulate physical hardware systems - including both the CPU, peripherals, sensors, environment and wired or wireless medium between nodes.
This is initial support inside PlatformIO Core and we work an integration Renode into our dev-platforms.
This feature could not be added to PlatformIO without great research by Carlos Eduardo, RISC-V Ambassador / Red Hat. More details in his amazing article Developing Zephyr RTOS embedded applications on PlatformIO and simulating on Antmicro Renode.
Demo
To use Renode with PlatformIO just set debug_tool = renode. Pleate take a look at a demo for Zephyr RTOS Synchronization example:
platformio.ini
[env:hifive1-revb]
platform = https://github.com/platformio/platform-sifive.git
framework = zephyr
board = hifive1-revb
build_type = debug
monitor_speed = 115200
debug_init_break = tbreak bg_thread_main
debug_tool = renode
Upgrade
- PlatformIO IDE: Left Sidebar > PlatformIO (icon) > Quick Access > Upgrade PlatformIO Core
-
Terminal: Please run
pio upgrade
command in terminal.
Regards,
Your friends at PlatformIO