Skip to content

Commit 05ec13e

Browse files
committed
explain
1 parent 2cddb61 commit 05ec13e

File tree

1 file changed

+4
-68
lines changed

1 file changed

+4
-68
lines changed

README.md

Lines changed: 4 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,7 @@
1-
# Arduino Core for mbed enabled devices
1+
# Custom ArduinoCore-mbed
22

3-
The repository contains the Arduino APIs and IDE integration files targeting a generic mbed-enabled board
3+
This is a custom version of [ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed) which modifies some hardcoded values in `variants/RASPBERRY_PI_PICO` so that it works with my PCB business card project. It's unfortunate that I need to do this, and that you can't make your own variants without forking the entire thing.
44

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.
5+
Anyway, I just changed the `PIN_LED` to `31` since the v3 of the business card does not have a built-in LED, and the pin that it was set to before was `25`, which I am using for the Neopixels. This would potentially cause issues because it uses this for USB status indication (which I also disabled).
716

7+
Once I finish v4, this should no longer be needed, since there will actually be a status LED on pin 25 (the Neopixels were moved to 24).

0 commit comments

Comments
 (0)