Mbed
- Configuration:
framework =
mbed
Arm Mbed OS is a platform operating system designed for the internet of things
Configuration
Configuration system
Warning
In Mbed OS 6 the list of supported boards was heavily reduced, only officially supported and well maintained targets left. More information in the official explanation.
PlatformIO allows you to customize Mbed OS compile time configuration
parameters using mbed_app.json
manifest. It should be placed into the root
of your project and located on the same level as “platformio.ini” (Project Configuration File).
Configuration is defined using JSON. Some examples of configuration parameters:
The sampling period for a data acquisition application.
The default stack size for a newly created OS thread.
The receive buffer size of a serial communication library.
The flash and RAM memory size of a target board.
See more details in the official ARM Mbed OS Configuration System.
A few PlatformIO-ready projects based on ARM Mbed OS which use mbed_app.json
:
Warning
On Windows the maximum length for a path (file name and directory route, also
known as MAX_PATH
) — has been defined by 260 characters which can lead to
compilation error for some targets. It’s possible to shorten these paths is to
install packages in root of any logical disk by specifying core_dir.
Using Bare Metal profile
The bare metal profile implements a subset of Mbed OS’s RTOS APIs that are useful in non-threaded applications, such as semaphores (calling the release API from interrupts) and tickers (to set up a recurring interrupt). It does not include an RTX, and is therefore suitable for applications that do not require complex thread management. Instead of the RTOS’s scheduler, all activities are polled or interrupt-driven.
Useful links:
Build profiles
By default, PlatformIO builds your project using develop profile
which provides
optimized firmware size with full error information and allows MCU to go to sleep mode.
In the case when default build profile is not suitable for your project there two other
profiles release
and debug
that can be enabled using special macro definitions.
You can change build profile build_flags of “platformio.ini” (Project Configuration File):
Name |
Description |
---|---|
|
Release profile (smallest firmware, minimal error info) |
|
Debug profile (largest firmware, disabled sleep mode) |
More information about differences between build profiles can be found on the official page ARM Mbed OS Build Profiles.
Ignoring particular components
In case you don’t need all parts of the framework or you want to reduce the compilation
time, you can explicitly exclude folders with redundant sources. For example, to remove
cellular
, kvstore
and nanostack
features from the build process, navigate
to the root of your project and create a new file .mbedignore
with the following
contents:
mbed-os/connectivity/cellular/*
mbed-os/connectivity/nanostack/*
mbed-os/storage/kvstore/*
Custom Targets
In case when your board is not officially supported by Mbed you can
manually add custom board definitions to your project. First of all, you need to create
a special file custom_targets.json
in the root folder of your project where you
describe your board, for example here is the configuration for NUCLEO-F401RE
board:
{
"NUCLEO_F401RE": {
"inherits": [
"MCU_STM32"
],
"supported_form_factors": [
"ARDUINO",
"MORPHO"
],
"core": "Cortex-M4F",
"extra_labels_add": [
"STM32F4",
"STM32F401xE"
],
"macros_add": [
"STM32F401xE"
],
"config": {
"clock_source": {
"help": "Mask value : USE_PLL_HSE_EXTC | USE_PLL_HSE_XTAL (need HW patch) | USE_PLL_HSI",
"value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
"macro_name": "CLOCK_SOURCE"
}
},
"detect_code": [
"0720"
],
"device_has_add": [
"SERIAL_ASYNCH",
"FLASH",
"MPU"
],
"device_name": "STM32F401RE"
}
}
Secondly, you need to add code specific to your target to the src
folder of your project.
Usually, it’s a good idea to isolate this code in a separate folder and add the path to this folder
to build_flags of “platformio.ini” (Project Configuration File):
[env:my_custom_board]
platform = nxplpc
framework = mbed
board = my_custom_board
build_flags = -I$PROJECT_SRC_DIR/MY_CUSTOM_BOARD_TARGET
Next, you need to inform PlatformIO that there is a new custom board. To do this, you can create
boards
directory in the root folder of your project and add a board manifest file with your
board name, e.g. my_custom_board.json
as described here Custom Embedded Boards
After these steps, your project structure should look like this:
project_dir
├── include
├── boards
│ └── my_custom_board.json
├── src
│ ├── main.cpp
│ └── MY_CUSTOM_BOARD_TARGET
│ ├── pinNames.h
│ └── pinNames.c
├── custom_targets.json
└── platformio.ini
- More information about adding custom targets can be found on the official page
See full examples with a custom board:
Platforms
Name |
Description |
---|---|
Freescale Kinetis Microcontrollers is family of multiple hardware- and software-compatible ARM Cortex-M0+, Cortex-M4 and Cortex-M7-based MCU series. Kinetis MCUs offer exceptional low-power performance, scalability and feature integration. |
|
Maxim’s microcontrollers provide low-power, efficient, and secure solutions for challenging embedded applications. Maxim’s processors embed cutting-edge technologies to secure data and intellectual property, proven analog circuitry for real-world applications, and battery-conserving low power operation. |
|
The nRF52 Series are built for speed to carry out increasingly complex tasks in the shortest possible time and return to sleep, conserving precious battery power. They have a Cortex-M4F processor which makes them quite capable Bluetooth Smart SoCs. |
|
The i.MX RT series of crossover processors features the Arm Cortex-M core, real-time functionality and MCU usability at a cost-effective price. |
|
The NXP LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals. |
|
GreenWaves GAP8 IoT application processor enables the cost-effective development, deployment and autonomous operation of intelligent sensing devices that capture, analyze, classify and act on the fusion of rich data sources such as images, sounds or vibrations. |
|
Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes devices that offer flash memory configurations up to 256 kB, 32 kB of RAM and CPU speeds up to 48 MHz. Based on the powerful ARM Cortex-M core, the Gecko family features innovative low energy techniques, short wake-up time from energy saving modes and a wide selection of peripherals, making it ideal for battery operated applications and other systems requiring high performance and low-energy consumption. |
|
The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development. |
Examples
Debugging
Debugging - “1-click” solution for debugging with a zero configuration.
Tools & Debug Probes
Supported debugging tools are listed in “Debug” column. For more detailed information, please scroll table by horizontal. You can switch between debugging Tools & Debug Probes using debug_tool option in “platformio.ini” (Project Configuration File).
Warning
You will need to install debug tool drivers depending on your system. Please click on compatible debug tool below for the further instructions.
On-Board Debug Tools
Boards listed below have on-board debug probe and ARE READY for debugging! You do not need to use/buy external debug probe.
Name |
Platform |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|
EFM32GG990F1024 |
48MHz |
1MB |
128KB |
||
MK64FN1M0VLL12 |
120MHz |
1MB |
256KB |
||
MK22FN512VLH12 |
120MHz |
512KB |
128KB |
||
MK64FN1M0VLL12 |
120MHz |
1MB |
256KB |
||
MK66FN2M0VMD18 |
180MHz |
2MB |
256KB |
||
MK82FN256VLL15 |
150MHz |
256KB |
256KB |
||
MKL25Z128VLK4 |
48MHz |
128KB |
16KB |
||
MKL43Z256VLH4 |
48MHz |
256KB |
32KB |
||
MKL46Z256VLL4 |
48MHz |
256KB |
32KB |
||
MKW41Z512VHT4 |
48MHz |
512KB |
128KB |
||
GAP8 |
250MHz |
64MB |
8MB |
||
STM32L476VGT6 |
80MHz |
1MB |
128KB |
||
MAX32600 |
24MHz |
256KB |
32KB |
||
LPC54114J256BD64 |
100MHz |
256KB |
192KB |
||
LPC54608ET512 |
180MHz |
512KB |
200KB |
||
MIMXRT1052DVL6B |
600MHz |
8MB |
32MB |
||
LPC1768 |
96MHz |
512KB |
64KB |
||
NRF52832 |
64MHz |
512KB |
64KB |
||
NRF52840 |
64MHz |
1MB |
256KB |
||
STM32G474RET6 |
170MHz |
512KB |
128KB |
||
STM32F401RET6 |
84MHz |
512KB |
96KB |
||
STM32L476RGT6 |
80MHz |
1MB |
128KB |
||
EFM32GG11B820F2048GL192 |
48MHz |
2MB |
512KB |
||
STM32F413ZHT6 |
100MHz |
1.50MB |
320KB |
||
STM32F429ZIT6 |
180MHz |
2MB |
256KB |
||
STM32F469NIH6 |
180MHz |
2MB |
384KB |
||
STM32F746NGH6 |
216MHz |
1MB |
320KB |
||
STM32F769NIH6 |
216MHz |
2MB |
512KB |
||
STM32L476VGT6 |
80MHz |
1MB |
128KB |
||
STM32L496AGI6 |
80MHz |
1MB |
320KB |
||
STM32L475VGT6 |
80MHz |
1MB |
96KB |
||
STM32L072CZ |
32MHz |
192KB |
20KB |
||
STM32F070RBT6 |
48MHz |
128KB |
16KB |
||
STM32F072RBT6 |
48MHz |
128KB |
16KB |
||
STM32F091RCT6 |
48MHz |
256KB |
32KB |
||
STM32F103RBT6 |
72MHz |
128KB |
20KB |
||
STM32F207ZGT6 |
120MHz |
1MB |
128KB |
||
STM32F303K8T6 |
72MHz |
64KB |
12KB |
||
STM32F303RET6 |
72MHz |
512KB |
64KB |
||
STM32F303ZET6 |
72MHz |
512KB |
64KB |
||
STM32F401RET6 |
84MHz |
512KB |
96KB |
||
STM32F411RET6 |
100MHz |
512KB |
128KB |
||
STM32F412ZGT6 |
100MHz |
1MB |
256KB |
||
STM32F413ZHT6 |
100MHz |
1.50MB |
320KB |
||
STM32F429ZIT6 |
180MHz |
2MB |
192KB |
||
STM32F439ZIT6 |
180MHz |
2MB |
256KB |
||
STM32F446RET6 |
180MHz |
512KB |
128KB |
||
STM32F446ZET6 |
180MHz |
512KB |
128KB |
||
STM32F746ZGT6 |
216MHz |
1MB |
320KB |
||
STM32F756ZG |
216MHz |
1MB |
320KB |
||
STM32F767ZIT6 |
216MHz |
2MB |
512KB |
||
STM32H723ZGT6 |
550MHz |
1MB |
320KB |
||
STM32H743ZIT6 |
400MHz |
2MB |
512KB |
||
STM32L073RZ |
32MHz |
192KB |
20KB |
||
STM32L152RET6 |
32MHz |
512KB |
80KB |
||
STM32L432KCU6 |
80MHz |
256KB |
64KB |
||
STM32L433RC |
80MHz |
256KB |
64KB |
||
STM32L476RGT6 |
80MHz |
1MB |
96KB |
||
STM32L486RGT6 |
80MHz |
1MB |
128KB |
||
STM32L496ZGT6 |
80MHz |
1MB |
320KB |
||
STM32L496ZGT6P |
80MHz |
1MB |
320KB |
||
STM32L4R5ZIT6 |
120MHz |
2MB |
640KB |
||
STM32H747XIH6 |
400MHz |
2MB |
512KB |
||
STM32F407VET6 |
168MHz |
512KB |
192KB |
||
LPC1768 |
96MHz |
512KB |
64KB |
||
STM32F439VI |
180MHz |
2MB |
256KB |
||
EFR32MG12P432F1024 |
40MHz |
1MB |
256KB |
External Debug Tools
Boards listed below are compatible with Debugging but DEPEND ON external debug probe. They ARE NOT READY for debugging. Please click on board name for the further details.
Name |
Platform |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|
MK64FN1M0VDC12 |
120MHz |
1MB |
256KB |
||
MAX32620FTHR |
96MHz |
2MB |
256KB |
||
STM32F411RET6 |
100MHz |
512KB |
128KB |
||
MAX32620 |
96MHz |
2MB |
256KB |
||
MAX32610 |
24MHz |
256KB |
32KB |
||
STM32L151CCU6 |
32MHz |
256KB |
32KB |
||
STM32L152RC |
32MHz |
256KB |
32KB |
||
STM32F103RBT6 |
72MHz |
128KB |
20KB |
||
NRF52832 |
64MHz |
512KB |
64KB |
||
STM32F103RBT6 |
72MHz |
128KB |
20KB |
Boards
Note
You can list pre-configured boards by pio boards command
For more detailed
board
information please scroll the tables below by horizontally.
Freescale
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
MK64FN1M0VLL12 |
120MHz |
1MB |
256KB |
||
On-board |
MK22FN512VLH12 |
120MHz |
512KB |
128KB |
||
On-board |
MK64FN1M0VLL12 |
120MHz |
1MB |
256KB |
||
On-board |
MK66FN2M0VMD18 |
180MHz |
2MB |
256KB |
||
On-board |
MK82FN256VLL15 |
150MHz |
256KB |
256KB |
||
On-board |
MKL25Z128VLK4 |
48MHz |
128KB |
16KB |
||
On-board |
MKL43Z256VLH4 |
48MHz |
256KB |
32KB |
||
On-board |
MKL46Z256VLL4 |
48MHz |
256KB |
32KB |
||
On-board |
MKW41Z512VHT4 |
48MHz |
512KB |
128KB |
Generic
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
STM32F103RBT6 |
72MHz |
128KB |
20KB |
GreenWaves Technologies
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
GAP8 |
250MHz |
64MB |
8MB |
Maxim
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
MAX32620FTHR |
96MHz |
2MB |
256KB |
||
No |
MAX32625 |
96MHz |
512KB |
160KB |
||
No |
MAX32625 |
96MHz |
512KB |
160KB |
||
On-board |
MAX32600 |
24MHz |
256KB |
32KB |
||
External |
MAX32620 |
96MHz |
2MB |
256KB |
||
No |
MAX32630 |
96MHz |
2MB |
512KB |
||
External |
MAX32610 |
24MHz |
256KB |
32KB |
MikroElektronika
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
MK64FN1M0VDC12 |
120MHz |
1MB |
256KB |
MultiTech
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
STM32F411RET6 |
100MHz |
512KB |
128KB |
||
External |
STM32L151CCU6 |
32MHz |
256KB |
32KB |
NXP
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
LPC54114J256BD64 |
100MHz |
256KB |
192KB |
||
On-board |
LPC54608ET512 |
180MHz |
512KB |
200KB |
||
On-board |
MIMXRT1052DVL6B |
600MHz |
8MB |
32MB |
||
On-board |
LPC1768 |
96MHz |
512KB |
64KB |
Nordic
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
NRF52832 |
64MHz |
512KB |
64KB |
||
On-board |
NRF52840 |
64MHz |
1MB |
256KB |
Olimex
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
STM32F103RBT6 |
72MHz |
128KB |
20KB |
RushUp
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
STM32F401RET6 |
84MHz |
512KB |
96KB |
||
On-board |
STM32L476RGT6 |
80MHz |
1MB |
128KB |
ST
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
STM32G474RET6 |
170MHz |
512KB |
128KB |
||
On-board |
STM32F413ZHT6 |
100MHz |
1.50MB |
320KB |
||
On-board |
STM32F429ZIT6 |
180MHz |
2MB |
256KB |
||
On-board |
STM32F469NIH6 |
180MHz |
2MB |
384KB |
||
On-board |
STM32F746NGH6 |
216MHz |
1MB |
320KB |
||
On-board |
STM32F769NIH6 |
216MHz |
2MB |
512KB |
||
On-board |
STM32L476VGT6 |
80MHz |
1MB |
128KB |
||
On-board |
STM32L496AGI6 |
80MHz |
1MB |
320KB |
||
On-board |
STM32L475VGT6 |
80MHz |
1MB |
96KB |
||
On-board |
STM32L072CZ |
32MHz |
192KB |
20KB |
||
On-board |
STM32F070RBT6 |
48MHz |
128KB |
16KB |
||
On-board |
STM32F072RBT6 |
48MHz |
128KB |
16KB |
||
On-board |
STM32F091RCT6 |
48MHz |
256KB |
32KB |
||
On-board |
STM32F103RBT6 |
72MHz |
128KB |
20KB |
||
On-board |
STM32F207ZGT6 |
120MHz |
1MB |
128KB |
||
On-board |
STM32F303K8T6 |
72MHz |
64KB |
12KB |
||
On-board |
STM32F303RET6 |
72MHz |
512KB |
64KB |
||
On-board |
STM32F303ZET6 |
72MHz |
512KB |
64KB |
||
On-board |
STM32F401RET6 |
84MHz |
512KB |
96KB |
||
On-board |
STM32F411RET6 |
100MHz |
512KB |
128KB |
||
On-board |
STM32F412ZGT6 |
100MHz |
1MB |
256KB |
||
On-board |
STM32F413ZHT6 |
100MHz |
1.50MB |
320KB |
||
On-board |
STM32F429ZIT6 |
180MHz |
2MB |
192KB |
||
On-board |
STM32F439ZIT6 |
180MHz |
2MB |
256KB |
||
On-board |
STM32F446RET6 |
180MHz |
512KB |
128KB |
||
On-board |
STM32F446ZET6 |
180MHz |
512KB |
128KB |
||
On-board |
STM32F746ZGT6 |
216MHz |
1MB |
320KB |
||
On-board |
STM32F756ZG |
216MHz |
1MB |
320KB |
||
On-board |
STM32F767ZIT6 |
216MHz |
2MB |
512KB |
||
On-board |
STM32H723ZGT6 |
550MHz |
1MB |
320KB |
||
On-board |
STM32H743ZIT6 |
400MHz |
2MB |
512KB |
||
On-board |
STM32L073RZ |
32MHz |
192KB |
20KB |
||
On-board |
STM32L152RET6 |
32MHz |
512KB |
80KB |
||
On-board |
STM32L432KCU6 |
80MHz |
256KB |
64KB |
||
On-board |
STM32L433RC |
80MHz |
256KB |
64KB |
||
On-board |
STM32L476RGT6 |
80MHz |
1MB |
96KB |
||
On-board |
STM32L486RGT6 |
80MHz |
1MB |
128KB |
||
On-board |
STM32L496ZGT6 |
80MHz |
1MB |
320KB |
||
On-board |
STM32L496ZGT6P |
80MHz |
1MB |
320KB |
||
On-board |
STM32L4R5ZIT6 |
120MHz |
2MB |
640KB |
||
On-board |
STM32H747XIH6 |
400MHz |
2MB |
512KB |
SeeedStudio
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
STM32F407VET6 |
168MHz |
512KB |
192KB |
||
On-board |
LPC1768 |
96MHz |
512KB |
64KB |
||
On-board |
STM32F439VI |
180MHz |
2MB |
256KB |
Semtech
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
External |
STM32L152RC |
32MHz |
256KB |
32KB |
Sigma Delta Technologies
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
No |
MAX32620IWG |
96MHz |
2MB |
256KB |
||
No |
MAX32625ITK |
96MHz |
512KB |
160KB |
||
External |
NRF52832 |
64MHz |
512KB |
64KB |
Silicon Labs
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
EFM32GG990F1024 |
48MHz |
1MB |
128KB |
||
On-board |
EFM32GG11B820F2048GL192 |
48MHz |
2MB |
512KB |
||
On-board |
EFR32MG12P432F1024 |
40MHz |
1MB |
256KB |
rhomb.io
Name |
Platform |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|---|
On-board |
STM32L476VGT6 |
80MHz |
1MB |
128KB |