🛠 Advanced First Boot for XIAO STM32C5

Seeed Studio XIAO STM32C5 · avance · Guide technique pour initialiser le XIAO STM32C5, valider le cœur Cortex-M33 et configurer les périphériques critiques comme le CAN FD et le capteur LSM6DS3TR-C.

Objectives

This tutorial aims to master the low-level initialization of the STM32C5A3CG microcontroller. Unlike classic Arduino boards, this step requires understanding the Arm Cortex-M33 architecture and clock management. You will learn to verify the integrity of internal (1 MB) and external (16 MB) flash, as well as configure the CAN FD bus via the TCAN3403-Q1 transceiver.

Required Hardware

Steps

  1. Hardware Check: Connect the XIAO via USB-C. The Li-Po charging circuit must show a stable state. Ensure the external 48 MHz crystal is properly soldered.
  2. Environment Setup: Launch STM32CubeIDE. Select the STM32C5A3CG device. In the configurator, enable the 144 MHz clock system using the HSE (48 MHz) as the main source.
  3. CAN FD Initialization: In the code, configure the FDCAN2 peripheral. Note that the TCAN3403-Q1 transceiver is already wired with a 120 Ω termination resistor. Enable FD mode to support high bitrates.
  4. LSM6DS3TR-C Sensor Test: Initialize the SPI or I2C interface. Activate the PWM output linked to the heating circuit to stabilize the sensor temperature before reading inertial data.
  5. Flashing: Compile the firmware and flash it via SWD or USB DFU interface. Verify that the bootloader accepts the image on internal flash.

Verification

Use a logic analyzer to confirm signals on CAN_H and CAN_L pins. You must observe valid CAN FD frames if the code emits periodic messages. On the serial port, check initialization logs confirming the Cortex-M33 startup at 144 MHz and LSM6DS3TR-C detection. The onboard LED should blink if the example code is used.

Going Further

Explore DMA memory management to transfer sensor data to the 256 KB SRAM without overloading the CPU. Also study the use of FDCAN1 with an external transceiver to create a redundant CAN network.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials