Seeed XIAO SAMD21 ยท xiao-first-upload
Set up the XIAO and upload your first sketch
Question: What has to match before an Arduino sketch can reach the XIAO?
Understand the idea
The XIAO SAMD21 is a 3.3 V microcontroller board based on the SAMD21 family. The Arduino IDE needs the matching Seeed board support package, and the selected board and serial port must match the connected hardware. A successful compile alone does not prove the correct board was selected.
Start with a minimal sketch and a known USB data cable. Select the Seeed XIAO SAMD21 board definition, choose the port that appears when the board is connected, compile, then upload. If the port or bootloader is not found, follow Seeed's board-specific recovery instructions rather than repeatedly changing wiring or selecting a random SAMD board.
The printed D labels are the connector names used in sketches; the chip's PA/PB names are a lower-level pin mapping. Use the board's pinout for peripheral functions and verify the exact board variant before connecting a module.
Worked example
A minimal `setup()` can start `Serial` and configure the built-in LED only after you have confirmed the correct board definition and LED pin behavior for the specific XIAO revision. The first experiment is a clean compile and upload, followed by a readable serial message.
Try it at the bench
- Install the Seeed SAMD board support using the official setup guide, then select Seeed XIAO SAMD21 in the IDE.
- Connect with a USB data cable and note the serial port that appears. Upload a sketch that prints a short message once per second.
- Open Serial Monitor at the sketch's baud rate. Record the IDE board selection, port, and upload result so the setup can be repeated.
Check your understanding
Why can a sketch compile successfully but still fail to upload to the connected XIAO?
Show the answer
Compilation checks the code for the selected target; uploading separately needs the correct board support, port, USB data path, and an available bootloader.