Skip to content

Commit

Permalink
Add README, remove some no longer needed scripts, add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Feb 4, 2024
1 parent 25cb382 commit ab3a6e9
Show file tree
Hide file tree
Showing 9 changed files with 4,662 additions and 1,015 deletions.
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ add_subdirectory(mbed-os)

project(ArduinoCore-mbed-ce VERSION 1.0.0) # This is the version of the Mbed CE Arduino core, not of Mbed CE

if("${CMAKE_INSTALL_PREFIX}" STREQUAL "")
message(FATAL_ERROR "Must provide a CMAKE_INSTALL_PREFIX to generate the package at.")
endif()

# Figure out variant name. This is generally the same as the mbed target, but we need
# to handle a few variations (e.g. the _SWD variants of the mbed targets)
if("ARDUINO_NANO33BLE" IN_LIST MBED_TARGET_LABELS)
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Arduino Core for Mbed CE Arduino devices
This repository is a work-in-progress attempt to bundle Mbed CE as an Arduino core, so that Mbed CE can be used as a platform in the Arduino IDE. It is designed to perform a similar function as the mainline [ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed) repository while being significantly less janky.
This repository is a wrapper which bundles Mbed CE as an Arduino core so that Mbed CE can be used as a platform in the Arduino IDE. It is designed to perform a similar function as the mainline [ArduinoCore-mbed](https://github.com/arduino/ArduinoCore-mbed) repository while being a bit less janky.

The build scripts in this repo perform two distinct functions:
The CMake build scripts in this repo perform two distinct functions:
- Create a precompiled build of Mbed OS, and then install it plus the supporting files in the correct directory structure to be an Arduino core
- Compile the Arduino core library and dependency libraries in-place. This is purely done to check that they compile, and is not intended for actual usage (though theoretically you could use this repo to compile and link Mbed CE Arduino applications).
- Compile the Arduino core library and dependency libraries in-place. This is mainly done to check that they compile, and is not intended for actual usage (though you can use this repo to compile and link Mbed CE Arduino applications).

## Compiling an Arduino core for Mbed CE

1. Set up the toolchain as [described](https://github.com/mbed-ce/mbed-os/wiki/Toolchain-Setup-Guide) in the Mbed CE wiki.
2. Install Python dependencies. On Ubuntu >=22.04, run `xargs apt-get install -y < mbed-os/tools/requirements.apt.txt`. On other OSs, run `python3 -m pip install -r mbed-os/tools/requirements.txt`.
3. Create a build directory and cd into it: `mkdir build && cd build`
4. Configure CMake: `cmake .. -GNinja -DCMAKE_BUILD_TYPE=<Debug|Release> -DMBED_TARGET=<target> -DUPLOAD_METHOD=NONE`. The DCMAKE_BUILD_TYPE may be set to Debug or Release to generate a debug or release build of the core. The MBED_TARGET may be set to any supported target for this repo -- check the directory names under `variants/` to see each supported target.
5. Build: `ninja`
6. Generate the package: `ninja package`. This will generate a zip file containing the core in the build folder -- for example, mine is called `ArduinoCore-mbed-ce-RASPBERRY_PI_PICO-Develop-1.0.0.zip`.

## Installing the Core Locally

THe easiest way to install the core locally, per [here](https://support.arduino.cc/hc/en-us/articles/360021232160-How-to-install-and-use-a-custom-core-version-in-the-IDE), is to copy it to your sketchbook directory.
27 changes: 11 additions & 16 deletions extras/package_index.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"architecture": "mbed_nano",
"version": "@@VERSION@@",
"category": "Arduino",
"url": "http://downloads.arduino.cc/cores/staging/%%NANO_FILENAME%%",
"archiveFileName": "%%NANO_FILENAME%%",
"checksum": "SHA-256:%%NANO_CHECKSUM%%",
"size": "%%NANO_SIZE%%",
"url": "http://downloads.arduino.cc/cores/staging/%%ARDUINO_NANO33BLE_FILENAME%%",
"archiveFileName": "%%ARDUINO_NANO33BLE_FILENAME%%",
"checksum": "SHA-256:%%ARDUINO_NANO33BLE_CHECKSUM%%",
"size": "%%ARDUINO_NANO33BLE_SIZE%%",
"help": {
"online": "https://github.com/mbed-ce/ArduinoCore-mbed/issues"
"online": "https://github.com/mbed-ce/ArduinoCore-mbed-ce/issues"
},
"boards": [
{
Expand Down Expand Up @@ -49,25 +49,20 @@
"packager": "arduino",
"version": "0.10.0-arduino1",
"name": "dfu-util"
},
{
"packager": "arduino",
"version": "1.0.6",
"name": "rp2040tools"
}
]
},
{
"name": "Arduino Mbed CE RP2040 Boards",
"name": "Mbed CE RP2040",
"architecture": "mbed_rp2040",
"version": "%%VERSION%%",
"category": "Arduino",
"url": "http://downloads.arduino.cc/cores/staging/%%RP2040_FILENAME%%",
"archiveFileName": "%%RP2040_FILENAME%%",
"checksum": "SHA-256:%%RP2040_CHECKSUM%%",
"size": "%%RP2040_SIZE%%",
"url": "http://downloads.arduino.cc/cores/staging/%%RASPBERRY_PI_PICO_FILENAME%%",
"archiveFileName": "%%RASPBERRY_PI_PICO_FILENAME%%",
"checksum": "SHA-256:%%RASPBERRY_PI_PICO_CHECKSUM%%",
"size": "%%RASPBERRY_PI_PICO_SIZE%%",
"help": {
"online": "https://github.com/mbed-ce/ArduinoCore-mbed/issues"
"online": "https://github.com/mbed-ce/ArduinoCore-mbed-ce/issues"
},
"boards": [
{
Expand Down
Loading

0 comments on commit ab3a6e9

Please sign in to comment.