Software/Arduino Core

Arduino Core Overview

The Neuro N6 Arduino core is the board support package that allows the Neuro N6 to be programmed from the Arduino IDE.

beginner4 min read

The Neuro N6 Arduino core is the board support package for the Neuro N6, a development board by Ohm Lab built around the STMicroelectronics STM32N657 microcontroller. The core implements the standard Arduino API on the board and adds a vision API, a neural network build pipeline and a set of libraries for the board's camera, display, sensors and radios. It is distributed as a git repository under the MIT licence and is installed into the Arduino sketchbook's hardware folder.

Hardware supported

ComponentDetail
MicrocontrollerSTM32N657I0, Arm Cortex-M55 at 800 MHz with Helium and a double precision FPU, and a Neural-ART neural processing unit (NPU) at 1 GHz, 600 GOPS
CameraOmniVision OV5640, 5 MP rolling shutter, or ST VD66GY, 1.5 MP global shutter, over two-lane MIPI CSI-2
Display800x480 RGB565 LCD with capacitive touch and a speaker, on the TFT and TFT-W carriers
Memory4.2 MB on-chip SRAM, 64 MB external PSRAM and 32 MB external flash over OctoSPI. The MCU has no internal flash
USBUSB-C, high speed, presenting a CDC serial port and a vendor bulk video endpoint
Wirelessu-blox MAYA-W476 WiFi and Bluetooth LE module, on the OV5640-W and TFT-W carriers
On-board sensorsLSM6DSL inertial unit, MMC5603NJ magnetometer, MP34DT05-A PDM microphone, on the Neuro N6
Module sensorsVL53L1CB time of flight and strobe LED on the OV5640, TFT and STCam modules; FLIR Lepton on the Thermal module
Form factorAdafruit Feather compatible header

Components of the core

The core is a single repository with the following layout.

PathContents
cores/NeuroN6Arduino API implementation, the Vision pipeline, FreeRTOS, TinyUSB, the STM32 HAL and the ST Edge AI NPU runtime
libraries/Bundled libraries for cameras, post-processing, sensors, audio, WiFi, Bluetooth LE, LTE, OTA updates and low power operation
models/Neural network files used by the examples
tools/Build hooks, the model compilation wrapper, the firmware signing script and the USB uploader
system/The linker script and the NPU memory pool description
extras/benchDiagnostic and benchmark sketches that compile but are not listed in the examples menu
boards.txt, platform.txtArduino board and platform definitions

Programming model

A sketch consists of setup() and loop() as on any Arduino board. The standard functions for digital and analog input and output, timing, interrupts, Serial, Wire and SPI are implemented. Four additions are specific to the platform:

  • The Vision object initialises the camera, the NPU and the video pipeline and runs a model on each frame.
  • The #pragma neuron6 model="..." directive compiles a .tflite or .onnx file for the NPU during the build and flashes its weights during upload.
  • Post-processors convert a model's output tensors into boxes, masks, keypoints or labels, draw them on the display and send them to the host.
  • Neuro Studio, a desktop application, receives video, overlays, sensor data and the serial console over a single USB connection.

The core runs a FreeRTOS scheduler. loop() executes as one task; the camera capture and USB transport execute as separate tasks at higher priority.

Section organisation

Pages in this section are grouped by topic and carry a level marker.

  • Getting Started covers installation of the toolchain, the first upload, the Tools menu and the structure of a vision sketch.
  • Basics covers the standard Arduino surface: pins, LEDs, timing, the serial console, I2C and SPI.
  • Camera covers streaming, resolutions and frame rates, the VisionConfig structure, the display, touch, capture controls and the global shutter sensor.
  • Neural Networks covers single model sketches, the bundled models, aspect handling, multiple models, cascades, face recognition, custom models, custom post-processors and raw tensor access.
  • Classical Vision covers CPU vision without a model: snapshots, image primitives, QR codes, barcodes, AprilTags and colour tracking.
  • Sensors and Audio covers the on-board sensors, the thermal camera, the microphone, the speaker and audio classification.
  • Connectivity covers WiFi, Bluetooth LE, LTE and over-the-air updates.
  • Advanced covers FreeRTOS, the memory map, low power operation, event recording, live tuning, the bootloader and the host contract.
  • Reference contains troubleshooting, an example index, licensing, contribution guidelines and a glossary.

Analog input range

The analog inputs A0 to A5 are referenced to the 1.8 V analog supply. Full scale is approximately 1.79 V and inputs must not exceed the analog supply. Voltages above this must be divided before connection. See Digital and Analog Pins.

Sources

This documentation is derived from the core repository: TUTORIAL.md, CHANGES.md, the headers under cores/NeuroN6, the library README files and the example sketches. Measured figures quoted in these pages were recorded on hardware by Ohm Lab and logged in CHANGES.md.