Skip to content

Commit 2cddb61

Browse files
committed
platformio stealies
0 parents  commit 2cddb61

File tree

4,151 files changed

+1650706
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,151 files changed

+1650706
-0
lines changed

.mbedignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cores/arduino/mbed/*
2+
cores/arduino/api/Stream.h
3+
cores/arduino/api/deprecated/Stream.h
4+
cores/arduino/main.cpp
5+
libraries/openamp*
6+
cores/arduino/USB/*
7+
variants/*
8+
libraries/*

.piopm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"type": "tool", "name": "framework-arduino-mbed", "version": "2.6.1", "spec": {"owner": "platformio", "id": 11972, "name": "framework-arduino-mbed", "requirements": null, "url": null}}

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Arduino Core for mbed enabled devices
2+
3+
The repository contains the Arduino APIs and IDE integration files targeting a generic mbed-enabled board
4+
5+
## Installation
6+
7+
### Clone the repository in `$sketchbook/hardware/arduino-git`
8+
9+
```bash
10+
mkdir -p $sketchbook/hardware/arduino-git
11+
cd $sketchbook/hardware/arduino-git
12+
git clone git@github.com:arduino/ArduinoCore-mbed mbed
13+
```
14+
15+
### Clone https://github.com/arduino/ArduinoCore-API into a directory of your choice.
16+
17+
```bash
18+
git clone git@github.com:arduino/ArduinoCore-API
19+
```
20+
21+
### Update the `api` symlink
22+
23+
Create a symlink to `ArduinoCore-API/api` in `$sketchbook/hardware/arduino/mbed/cores/arduino`.
24+
25+
### Test things out
26+
27+
Open the Arduino IDE.
28+
29+
You should now see three new targets under the `MBED boards` label.
30+
31+
*This procedure does not automatically install the required ARM compiler toolchain.*
32+
33+
If the toolchain is missing, you'll see errors like this when you try to build for an mbed-os enabled board.:
34+
35+
```
36+
fork/exec /bin/arm-none-eabi-g++: no such file or directory
37+
```
38+
To install ARM build tools, use the `Boards Manager` option in the Arduino IDE to add the `Arduino mbed-enabled Boards` package.
39+
40+
41+
## Adding an mbed target
42+
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.
45+
46+
**Minimum Example**:
47+
```
48+
cd $sketchbook/hardware/arduino-git/mbed
49+
./mbed-os-to-arduino -r /home/alex/projects/arduino/cores/mbed-os-h747 PORTENTA_H7_M7:PORTENTA_H7_M7
50+
```
51+
52+
### How to build a debug version of the Arduino mbed libraries
53+
* Modify `mbed-os-to-arduino `
54+
```diff
55+
mbed_compile () {
56+
- PROFILE_FLAG=""
57+
if [ x"$PROFILE" != x ]; then
58+
PROFILE_FLAG=--profile="$ARDUINOVARIANT"/conf/profile/$PROFILE.json
59+
export PROFILE=-${PROFILE^^}
60+
+ else
61+
+ export PROFILE="-DEBUG"
62+
+ PROFILE_FLAG="--profile=debug"
63+
fi
64+
```
65+
66+
## Using this core as an mbed library
67+
68+
You can use this core as a standard mbed library; all APIs are under `arduino` namespace (so they must be called like `arduino::digitalWrite()` )
69+
70+
The opposite is working as well; from any sketch you can call mbed APIs by prepending `mbed::` namespace.
71+

bfg_nano33ble.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash -ex
2+
3+
# Extract nrf core history from main repo
4+
5+
cd /tmp
6+
7+
wget https://search.maven.org/classic/remote_content?g=com.madgag\&a=bfg\&v=LATEST -O bfg.jar
8+
9+
mkdir ArduinoCore-nRF52-mbed.git
10+
cd ArduinoCore-nRF52-mbed.git
11+
git init --bare
12+
cd ..
13+
14+
git clone git@github.com:bcmi-labs/ArduinoCore-mbed
15+
cd ArduinoCore-mbed
16+
git remote add nrf52 /tmp/ArduinoCore-nRF52-mbed.git
17+
#don't mess with origin
18+
git remote remove origin
19+
rm -rf variants/ENVIE*
20+
rm -rf variants/MBED*
21+
rm -rf examples*
22+
rm -rf cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_ENVIE
23+
rm -rf libraries/WiFi*
24+
sed -i '/.*envie.*$/ d' boards.txt
25+
sed -i '/.*odin.*$/ d' boards.txt
26+
sed -i 's/ENVIE_M4//g' platform.txt
27+
rm bfg*
28+
git commit -am "Add nano33 target"
29+
git push nrf52 master
30+
cd ..
31+
32+
java -jar bfg.jar --strip-blobs-bigger-than 50M --delete-folders "{ENVIE_M4,MBED_CONNECT_ODIN,MTB_UBLOX_ODIN_W2,DISCO_F429ZI,TARGET_ENVIE,openamp,OpenAMP,adafruit-nrfutil,rpclib,WiFi*,*OnMbed}" --delete-files="{RPC.*,RPC_*,bfg*,boards.txt}" /tmp/ArduinoCore-nRF52-mbed.git
33+
34+
cd /tmp/ArduinoCore-nRF52-mbed.git
35+
git filter-branch --prune-empty
36+
git reflog expire --expire=now --all && git gc --prune=now --aggressive
37+
git remote add origin git@github.com:bcmi-labs/ArduinoCore-nRF52-mbed
38+
git push origin master

0 commit comments

Comments
 (0)