Skip to content

Commit 24b0168

Browse files
committed
Update for bare metal area
There are questions commented out in the sources. There are some things I didn't know.
1 parent e1c3683 commit 24b0168

File tree

5 files changed

+31
-54
lines changed

5 files changed

+31
-54
lines changed

docs/api/api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
The Mbed OS RTOS capabilities include managing objects such as threads, synchronization objects and timers. It also provides interfaces for attaching an application-specific idle hook function, reads the OS tick count and implements functionality to report RTOS errors.
77

8-
98
<table>
109
<tbody>
1110
<tr>
Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
# Mbed OS bare metal profile
22

3-
There are many use cases for IoT devices. Different use cases require different configurations, connectivity and security. They also have different requirements for resource consumption. Many products must operate in ultraconstrained environments on tiny MCUs with low memory and compute power available. We created the Mbed OS bare metal profile for IoT devices that require ultraconstrained resources.
3+
Bare metal is a profile of Mbed OS for ultraconstrained devices. Unlike the full Mbed OS, which by default includes all APIs, the bare metal profile starts with a minimal set of APIs to which you can add only the APIs your application or hardware demand. This helps you control the size of your final binary.<!--not sure that's a good term-->
44

5-
<span class="images">![Mbed OS bare metal profile block diagram](../../images/bare_metal_block_diagram.png)<span>Mbed OS bare metal profile block digram</span></span>
5+
Bare metal doesn't use the RTOS APIs. Instead, it relies on timers to control the workflow.
6+
<!--not sure I get it - I looked at both Blinky examples and they both use thread_sleep_for, even though the bare metal one doesn't include mbed_thread.h-->
7+
<!--what other APIs does it have or not have by default?-->
8+
9+
The Mbed OS tools - Mbed CLI, Mbed Online Compiler and Mbed Studio all support working with the bare metal profile.
610

7-
The Mbed OS bare metal profile is a compact profile of Mbed OS without an RTOS. The Mbed OS bare metal profile is API compatible with Mbed OS and supports a subset of Mbed OS features, such as analog I/O, digital I/O, timers and digital interfaces, such as SPI, I2C, Serial and CAN. Mbed Studio, Mbed CLI and the Mbed Online Compiler all support the Mbed OS bare metal profile.
11+
Note that Mbed TLS and Mbed Crypto are not supported for bare metal.
12+
13+
<span class="images">![Mbed OS bare metal profile block diagram](../../images/bare_metal_block_diagram.png)<span>Mbed OS bare metal profile block digram</span></span>
814

9-
| Features | Mbed OS bare metal | Mbed OS |
10-
| --- | --- | --- |
11-
| Analog I/O | Available | Available |
12-
| Digital I/O | Available | Available |
13-
| Digital interfaces | Available | Available |
14-
| Timers | Available | Available |
15-
| Development tools<br> (For example, Mbed CLI, Mbed Studio, Mbed Online Compiler, GCC, Arm Compiler 6 and so on) | Available | Available |
16-
| Support for Mbed Enabled development boards | Available | Available |
17-
| RTOS | Not available | Available |
18-
| Storage | Ecosystem libraries | Available |
19-
| Mbed TLS | Not available | Available |
20-
| Mbed PSA | Not available | Available |
15+
## Documentation
2116

22-
To begin using the Mbed OS bare metal profile from Mbed OS 2, please follow our [instructions](../tutorials/migrating-to-mbed-os-5.html).
17+
- To see how to enable the profile, or to try the bare metal Blinky, see [our example page]().
18+
- To learn how to add APIs, [see the bare metal API page]().
19+
- If you're an Mbed OS 2 user, migrate to the Mbed OS 6 bare metal profile by following [our migration guide]().<!--that's not application develoeprs though, right? it's for hardware people?-->
Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,26 @@
11
# Bare metal APIs
22

3-
Mbed OS bare metal supports the following APIs:
3+
The bare metal profile starts with a restricted list of API, to which you can add what you need. However, bare metal doesn't support all Mbed OS APIs.
44

5-
<h2 id="analog-i-o">Analog I/O</h2>
5+
## Initial list of APIs
66

7-
- AnalogIn - Read the voltage applied to an analog input pin.
8-
- AnalogOut - Set the voltage of an analog output pin.
7+
By default, bare metal includes the following APIs:
98

10-
<h2 id="digital-i-o">Digital I/O</h2>
9+
## Adding APIs
1110

12-
- DigitalIn - Configure and control a digital input pin.
13-
- DigitalOut - Configure and control a digital output pin.
14-
- DigitalInOut - Bidirectional digital pins.
11+
<!--how?-->
1512

16-
- BusIn - Flexible way to read multiple DigitalIn pins as one value.
17-
- BusOut - Flexible way to write multiple DigitalOut pins as one value.
18-
- BusInOut - Flexible way to read and write multiple DigitalInOut pins as one value.
13+
## Full list of APIs
1914

20-
- PortIn - Fast way to read multiple DigitalIn pins as one value.
21-
- PortOut - Fast way to write multiple DigitalOut pins as one value.
22-
- PortInOut - Fast way to read and write multiple DigitalInOut pins as one value.
15+
The [Mbed OS API list]() indicates which APIs are supported by bare metal.
2316

24-
- PwmOut - Pulse-width modulated output.
17+
<!--
18+
Evelyne, my suggestion is to use something like
2519
26-
- InterruptIn - Trigger an event when a digital input pin changes.
2720
28-
<h2 id="timers">Timers</h2>
21+
| API | Full Mbed OS | Bare metal |
22+
| - | - | - |
23+
| AnalogIn | &#9745; | &#9745; |
2924
30-
- Timer - Create, start, stop and read a timer.
31-
- Timeout - Call a function after a specified delay.
32-
- Ticker - Repeatedly call a function.
33-
34-
- Wait - Wait for a specified time.
35-
- Time - Get and set the realtime clock.
36-
37-
<h2 id="digital-interfaces">Digital Interfaces</h2>
38-
39-
- Serial - Serial/UART bus.
40-
41-
- SPI - SPI bus master.
42-
- SPISlave - SPI bus slave.
43-
44-
- I2C - I²C bus master.
45-
- I2CSlave - I²C bus slave.
46-
47-
- CAN - Controller-area network bus.
25+
Although it's a bit silly, because of course it's supported in the full Mbed OS... I'd love some suggestions
26+
-->

docs/program-setup/bare_metal/baremetal_example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bare metal example
22

3-
To enable Mbed OS bare metal, create an `mbed_app.json` with the following contents:
3+
By default, Mbed OS is built in full whenever you create an application binary. To build only the bare metal profile, create an `mbed_app.json` in your application with the following contents:
44

55
```
66
{

docs/program-setup/bare_metal/c_small_libs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<h1 id="using-small-c-libraries">Using small C libraries in Mbed OS bare metal</h1>
2-
2+
<!--is this page for app developers? do we expect them to always manually specify for their app that they want to use bare metal?-->
3+
<!--I'm also intriggued by the phrasing "if your application doesn't use an RTOS". Of course it doesn't; we're talking about bare metal-->
4+
<!--in other words: who should read this page, and when/why?-->
35
If your application does not use an RTOS, build it in the bare metal mode to achieve memory savings. Both the `ARM` and `GCC_ARM` toolchains support code optimized versions of their C standard libraries, `microlib` and `newlib-nano`. It is safe to use these smaller C libraries in bare metal mode, and we recommend using them.
46

57
You can build with the smaller C libraries by creating an `mbed_app.json` with the following contents:

0 commit comments

Comments
 (0)