No Towers? No Problem: Join Our Satellite IoT Webinar on September 29th

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Connected Product Guidebook
In-depth guides for connected product development
Developer Certification
Get certified on wireless connectivity with Blues
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Support DocsNotehub StatusSecurity AdvisoriesVisit our Forum
Button IconSign In
Docs Home
What’s New
Resources
Blog
Technical articles for developers
Connected Product Guidebook
In-depth guides for connected product development
Developer Certification
Get certified on wireless connectivity with Blues
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Feather MCUs
Cygnet
Cygnet Quickstart
Cygnet Datasheet
Using PlatformIO with Cygnet
Using STM32CubeIDE with Cygnet
Swan
Swan Quickstart
Swan Datasheet
Using PlatformIO with Swan
Using CircuitPython with Swan
Using STM32CubeIDE with Swan
PrerequisitesSetting Up a ProjectSwan-Specific ConfigurationFlashing FirmwareViewing Serial Output
Recovering the STM32L4R5
Serial Logging With STLINK
homechevron_rightDocschevron_rightFeather MCUschevron_rightSwanchevron_rightUsing STM32CubeIDE with Swan

Using STM32CubeIDE with Swan

STM32CubeIDE lets you build bare-metal and HAL-based firmware for Swan, and step debug it over SWD. This guide covers selecting Swan's microcontroller in the STM32CubeIDE project wizard, the hardware you need to flash the resulting binary, and the Swan-specific hardware details that CubeMX does not know about.

note

If you would rather work in Arduino or PlatformIO, see the Swan Quickstart or Using PlatformIO with Swan.

Prerequisites

Swan does not include an on-board debugger. To flash and step debug from STM32CubeIDE you need an STLINK-V3MINI (or another SWD-capable ST-LINK probe) connected to Swan's Cortex-Debug connector.

You can also flash a build over USB with Swan's DFU bootloader instead, which requires no probe. See Flashing Firmware below.

Setting Up a Project

  1. Download and install STM32CubeIDE and STM32CubeProgrammer if you don't already have them installed. Be sure to follow these installation notes when installing STM32CubeProgrammer.

  2. During the STM32CubeIDE configuration, select STM32L4R5ZIYx as the target device. This is the WLCSP144 entry for the STM32L4R5ZIY6 microcontroller Swan uses.

    select STM32L4R5ZIYx

  3. Once you've selected the STM32L4R5ZIYx, you'll be able to use STM32CubeIDE as you would for any STMicroelectronics dev kit.

Swan-Specific Configuration

Because STM32CubeIDE targets the bare microcontroller rather than a Swan board definition, a few of CubeMX's defaults do not match Swan's hardware.

Here are a few things worth knowing:

  • USB requires its own supply rail. VDDUSB is fed by a separate 3.3V regulator rather than by VDD, so USB peripherals need PWR_CR2 USV enabled (HAL_PWREx_EnableVddUSB()) before they will work.
  • PE6 (DISCHRG) must be open drain, with no pull-up or pull-down. This pin discharges the switchable 3.3V output rail; CubeMX's default push-pull GPIO configuration violates the board's design note. PE4 (nEN_3V3_OUT) enables that same rail.
  • Do not connect PB2 (BOOT1) to VDD.
  • PA13, PA14, PA15, and PB3 are the debug pins (SWDIO, SWCLK, JTDI, and JTDO). Repurposing them as GPIO will cost you SWD access. PB4 is wired to USART1_CTS through a 0Ω resistor.
  • Feather analog pins do not map to the ports you might guess — A4 and A5 are PC4 and PC5, and the two DAC outputs are PA4 (D10) and PA5 (D13). See Pin Information in the Swan Datasheet for the full mapping.

Flashing Firmware

With an STLINK-V3MINI attached to Swan's Cortex-Debug connector, use STM32CubeIDE's Run and Debug commands as you would with any ST development board.

To flash over USB instead, put Swan into DFU mode before every upload:

  1. Press and hold the BOOT button.
  2. Press and release the RESET button.
  3. Release the BOOT button.

Then flash the .elf or .hex your build produced with STM32CubeProgrammer, selecting USB as the connection type. If you flash a raw .bin instead, set the start address to 0x08000000, since a .bin carries no address information of its own.

Viewing Serial Output

Swan routes LPUART1 to the STLINK's virtual COM port on PG7 (TX) and PG8 (RX), so a debug probe can carry both SWD and console output over one cable. See Serial Logging With STLINK for the wiring details.

Can we improve this page? Send us feedback
© 2026 Blues Inc.
© 2026 Blues Inc.
AboutDocsAPI ReferenceTermsPrivacy