picofuse-objc

picofuse-objc

Picofuse is an SDK for developing embedded systems. You can use it to build applications that run on various boards and hosts, leveraging Objective-C and the provided frameworks. See the [examples](examples) for how to get started:

  1. Download the SDK from the releases on GitHub, for your host.
  2. Unpack it in /opt, or another absolute path of your choice.
  3. Set the PICOFUSE_SDK environment variable to the installation path, if it's not /opt/picofuse.
  4. Create your project from a copy of an example in the examples directory, such as helloworld.
  5. Run make to build your project on the host, or make DEVICES=<device> to build for a specific device: one of the project's JSON files, such as presto for presto.json, or a board, such as pico_w.

Documentation

Build it with make doc, which runs Doxygen in Docker and writes it to doc/.

Releases

Each release has a tarball for each host: linux-amd64, linux-arm64 (which covers a Raspberry Pi) and darwin-arm64. Each is a whole picofuse/ tree, to unpack in /opt: picofuse and picofuse-objc for the host, with picotool and testrunner, and for each board in boards.txt, with the [examples](examples) and the [tutorial](tutorial). A release is built with picofuse's release of the same tag, so picofuse is tagged first.

Building

picofuse-objc is built against an installed copy of picofuse, and is installed into the same place, so that the two make up one installation. That's /opt/picofuse, unless you set PREFIX to another absolute path for both.

This builds and installs the Objective-C runtime and the Foundation, Application, Graphics, Devices and Network frameworks:

A program links a framework other than Application with picofuse_objc_executable(... FRAMEWORKS Devices), which links only the parts it uses, and Devices brings Graphics with it. A window on a Mac or Linux needs SDL3, which picofuse finds when it's built.

A program describes its hardware in a JSON file beside its sources, one for each setup, such as examples/bricks/presto.json:

{ "board": "pimoroni_presto",
"display": { "@class": "PimoroniPresto", "size": 480, "clock": 200 } }

The frameworks themselves are still built for a board with PICO_BOARD, below.

Mac

Requirements:

brew install cmake pkgconf gcc openssl@3 libusb sdl3

Install picofuse, then test and install this:

# In picofuse
make install
# In picofuse-objc
make test
make install

Linux

Requirements on Debian (tested with trixie), where gobjc is the Objective-C compiler for GCC:

sudo apt install build-essential cmake git pkgconf gobjc libssl-dev libusb-1.0-0-dev libsdl3-dev

Install picofuse, then test and install this:

# In picofuse
make install
# In picofuse-objc
make test
make install

Pico boards

Requirements, in addition to CMake and pkg-config:

Install picofuse for the board, then this. For example, for a Pico 2 W:

# In picofuse
make PICO_BOARD=pico2_w BUILD_DIR=build-pico2_w install
# In picofuse-objc
make PICO_BOARD=pico2_w BUILD_DIR=build-pico2_w install