Scaling an IoT deployment? Join our webinar on May 28th where we dive into real-world scaling pain points and how to overcome them.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
Docs Home
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Feather MCUs
Cygnet
Cygnet Introduction
Cygnet Quickstart
Cygnet Datasheet
Using Arduino IDE with Cygnet
Using STM32CubeIDE with Cygnet
Swan
Swan Introduction
Swan Quickstart
Swan Datasheet
Using Arduino IDE with Swan
Using CircuitPython with Swan
Using STM32CubeIDE with Swan
Recovering the STM32L4R5
homechevron_rightDocschevron_rightFeather MCUschevron_rightSwanchevron_rightUsing Arduino IDE with Swan

Using the Arduino IDE with Swan

Installation Prerequisites

Download and install STM32CubeCLT , which is a toolset that allows third-party IDEs to work with STM32-based host MCUs.

note

Alternatively, you may install both STM32CubeIDE and STM32CubeProgrammer . These are much larger software packages that may not be necessary for your local development environment. Be sure to also follow these installation notes when installing STM32CubeProgrammer.

Linux only setup required for accessing the device in DFU mode and virtual COM port.
  1. Create a /etc/udev/rules.d/ rule for the device in DFU mode.

    (echo '# DFU (Internal bootloader for STM32 MCUs)';  echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/49-stdfu-permissions.rules > /dev/null
  2. Create a /etc/udev/rules.d/ rule for the device's virtual COM port.

    (echo '# Virtual COM Port for STM32 MCUs'; echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/49-stvcp-permissions.rules > /dev/null
  3. Add active user to plugdev group in /etc/group.

    sudo usermod -aG plugdev $USER
Using the Arduino CLI

As an alternative to using Arduino IDE to configure and build your project, you can use the Arduino CLI .

  1. In order to specify Swan as the board, you need to first install the STM32duino core. You'll need a minimum of version 2.9.0 of the STM32duino core installed.

    arduino-cli core install STMicroelectronics:stm32
  2. You can then specify the Swan by using the board part number. For example:

    arduino-cli compile --fqbn STMicroelectronics:stm32:Blues blinky.ino

Installing STM32duino in the Arduino IDE

  1. Add the following URL to the Additional Boards URL in Settings/Preferences: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

    Update ArduinoIDE preferences

  2. After restarting Arduino IDE, go to the Tools > Board > Boards Manager... menu option, search for "STM32 MCU based boards", and install or update to version 2.9.0 or greater.

  3. Restart Arduino IDE.

Using STM32duino in the Arduino IDE

  1. Under Tools > Board, select "STM32 MCU based boards", and then "Blues boards."

    Select STM32 Board

  2. Next, under Tools > Board Part Number, select "Swan R5."

    Select STM32 Board Part

  3. Lastly, under Tools > USB support (if available), select "CDC (generic 'Serial' supersede U(S)ART)."

Programming Swan with Arduino IDE

To program Swan in the Arduino IDE, you can use a programmer like the STLINK-V3MINI or program via a USB cable connected to your computer.

Programming Swan with the STLINK-V3MINI (Recommended)

  1. Under Tools > Upload method, select "STM32CubeProgrammer (SWD)."

  2. Plug the STLINK-V3MINI into your computer over USB.

  3. Plug the Swan into a power source (e.g. a LiPo battery or your computer via USB).

    NOTE: If you want to see Serial output from the Swan, you need to either use a USB cable as the power source or customize your sketch to use the STLINK-V3MINI for Serial output.

  4. Plug the Cortex-Debug connector from the STLINK-V3MINI into the Swan.

    swan to stlink

  5. Skip to the Blink the Onboard LED instructions below.

Programming Swan without the STLINK-V3MINI

  1. Under Tools > Upload method, select "STM32CubeProgrammer (DFU)."

  2. Connect the Swan's Micro USB port to your computer with a USB cable.

    swan micro usb

  3. Press and hold the BOOT button on the Swan, press and release RESET, then release BOOT to cause the Swan to jump into its bootloader. This sequence must be done every time you want to upload firmware to the Swan.

  4. Proceed to the Blink the Onboard LED instructions below.

Blink the Onboard LED

  1. In the Arduino IDE, use File > New to create a new sketch.

  2. Overwrite the provided boilerplate code with the following to cause the onboard LED to blink repeatedly:

    // the setup function runs once when you press reset or power the board
    void setup() {
      // initialize digital pin LED_BUILTIN as an output.
      pinMode(LED_BUILTIN, OUTPUT);
    }
    
    // the loop function runs over and over again forever
    void loop() {
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                       // wait for a second
      digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);                       // wait for a second
    }
  3. Upload this sketch to the Swan.

Step Debugging Swan with the Arduino IDE

Swan supports step debugging with Arduino Native Debugging on Arduino IDE when used with an attached STLINK programmer/debugger .

note

Arduino Native Debugging requires usage of Arduino IDE v2 .

  1. Set one or more breakpoints on your sketch.

    swan set breakpoints

  2. In the Sketch menu, select Optimize for Debugging.

    swan optimize for debugging in arduino ide

  3. Upload the sketch to Swan.

  4. Click the Start Debugging button.

    swan start debugging

  5. When a breakpoint is hit, use the Arduino IDE to step through relevant code blocks and inspect variables, view the call stack, and watch expressions.

    swan step debugging

Can we improve this page? Send us feedback
© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up