Skip to main content

CircuitPython

CircuitPython CircuitPython is a programming language designed to simplify experimenting and learning to code on low-cost microcontroller boards.

Compatible

FoBE Studio CircuitPython is a fork of the official CircuitPython repository with additional features and optimizations for FoBE hardware.

Install

To install the CircuitPython firmware, follow these steps:

BIN with ESPTool

Compatible with the following development boards

  • FoBE Quill ESP32S3 Mesh
important

Program your board using the esptool.py program, found here.

  1. Download the firmware file with the .bin extension.
  2. Connect the board to your computer using a USB-C cable.
  3. If you are putting CircuitPython on your board for the first time then you should first erase the entire flash using:
python3 -m esptool erase-flash
  1. Flash the firmware to the device using the following command:
python3 -m esptool --chip esp32s3 -b 921600 --before default-reset --after hard-reset \
write-flash --flash-mode dio --flash-size 4MB --flash-freq 80m 0x0 <path_to_firmware.bin>

Replace <path_to_firmware.bin> with the path to the downloaded .bin file. 5. After flashing, the device should reboot automatically. If it does not, press the RESET button on the board to start the CircuitPython firmware.

UF2 with USB Storage

Compatible with the following development boards

  • FoBE Quill ESP32S3 Mesh
  • FoBE Quill nRF52840 Mesh
  • FoBE IDEA Mesh Tracker C1

To install the CircuitPython firmware, follow these steps:

  1. Download the firmware file with the .uf2 extension.
  2. Connect the board Mesh to your computer using a USB-C cable.
  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 FOBEBOOT.
  2. After flashing, the device should reboot automatically. If it does not, press the RESET button on the board to start the CircuitPython firmware.

HEX with OpenOCD (CMSIS-DAP)

Compatible with the following development boards

  • FoBE Quill nRF52840 Mesh
  • FoBE IDEA Mesh Tracker C1

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

  1. Download the firmware file with the .hex extension.
  2. Connect the board to your computer using a USB-C cable.
  3. Connect the debug interface CMSIS-DAP to the board.
  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.

Creating an Application

Quickly create a CircuitPython application

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

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

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

# Install the required packages
pip3 install adafruit-ampy

# Create a new file named main.py
echo "print('Hello, CircuitPython!')" > main.py

# Copy the main.py file to the device
ampy --port <board_port> put main.py :

# Run the main.py file on the device
ampy --port <board_port> run main.py

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