Skip to main content

Programming

This guide describes how to program the FoBE Quill ESP32-S3 Mesh.

Arduino

If you use the Arduino IDE for programming, please see Quick Start - Setup the board.

The following describes how to program the FoBE Quill nRF52840 Mesh with Arduino using PlatformIO.

Install PlatformIO

You can follow the official guide of PlatformIO to complete the installation.

Add Platform repository

  1. Open the PlatformIO Home and navigate to Platforms.
  2. Click "Advanced Installation" button.
  3. Input the git repository url https://github.com/fobe-projects/fobe-nrf52-platformio.git#develop then click "Install" button, and wait for the installation to complete.

2025-07-19-02-24-59.png

Or you can use the pio command line tool to install:

pio pkg install --platform https://github.com/fobe-projects/fobe-nrf52-platformio.git#develop

Create a new project

  1. Open the PlatformIO Home and navigate to Projects.
  2. Click "New Project" button.
  3. Input the project name, select the board "FoBE Quill nRF52840 Mesh", and select the framework "Arduino".
  4. Click "Finish" button, waiting for the project created.

2025-07-19-02-04-49.png

  1. Open the src/main.cpp file and write your code.

2025-07-19-02-24-07.png

  1. Click the "Upload" button to compile and upload your code.

2025-07-19-02-25-52.png

MicroPython

MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.

The following describes how to program the FoBE Quill Esp32-S3 Mesh with MicroPython.

Releases

FoBE MicroPython Index

Preview builds

v1.26.0-preview(2025-07-19).uf2 / [.hex]

Install

To install the MicroPython firmware, follow these steps:

UF2 with USB Storage

  1. Download the latest firmware file with the .uf2 extension.
  2. Connect the FoBE Quill nRF52840 Mesh to your computer.
  3. Double-click the reset button on the device to enter bootloader mode.

2025-07-21-10-48-27.png

  1. Copy the .uf2 file to the device storage "FOBE BOOT".
  2. The device will reboot automatically, and the MicroPython firmware will be installed.

HEX with OpenOCD (CMSIS-DAP)

Hex files are used for programming the device using OpenOCD. Please make sure OpenOCD is installed and configured correctly.

  1. Download the latest firmware file with the .hex extension.
  2. Connect the FoBE Quill nRF52840 Mesh to your computer.
  3. Connect the debug interface (CMSIS-DAP) to the FoBE Quill nRF52840 Mesh.
  4. Open a terminal and run the following command:
openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg \
-c "init" -c "program <path_to_firmware.hex> verify reset" -c "exit"

Replace <path_to_firmware.hex> with the path to the downloaded .hex file.

Create a new project

Quickly create a MicroPython project:

# Create a new directory for the project
mkdir -p mpy-example
cd mpy-example

# Create a virtual environment
python3 -m venv ./.venv

# Activate the virtual environment
source .venv/bin/activate

# Install the required packages
pip3 install mpremote

# Create a new file named main.py
echo "print('Hello, FoBE Quill ESP32-S3 Mesh!')" > main.py

# Copy the main.py file to the device
mpremote cp main.py :

# Run the main.py file on the device
mpremote run main.py

# Or you can use the REPL to run the code interactively
mpremote repl

More information about the MicroPython REPL can be found in the MicroPython documentation.

Zephyr RTOS

The Zephyr OS is based on a small-footprint kernel designed for use on resource-constrained and embedded systems: from simple embedded environmental sensors and LED wearables to sophisticated embedded controllers, smart watches, and IoT wireless applications.

The following describes how to program the FoBE Quill ESP32-S3 Mesh with Zephyr RTOS.

Create a new project

Before you start, make sure you have Python installed on your system.

  1. Open Visual Studio Code and create a new folder for your project.

  2. Create a virtual environment for the project:

    # Create a new directory for the project
python3 -m venv .venv

# Activate the virtual environment
source .venv/bin/activate

# Install the required packages
pip install west
  1. Create .west/config file in the project directory with the following content:
    [manifest]
path = app
file = west.yml

[zephyr]
base = zephyr
  1. Create app folder and add some files like:
.west/
└── config
app/
├── CMakeLists.txt
├── prj.conf
├── west.yml
└── src
└── main.c

Add CMakeLists.txt file with the following content:

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(app)

target_sources(app PRIVATE src/main.c)

Add prj.conf file with the following content:

CONFIG_GPIO=y

Add west.yml file with the following content:

manifest:
remotes:
- name: zephyr
url-base: https://github.com/zephyrproject-rtos
- name: fobe
url-base: https://github.com/fobe-projects
projects:
- name: zephyr
remote: zephyr
revision: main
path: zephyr
import: true
- name: fobe-zephyr-sdk
remote: fobe
path: fobe
revision: main

Add src/main.c file with the following content:

#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>

/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000

/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

/*
* A build error on this line means your board is unsupported.
* See the sample documentation for information on how to fix this.
*/
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

int main(void)
{
int ret;
bool led_state = true;

if (!gpio_is_ready_dt(&led)) {
return 0;
}

ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
if (ret < 0) {
return 0;
}

while (1) {
ret = gpio_pin_toggle_dt(&led);
if (ret < 0) {
return 0;
}

led_state = !led_state;
printf("LED state: %s\n", led_state ? "ON" : "OFF");
k_msleep(SLEEP_TIME_MS);
}
return 0;
}
  1. Install and configure the Zephyr SDK:
# Update the west workspace in your project directory, it will download the Zephyr SDK and other dependencies
west update

# Install packages required for building the project
west packages pip --install

# Install the Zephyr SDK
west sdk install
  1. Build and flash the project:

Double-click the reset button on the device to enter bootloader mode, then run the following commands in the terminal:

# Build the project for the FoBE Quill ESP32-S3 Mesh board
west build -b fobe_quill_esp32s3/esp32s3/procpu/w ./app

# Flash the project to the board
west flash

Now you have a simple LED blinking example (Zephyr RTOS Standalone project) running on the FoBE Quill ESP32-S3 Mesh.

2025-07-21-13-38-07.png

More information about the Zephyr RTOS can be found in the Zephyr documentation.

You can also explore the FoBE Zephyr for more details on using the FoBE Zephyr SDK.