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.
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.
Before you begin
Section titled “Before you begin”- 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
dialoutgroup. - 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, orarm-none-eabi-objcopy). - Host serial permissions: write access to
/dev/ttyACM*(for example membership in thedialoutoruucpgroup on Linux).
- A Wireless-Tag WT32-SC01 (ESP32) board and a USB cable that carries data. The WT32-SC01 uses its USB port with the CP210x serial bridge.
- No release download exists for this board. The Xila releases contain the firmware of the Arduino Nano 33 BLE only. Build the firmware from the Platforms repository, as the first step shows.
- A Wireless-Tag WT32-SC01 Plus (ESP32-S3) board and a USB cable that carries data. The Plus uses its USB-C port.
- No release download exists for this board. The Xila releases contain the firmware of the Arduino Nano 33 BLE only. Build the firmware from the Platforms repository, as the first step shows.
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
- In the Platforms repository root, compile the embedded runtime:
mise run build:nano-33-bleCargo 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-upFlash through the bootloader
- Connect the Arduino Nano 33 BLE to your computer using a micro-USB cable.
- In the Platforms repository root, run the flashing task:
mise run flash:nano-33-bleThe 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
bossacto write and verify the firmware starting at offset0x10000. - 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.
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
0xB0in theNRF_POWER->GPREGRETregister, 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 incrementsGPREGRET2. The subsequent boot reads and logs this message through the USB console. - Three-panic bootloader latch:
board::crash()counts crashes inGPREGRET2. On the third crash in a row before the firmware reachesmark_stable(), it resets into the bootloader instead of restarting the firmware. - Bring-up timeout: When built with
--features bring-up, hardware timerTIMER1counts 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. |
Build the firmware
-
In a host shell, clone the Platforms repository and enter it:
git clone https://github.com/xila-project/platforms.gitcd platforms -
In the Platforms repository root, trust the mise configuration and install the native packages:
mise trustMISE_ENV=ci mise run ci:packages-espressif -
In the same directory, install the Espressif Rust toolchain and the locked npm packages. Xila converts its fonts at build time with the
lv_font_convprogram from these packages.mise run setup:espressif-rustnpm ci -
Build the firmware of the board:
mise run build:wt32-sc01The WT32-SC01 carries ESP32 revision v1.0 silicon. By default, esp-hal requires revision v3.0 or later. The
build:wt32-sc01task runstools/dev/build_espressif_image.sh, which setsESP_HAL_CONFIG_MIN_CHIP_REVISION=100, so that the firmware accepts revision v1.0. Build this board with the task, not with a directcargo build.
The build writes two files. The ELF file is the firmware. The -flash.bin file is a merged image of the bootloader, the partition table and the firmware.
| Firmware (ELF) | Merged image |
|---|---|
target/espressif-emulator/wt32-sc01.elf |
target/espressif-emulator/wt32-sc01-flash.bin |
This guide flashes the ELF file. The merged image writes the whole flash from offset 0x0 and erases the stored data. Use it only to provision a new or wiped board.
The following diagram shows which parts of the flash each command writes.
espflash flash writes the bootloader, the partition table and the factory application partition. It never writes the storage partition, so the accounts, the installed applications and the stored files survive a firmware update. The merged -flash.bin image spans the whole flash: a raw write at offset 0x0 also replaces the storage partition with erased content. Use the merged image only to provision a new or wiped board.
Find the serial port
-
Connect the board to the computer.
-
In a host shell, list the serial devices:
ls -l /dev/serial/by-id/The WT32-SC01 has a CP210x USB-to-UART bridge. Its link points to a
ttyUSBdevice. -
In the same shell, store the
/dev/serial/by-id/path of your board. ReplaceBOARD-NAMEwith the name of the link that points to your board:export FLASH_PORT=/dev/serial/by-id/BOARD-NAME
Do not use /dev/ttyACM0 or /dev/ttyUSB0. The number of the device can change after you flash the board, and other boards on the same computer can take a number. The /dev/serial/by-id/ path stays the same. Name the port in every espflash command, so that espflash does not choose a port.
Seed the storage
A seeded storage image carries the application shortcuts of the graphical shell, the official package registry and the first-installation marker. Without it, the board formats its storage at the first boot and the application menu is empty. The seed image diagram in the native tutorial shows how the native seed image is built from the pinned, released packages.
Write the storage image only for a first installation or to replace the storage. To update the firmware of a board that already works, follow Update only the application instead: it keeps the storage.
-
In the Platforms repository root, build the storage image of the board. The WT32-SC01 image has the native shortcuts only, because this board has no Wasm runtime.
mise run image:wt32-sc01The task ends with a line that starts with
Verified raw LittleFS (4096-byte blocks). The image size is 1769472 bytes. The size equals thestoragepartition of the board. -
Write the image to the
storagepartition:mise run run:espflash -- write-bin --chip esp32 --port "$FLASH_PORT" \0x250000 target/seed/wt32-sc01/storage.img
The offset comes from the partitions.csv file of the board. If that file changes, read the offset of the storage row again.
| Partition table | Application (factory) | Storage (storage) |
|---|---|---|
partitions.csv | 0x10000, 2.25 MiB |
0x250000, 1.6875 MiB |
Flash the firmware
-
In the Platforms repository root, flash the board. The command writes the bootloader, the partition table and the application. It does not write the
storagepartition.mise run run:espflash -- flash --chip esp32 --port "$FLASH_PORT" \--flash-size 4mb --flash-mode dio \--partition-table examples/boards/wt32-sc01/partitions.csv --partition-table-offset 0x8000 \--monitor target/espressif-emulator/wt32-sc01.elf -
Watch the boot log that
--monitorprints. PressCtrl+Cto close the monitor.
Update only the application
To update the firmware and keep the bootloader, the partition table and the storage, write only the factory partition. The partition table of the board must already match the one in the repository.
-
In the Platforms repository root, find the offset of the
factorypartition in the partition table of the board:factory_offset=$(awk -F ',' '$1 == "factory" { gsub(/ /, "", $4); print $4 }' \examples/boards/wt32-sc01/partitions.csv)The file gives
0x10000. -
Build the application image and write it:
mise run run:espflash -- save-image --chip esp32 \--flash-size 4mb --flash-mode dio \target/espressif-emulator/wt32-sc01.elf \target/espressif-emulator/wt32-sc01-application.binmise run run:espflash -- write-bin --chip esp32 --port "$FLASH_PORT" \"$factory_offset" target/espressif-emulator/wt32-sc01-application.bin
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
The build stops with Expected the Espressif Rust toolchain 1.97.0 |
The esp toolchain is missing or has another version |
Run mise run setup:espressif-rust, then build again. |
The build stops with firmware (... bytes) does not fit in the factory partition of ... |
The firmware is larger than the factory partition of partitions.csv |
Enlarge the factory partition and move the storage partition behind it. A changed partition table loses the stored data, see the next rows. |
The log shows Xila: LittleFS mount failed (...); formatting storage |
The storage holds no valid LittleFS: a new board, an old partition layout or an image of the wrong size | The message is normal at the first boot without a seeded image. Otherwise build the image again with the task of your board and write it at the storage offset. |
espflash write-bin of the storage image stops with a FlashDeflData timeout |
The write of a large storage image can time out | If the board already has a working storage, do not write the storage image again. Write only the application at 0x10000, as in “Update only the application”. |
After a flash of the Plus, espflash stays at Connecting |
Unknown. It was seen on the Plus in hardware tests | Press Ctrl+C. Reset the board, then open the console with a serial terminal on the /dev/serial/by-id/ path. |
The console login fails with Invalid path or Failed to get user file path |
Text typed during the boot reached the login prompt garbled | Wait for the next User name: prompt, then type the user name again. After a reset, wait for the prompt before you type. |
| The storage is empty after a firmware update | The partition table in the firmware differs from the one on the board | Back up your files first. Run the full flash command to write the new partition table, then write a storage image. |
The log shows a line that starts with Xila: the screen is off |
The display bus or the touch controller did not start. The board then runs without a screen | Read the reason after the screen is off. Check the board, then reset it. The console session still works. |
| The application menu is empty | The storage was formatted by the firmware and holds no shortcuts | Write the seeded storage image, as in the section “Seed the storage”. |
Build the firmware
-
In a host shell, clone the Platforms repository and enter it:
git clone https://github.com/xila-project/platforms.gitcd platforms -
In the Platforms repository root, trust the mise configuration and install the native packages:
mise trustMISE_ENV=ci mise run ci:packages-espressif -
In the same directory, install the Espressif Rust toolchain and the locked npm packages. Xila converts its fonts at build time with the
lv_font_convprogram from these packages.mise run setup:espressif-rustnpm ci -
Build the firmware of the board:
mise run build:wt32-sc01-plus
The build writes two files. The ELF file is the firmware. The -flash.bin file is a merged image of the bootloader, the partition table and the firmware.
| Firmware (ELF) | Merged image |
|---|---|
target/espressif-emulator/wt32-sc01-plus.elf |
target/espressif-emulator/wt32-sc01-plus-flash.bin |
This guide flashes the ELF file. The merged image writes the whole flash from offset 0x0 and erases the stored data. Use it only to provision a new or wiped board.
The following diagram shows which parts of the flash each command writes.
espflash flash writes the bootloader, the partition table and the factory application partition. It never writes the storage partition, so the accounts, the installed applications and the stored files survive a firmware update. The merged -flash.bin image spans the whole flash: a raw write at offset 0x0 also replaces the storage partition with erased content. Use the merged image only to provision a new or wiped board.
Find the serial port
-
Connect the board to the computer.
-
In a host shell, list the serial devices:
ls -l /dev/serial/by-id/The Plus has the USB identifier
303a:1001(the USB Serial/JTAG controller of the chip). Its link points to attyACMdevice. -
In the same shell, store the
/dev/serial/by-id/path of your board. ReplaceBOARD-NAMEwith the name of the link that points to your board:export FLASH_PORT=/dev/serial/by-id/BOARD-NAME
Do not use /dev/ttyACM0 or /dev/ttyUSB0. The ttyACM number of the Plus can change after you flash it, and other boards on the same computer can take a number. The /dev/serial/by-id/ path stays the same. Name the port in every espflash command, so that espflash does not choose a port.
Seed the storage
A seeded storage image carries the application shortcuts of the graphical shell, the official package registry and the first-installation marker. Without it, the board formats its storage at the first boot and the application menu is empty. The seed image diagram in the native tutorial shows how the native seed image is built from the pinned, released packages.
Write the storage image only for a first installation or to replace the storage. To update the firmware of a board that already works, follow Update only the application instead: it keeps the storage.
-
In the Platforms repository root, build the storage image of the board. The Plus image contains the released Wasm application packages and needs a network connection.
mise run image:wt32-sc01-plusThe task ends with a line that starts with
Verified raw LittleFS (4096-byte blocks). The image size is 12517376 bytes. The size equals thestoragepartition of the board. -
Write the image to the
storagepartition:mise run run:espflash -- write-bin --chip esp32s3 --port "$FLASH_PORT" \0x410000 target/seed/wt32-sc01-plus/storage.img
The offset comes from the partitions.csv file of the board. If that file changes, read the offset of the storage row again.
| Partition table | Application (factory) | Storage (storage) |
|---|---|---|
partitions.csv | 0x10000, 4 MiB |
0x410000, 3056 blocks of 4096 bytes |
Flash the firmware
-
In the Platforms repository root, flash the board. The command writes the bootloader, the partition table and the application. It does not write the
storagepartition.mise run run:espflash -- flash --chip esp32s3 --port "$FLASH_PORT" \--flash-size 16mb --flash-mode qio --flash-freq 80mhz \--partition-table examples/boards/wt32-sc01-plus/partitions.csv --partition-table-offset 0x8000 \--monitor target/espressif-emulator/wt32-sc01-plus.elf -
Watch the boot log that
--monitorprints. PressCtrl+Cto close the monitor. The monitor can stop atConnectingafter the flash. Then pressCtrl+C, reset the board and open the console as in Open the console and log in.
With the Plus, the bootloader and the application use different flash modes. The second-stage bootloader uses dual I/O at 80 MHz, which the ROM requires, and it switches the flash chip to quad I/O. The application image uses quad I/O at 80 MHz. The bootloader that espflash bundles writes both modes. Do not configure a local bootloader in espflash: it can bypass the bundled bootloader that selects quad I/O.
Update only the application
To update the firmware and keep the bootloader, the partition table and the storage, write only the factory partition. The partition table of the board must already match the one in the repository.
-
In the Platforms repository root, find the offset of the
factorypartition in the partition table of the board:factory_offset=$(awk -F ',' '$1 == "factory" { gsub(/ /, "", $4); print $4 }' \examples/boards/wt32-sc01-plus/partitions.csv)The file gives
0x10000. -
Build the application image and write it:
mise run run:espflash -- save-image --chip esp32s3 \--flash-size 16mb --flash-mode qio --flash-freq 80mhz \target/espressif-emulator/wt32-sc01-plus.elf \target/espressif-emulator/wt32-sc01-plus-application.binmise run run:espflash -- write-bin --chip esp32s3 --port "$FLASH_PORT" \"$factory_offset" target/espressif-emulator/wt32-sc01-plus-application.bin
An application-only update does not change the flash mode of the installed bootloader. A Plus that you flashed earlier with a dual I/O bootloader needs one full flash command, as in the previous section, to get the quad I/O bootloader.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
The build stops with Expected the Espressif Rust toolchain 1.97.0 |
The esp toolchain is missing or has another version |
Run mise run setup:espressif-rust, then build again. |
The build stops with firmware (... bytes) does not fit in the factory partition of ... |
The firmware is larger than the factory partition of partitions.csv |
Enlarge the factory partition and move the storage partition behind it. A changed partition table loses the stored data, see the next rows. |
The log shows Xila: LittleFS mount failed (...); formatting storage |
The storage holds no valid LittleFS: a new board, an old partition layout or an image of the wrong size | The message is normal at the first boot without a seeded image. Otherwise build the image again with the task of your board and write it at the storage offset. |
espflash write-bin of the storage image stops with a FlashDeflData timeout |
The write of a large storage image can time out | If the board already has a working storage, do not write the storage image again. Write only the application at 0x10000, as in “Update only the application”. |
After a flash of the Plus, espflash stays at Connecting |
Unknown. It was seen on the Plus in hardware tests | Press Ctrl+C. Reset the board, then open the console with a serial terminal on the /dev/serial/by-id/ path. |
The console login fails with Invalid path or Failed to get user file path |
Text typed during the boot reached the login prompt garbled | Wait for the next User name: prompt, then type the user name again. After a reset, wait for the prompt before you type. |
| The storage is empty after a firmware update | The partition table in the firmware differs from the one on the board | Back up your files first. Run the full flash command to write the new partition table, then write a storage image. |
The log shows a line that starts with Xila: the screen is off |
The display bus or the touch controller did not start. The board then runs without a screen | Read the reason after the screen is off. Check the board, then reset it. The console session still works. |
| The application menu is empty | The storage was formatted by the firmware and holds no shortcuts | Write the seeded storage image, as in the section “Seed the storage”. |
Open the console and log in
Section titled “Open the console and log in”Arduino Nano 33 BLE console
- Open a serial terminal connected to the board:
picocom /dev/ttyACM0Because 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 BLEFile system ready (formatted: true); heap: <used> bytes used, <free> freeWT32-SC01 console
The WT32-SC01 sends the console through UART0 and the CP210x bridge at 115200 baud.
- In a host shell, open a serial terminal on the port:
picocom -b 115200 "$FLASH_PORT"WT32-SC01 Plus console
The Plus sends the console through its built-in USB Serial/JTAG controller.
- In a host shell, open a serial terminal on the port:
picocom "$FLASH_PORT"- 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. - Enter
administratoras the user name. - Press
Enterat thePassword: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.
The WT32-SC01 shows the bootsplash and the graphical login on its screen. Enter the same user name there and leave the password empty. If the storage holds a seeded image, the Terminal application on the screen opens a command-line shell.
The Plus shows the bootsplash and the graphical login on its screen. Enter the same user name there and leave the password empty. If the storage holds a seeded image, the Terminal application on the screen opens a command-line shell.
Verify the result
Section titled “Verify the result”-
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: -
Log in as
administratoron the console. The shell shows its prompt (user@host:directory$). -
Restart the board. The login prompt returns, and your files and the account remain.
-
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.
Log in on the screen with the same account. The graphical shell opens. With a seeded storage image, the application drawer lists the applications.
Log in on the screen with the same account. The graphical shell opens. With a seeded storage image, the application drawer lists the applications.