Skip to content
Xila

Install Xila on a board

Build the Xila firmware, flash a supported board, and log in to the command-line shell on the first boot.

Last updatedEdit page

This guide shows how to install Xila on a supported board: build the firmware from the Platforms repository, flash the board, and log in to the command-line shell. Use it for the first installation of a board and for later firmware updates. Select your board in the tabs; every tab group of this page stays in sync. Steps that are the same for every board are outside the tabs. For the features of each board, see Supported hardware. To control the GPIO pins of an installed board, see Control GPIO pins.

  • An x86_64 Linux development system with Git and mise. The WT32 boards need a Debian-based distribution, because their native package step uses apt.
  • A serial terminal, for example picocom.
  • Write access to the serial port of the board. On Linux, this usually means membership in the dialout group.
  • Free disk space for the Rust toolchain and the build. The first build for a WT32 board downloads the Espressif Rust toolchain.
  • A copy of every file that you want to keep from the board. The storage steps below replace the stored data.

The requirements of your board:

  • An Arduino Nano 33 BLE board (Nordic Semiconductor nRF52840 SoC, 1 MiB internal flash, 256 KiB RAM) and a micro-USB cable.
  • Flashing tools: the Arduino fork of bossac (version 1.9.1-arduino2, supplied automatically by mise) and an ARM-compatible binary copy utility (rust-objcopy, llvm-objcopy, or arm-none-eabi-objcopy).
  • Host serial permissions: write access to /dev/ttyACM* (for example membership in the dialout or uucp group on Linux).

The firmware builds from the Platforms repository root.

Check the memory layout

The board partitions the 1 MiB internal flash and 256 KiB RAM into fixed regions:

Region Flash address range Size Description
Bootloader 0x00000-0x0FFFF 64 KiB Arduino USB bootloader (never overwritten by Xila)
Firmware 0x10000-0x7FFFF 448 KiB Xila embedded runtime binary
File system 0x80000-0xFFFFF 512 KiB LittleFS root file system (4 KiB page size)

RAM is organized from 0x20000000 into static data, the dynamic heap, a 32 KiB stack, and a dedicated 256-byte uninitialized crash record at the top of memory (0x2003FF00-0x2003FFFF).

Build the firmware

  1. In the Platforms repository root, compile the embedded runtime:
mise run build:nano-33-ble

Cargo compiles xila-nano-33-ble-example for the thumbv7em-none-eabihf target with the release-embedded profile. The generated ELF binary is at target/thumbv7em-none-eabihf/release-embedded/nano_33_ble_example.

Optional: To compile with the bring-up feature (which waits for a host terminal before running and automatically resets into the bootloader if no host connects within 60 seconds):

cargo build --locked -p xila-nano-33-ble-example --target thumbv7em-none-eabihf --profile release-embedded --features bring-up

Flash through the bootloader

  1. Connect the Arduino Nano 33 BLE to your computer using a micro-USB cable.
  2. In the Platforms repository root, run the flashing task:
mise run flash:nano-33-ble

The flashing script (examples/nano_33_ble/flash.sh):

  • Converts the ELF executable into a raw binary image using objcopy.
  • Sends a 1200-baud touch (stty -F /dev/ttyACM0 1200 hupcl) to reboot the board into the Arduino bootloader.
  • Waits for the bootloader USB device (2341:005a) to appear.
  • Executes bossac to write and verify the firmware starting at offset 0x10000.
  • Resets the microcontroller into the newly flashed firmware.

If the board fails to enter the bootloader automatically, double-tap the physical reset button on the board (the onboard orange LED pulses) and run the command again.

Recover the board

The following diagram shows the bootloader entry, crash detection, and recovery paths for the Arduino Nano 33 BLE.

Boot, crash and recovery paths of the Arduino Nano 33 BLEPower on or resetHost 1200-baud touchBootloader requested?Arduino bootloaderXila firmwareCrash recordLog previous crash messageMount file system and start shellmark_stable clears crash count double-tap or GPREGRET 0xB0Nopanic or faultcount below 3third crash in a rowsets GPREGRET and resets

The recovery mechanisms operate as follows:

  • 1200-baud touch: Host flashing scripts open the serial port at 1200 baud and close it. The USB console driver detects this request, sets 0xB0 in the NRF_POWER->GPREGRET register, and triggers a system reset into the Arduino bootloader.
  • Double-tap reset: Pressing the physical reset button twice enters the Arduino bootloader, whatever the firmware state.
  • Panic preservation: When a panic or hard fault occurs, board::crash() writes up to 248 bytes of the error message into the uninitialized RAM crash record and increments GPREGRET2. The subsequent boot reads and logs this message through the USB console.
  • Three-panic bootloader latch: board::crash() counts crashes in GPREGRET2. On the third crash in a row before the firmware reaches mark_stable(), it resets into the bootloader instead of restarting the firmware.
  • Bring-up timeout: When built with --features bring-up, hardware timer TIMER1 counts down 60 seconds. If no host terminal opens the serial port within this period, the board automatically resets into the bootloader.

Troubleshooting

Symptom Cause Fix
Serial device /dev/ttyACM0 does not appear Firmware halted or USB disconnected Double-tap the physical reset button to force the Arduino bootloader mode (2341:005a in lsusb).
Flashing fails with missing objcopy ARM binary utilities not installed Install cargo-binutils (for rust-objcopy) or LLVM, as the error message from flash.sh says.
Board continuously resets Panic loop during startup Connect a serial terminal to read the panic message logged on boot. After three consecutive crashes, the board halts in the bootloader.
LittleFS fails to mount Flash corruption in the storage partition Erase the storage partition (0x80000-0x100000) through the bootloader or reflash with a full chip erase.

Arduino Nano 33 BLE console

  1. Open a serial terminal connected to the board:
picocom /dev/ttyACM0

Because the connection uses native USB CDC-ACM emulation, the host baud rate setting does not affect transmission speed.

On first startup, the firmware detects an unformatted flash region, formats the LittleFS file system, and seeds default accounts. The log shows the board banner and a file system line. The heap numbers depend on the build:

Xila on Arduino Nano 33 BLE
File system ready (formatted: true); heap: <used> bytes used, <free> free
  1. Reset the board and wait for the User name: prompt. Do not type before the prompt shows: the console garbles the input that it receives during the boot, and the login fails.
  2. Enter administrator as the user name.
  3. Press Enter at the Password: prompt, because the password of the default account is empty.

The command-line shell starts and shows a prompt in the form user@host:directory$, for example administrator@<host>:/$.

On a board with a screen:

The Arduino Nano 33 BLE has no screen. The serial console is the only login.

  1. In the boot log, find these lines in order. The numbers depend on the board.

    Board Lines
    Arduino Nano 33 BLE Xila on Arduino Nano 33 BLE, the file system line, User name:
    WT32-SC01 Plus Xila: board WT32-SC01 Plus, the PSRAM size, Xila: PSRAM self-test passed, Xila: LittleFS mounted, the panel and touch controller lines, the heap report, User name:
    WT32-SC01 Xila: board WT32-SC01, Xila: PSRAM 4194304 bytes (registered: true), Xila: PSRAM self-test passed, Xila: LittleFS mounted, Random generator works, Xila: ST7796 on HSPI, FT6336U chip 0x64, vendor 0x11, User name:
  2. Log in as administrator on the console. The shell shows its prompt (user@host:directory$).

  3. Restart the board. The login prompt returns, and your files and the account remain.

  4. To verify a GPIO output, see Control GPIO pins.

On a board with a screen:

The Arduino Nano 33 BLE has no screen. There is no display check.