🛰️ Get started using Satellite IoT with the Starnote for Skylo Starter Kit

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
Serial Logging With STLINK
homechevron_rightDocschevron_rightFeather MCUschevron_rightSerial Logging With STLINK

Serial Logging With STLINK

Programmer like the STLINK-V3MINI include a virtual COM port (VCP) that allows them to function as a serial-to-USB adapter. When used with STM32-based microcontrollers like Blues Cygnet or Blues Swan, you can use the STLINK's VCP_RX and VCP_TX pins for serial logging.

Using the programmer for logging offers several advantages:

  • Single USB connection: You don’t need a separate USB cable for serial logging. As long as the host is powered by other means, the same USB connection used to power the programmer also handles logs.
  • Persistent serial connection: The serial link stays active even when the host is power-cycled, which is especially helpful for applications that frequently enter sleep mode.
note
  • The STLINK's VCP_RX and VCP_TX pins map to:
    • PB10 and PB11 on Blues Cygnet.
    • PG8 and PG7 on Blues Swan.

The STLINK's VCP_RX and VCP_TX pin provide UART interface. In general, to do your debug logging through these pins you can treat them as a standard UART interface.

The sections below show specific instructions you can follow when working with an STLINK for logging in Arduino and Zephyr.

Arduino

When using the STLINK on Arduino you can use the HardwareSerial class to establish a serial connection through the STLINK’s VCP_RX and VCP_TX pins.

HardwareSerial serialDebug(PIN_VCP_RX, PIN_VCP_TX);

Next, in setup(), initialize the serial interface by calling its begin() function with a baud rate:

serialDebug.begin(115200);

After calling begin() to initialize the serial interface, it's often helpful to wait for the connection to become available—especially when relying on tools like a serial monitor that may need time to enumerate the device. The following code waits up to 5 seconds for the serial interface to become ready:

serialDebug.begin(115200);
const size_t timeout_ms = 5000;
for (const size_t start_ms = millis(); !serialDebug && (millis() - start_ms) < timeout_ms;);

With the setup complete, you can use print() and println() as normal to log to your serial monitor.

serialDebug.println("Testing...");

You can also use the STLINK’s serial connection as a way of viewing Notecard debug logs with the setDebugOutputStream() method.

Notecard notecard;
notecard.setDebugOutputStream(serialDebug);

When put together, here's a good starting point for an Arduino sketch that uses an STLINK for viewing debug logs.

Notecard notecard;
HardwareSerial serialDebug(PIN_VCP_RX, PIN_VCP_TX);

void setup() {
  serialDebug.begin(115200);
  const size_t timeout_ms = 5000;
  for (const size_t start_ms = millis(); !serialDebug && (millis() - start_ms) < timeout_ms;);

  notecard.begin();
  notecard.setDebugOutputStream(serialDebug);
}

Zephyr

The Zephyr board configuration for both Blues Swan and Blues Cygnet specifies lpuart1 as the system console, which is connected to the STLINK’s virtual COM port. This means any printk() output or logging automatically appears over the STLINK USB connection.

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