You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-17
Original file line number
Diff line number
Diff line change
@@ -37,30 +37,63 @@ fork/exec /bin/arm-none-eabi-g++: no such file or directory
37
37
```
38
38
To install ARM build tools, use the `Boards Manager` option in the Arduino IDE to add the `Arduino mbed-enabled Boards` package.
39
39
40
+
## mbed-os-to-arduino script
40
41
41
-
## Adding an mbedtarget
42
+
The backbone of the packaging process is https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino script. It basically compiles a blank mbed-os project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location.
42
43
43
-
Adding a target is a mostly automatic procedure that involves running https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino after setting the `BOARDNAME` and `ARDUINOCORE` env variables.
44
-
Actions marked as TODO must be executed manually.
44
+
It can be used for a variety of tasks including:
45
+
46
+
**Recompiling libmbed with source level debug support**
47
+
48
+
```
49
+
cd $sketchbook/hardware/arduino-git/mbed
50
+
./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7
51
+
```
52
+
53
+
In this case `-a` applies all the patches from `patches` folder into a mainline `mbed-os` tree, and `-g` restores the debug info.
54
+
55
+
**Selecting a different optimization profile**
56
+
57
+
```
58
+
cd $sketchbook/hardware/arduino-git/mbed
59
+
PROFILE=release ./mbed-os-to-arduino -a NANO_RP2040_CONNECT:NANO_RP2040_CONNECT
60
+
```
61
+
62
+
The `PROFILE` environment variable tunes the compilation profiles (defaults to `DEVELOP`). Other available profiles are `DEBUG` and `RELEASE`.
This will produce almost all the files needed. To complete the port, add the board specifications to `boards.txt` (giving it an unique name) and provide `pins_arduino.h` and `variants.cpp` in `variants/$ALREADY_SUPPORTED_BOARD_NAME` folder.
89
+
Feel free to take inspirations from the existing variants :)
90
+
91
+
For boards not supported by mainline `mbed-os`, the same applies but you should provide the path of your `mbed-os` fork
0 commit comments