Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>DauhuniecNew to Visual Studio Code? Get it now.
Dauhuniec

Dauhuniec

Dauhuniec

|
3 installs
| (0) | Free
Dauhuniec: build, flash and debug STM32 CubeMX projects in VS Code with the lon CLI.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Dauhuniec

Dauhuniec · CLI: lon

Named after Belarusian лён-даўгунец (fibre flax). The native CLI is lon.

Upgrading from earlier versions

Disable the old extension, install this VSIX and run Dauhuniec: Configure CubeMX Project once for each existing project. Setup reuses old tool paths, migrates project-local lon.* and codeready.* settings to dauhuniec.*, replaces generated editor tasks and keeps the selected ST-LINK board. New files live in .dauhuniec/; the old .lon/ and .stm32-codeready/ folders stay available for rollback. Global extension preferences must be set again under dauhuniec.*.

Move a project generated by STM32CubeMX into VS Code with a guided setup, environment checks, build tasks, ST-LINK flashing and Cortex-Debug integration.

The extension includes the native Dauhuniec CLI for Windows, macOS and Linux (x86_64 and ARM64). No Python, Go or separate Node.js installation is required.

Start here

  1. Run Dauhuniec: Open in STM32CubeMX / Create Project to create a project, or open an existing .ioc in CubeMX.
  2. In Project Manager → Project → Toolchain / IDE, select Makefile. Generate code under the project root, with one .ioc and a Makefile there.
  3. Install the tools below, then open that project folder in VS Code.
  4. Open Dauhuniec in the activity bar and select Configure project.
  5. If tools are not found, choose your CubeIDE installation or GNU Make executable.
  6. Build with Dauhuniec: Build. Connect the board's ST-LINK USB connector, then use Build, Flash and Run or Start Debugging.

The extension also detects projects inside a workspace and lets you choose among multiple .ioc directories. For normal F5 and IntelliSense behavior, open the project directory itself as a workspace folder.

Focus on your USER CODE

Open a C/C++ file with CubeMX USER CODE BEGIN/END comments and run Dauhuniec: Focus on USER CODE. A toggle is also available in the editor title and status bar. Generated sections collapse while user sections and their markers stay visible. Use Show Full File to unfold everything, or Go to USER CODE Block to jump to a named editable section.

This feature works independently of build setup, including fresh IAR/EWARM exports. It does not rewrite source files or affect CubeMX regeneration. Regular folding arrows can reveal individual generated sections. Explicit per-file choices are remembered; optional dauhuniec.focusUserCodeOnOpen enables automatic focus for new files (off by default).

Unmatched or incomplete markers disable folding. If marker pairs break while the file is focused, the full file is revealed. Nested user blocks remain protected.

Target board for flashing and debugging

Use Project → Target Board in the Dauhuniec sidebar (or Dauhuniec: Select Target Board) to select the exact physical device by ST-LINK serial number. The picker shows the board name when reported by the probe and its full serial, so identical models remain distinguishable. This choice is independent of the serial monitor's port.

A single available board is selected and remembered automatically. If a configured project is opened without a saved choice and several probes are connected, Dauhuniec asks which board should receive the firmware. Cancelling does not select a default; flashing asks again. Adding or reordering devices never changes an existing choice. If the chosen board is disconnected, flashing/debugging stop until it returns or you explicitly choose another board in the sidebar.

Selection is stored per project in .dauhuniec/target.json, ignored by Git, and survives VS Code restarts and project reconfiguration. Upload, build-and-flash, Dauhuniec Debug and generated Dauhuniec F5 configurations use the selected serial. Selecting a board also updates the managed project-local CLI, so generated flash tasks honor the selection. Refresh refreshes the sidebar's connection status; every flash/debug action checks the connected probes again. Matching duplicate serial numbers are rejected because they cannot identify one device uniquely.

Standalone CLI users can run probes --project PATH --json and select-probe --project PATH --probe-serial SERIAL. Flash/upload honor the saved selection; --probe-serial SERIAL explicitly pins one invocation without changing the saved choice. Probe listing does not connect to or flash the target MCU.

Serial Monitor

Dauhuniec: Open Serial Monitor (also the terminal icon in the bottom toolbar) selects a port and baud rate, then starts the native console in VS Code's bottom Terminal panel. Code remains in the editor. Reopening the command reveals an existing running session. The selected port and speed are remembered.

Type a message and press Enter to send it. Incoming data preserves the current input line; use Backspace and the Left/Right arrow keys to edit it. The connection uses 8N1 without flow control; LF is the default transmit ending. Available commands:

Command Action
/help Show console help
/hex, /text Switch received data between HEX and UTF-8
/ending lf, /ending crlf, /ending cr, /ending none Choose transmit line ending
/log PATH Start appending RX/TX messages to a JSONL file
/logoff Stop logging and flush the file
/clear Clear the terminal display
/quit or Ctrl+C Disconnect and exit

Use // at the beginning of a line to send a literal leading slash. File paths following /log may contain spaces; quotes are not required. Logging is off by default. Dauhuniec: Serial Monitor: Start Logging opens a file chooser and Stop Logging stops recording. Use these commands with an empty console input line.

Logs include UTC timestamps, RX/TX directions, port, baud rate, decoded text and original bytes in dataBase64. Records follow receive chunks, which may contain partial or multiple lines. Clearing the terminal and changing display mode do not change the log. Disk errors stop recording and leave the monitor running.

Hiding the terminal keeps the connection and recording active. Use /quit or Ctrl+C to release the device before opening it in another application. Terminal persistence on window reload follows VS Code's terminal settings. Old editor monitor tabs are migrated to the native terminal when restored.

The bundled executable also runs independently from any terminal:

lon serial-console --port COM3 --baud 115200
lon serial-console --port /dev/cu.usbmodem144203 --log serial.jsonl

Windows ports look like COM3, macOS /dev/cu.usbmodem…, and Linux /dev/ttyACM0 or /dev/ttyUSB0. Windows, macOS and Linux on x64 and ARM64 use the bundled CLI; no Python or additional serial application is needed. USB/virtual COM drivers and port access permissions must be available on the workspace host, including SSH, WSL and containers. Some boards reset when the port opens. Cross-platform builds are checked; physical communication still needs verification on each target OS.

Required tools

On Windows, Make is included in STM32CubeIDE and detected automatically. No MSYS2 or additional build environment is required. Open Resources → Windows Setup Instructions for the Windows setup guide.

Open Resources → Install Tools / Official Downloads in the Dauhuniec sidebar or run Dauhuniec: Install Tools / Official Downloads from the Command Palette. The menu opens official download pages in your browser and is available without an open project. Missing-tool setup also offers a CubeIDE download link; the missing-CubeMX notification offers its download page. After installing, run Configure Project again and select the installation if needed. Selecting a CubeIDE directory or Make executable checks its required tool files before saving the path in the project's VS Code settings. Invalid selections show the selected path and the discovery error, with options to retry or view the log.

  • STM32CubeMX to create and generate the Makefile project.
  • STM32CubeIDE, including GNU Tools for STM32, GDB, ST-LINK GDB server and STM32CubeProgrammer. You can use the tools without opening the project in CubeIDE.
  • GNU Make. On Windows, the native Make bundled with CubeIDE is detected automatically. On macOS install Command Line Tools with xcode-select --install. On Debian/Ubuntu install make with your package manager.
  • C/C++ and Cortex-Debug extensions, included as recommended companion extensions. They can also be installed manually from Extensions.
  • Windows: ST-LINK USB driver from ST (STSW-LINK009). Linux: ST-LINK udev rules supplied with CubeIDE. Use the correct CubeIDE/toolchain architecture for your machine.

The extension runs in the workspace extension host. With SSH, WSL or a container, its native tools must be installed on that host; USB access to the board is a separate requirement. Local desktop development is the primary workflow.

What setup changes

Dauhuniec adds a project-local executable and tool paths in .dauhuniec/. It merges its tasks, launch configurations, compiler settings and extension recommendations into .vscode/, keeping unrelated entries. Your original editor files, including comments, are backed up before changes. Existing default build tasks remain the default. Choose Dauhuniec: Build explicitly in that case.

The .ioc, sources, drivers, linker script and Makefile remain unchanged. CPU flags, include paths and defines are read from the generated Makefile; the MCU comes from .ioc. Build uses DEBUG=1 OPT=-Og.

Normal Ctrl/Cmd+Shift+B and F5 work through the generated configurations. Select Dauhuniec: Debug in Run and Debug. Flashing and debugging only start when you invoke those actions; opening a project or checking tools does not flash it.

Everyday workflow

  • Change peripherals in CubeMX, then Generate Code again.
  • Keep your C code in CubeMX USER CODE sections.
  • Use Clean build after changes to the source/driver set.
  • After renaming a project, moving it or updating CubeIDE, run Configure project.
  • Use Check environment and Show logs for actionable diagnostics.
  • Open in STM32CubeMX / Create Project opens the active or selected .ioc in the standalone CubeMX application. With no .ioc, it starts CubeMX so you can create a project. The command is available in the empty project view, sidebar title, .ioc editor title and Explorer context menu. Multiple matching .ioc files show a picker.
  • CubeMX is detected in standard Windows, macOS and Linux installation locations and PATH, including Windows per-user installs under %LOCALAPPDATA%\Programs\STM32CubeMX and versioned macOS application bundles. For a custom location, set dauhuniec.cubeMXPath to its executable, installation directory or macOS .app. If CubeMX is missing, the extension shows an installation/path message. In SSH/WSL/containers, CubeMX must be installed on the workspace host and have access to a graphical session. On Windows, quoted paths copied from Explorer and environment variables such as %LOCALAPPDATA%\Programs\STM32CubeMX are accepted in dauhuniec.cubeMXPath. Immediate launcher failures are reported with the exit code; later GUI or Java failures may still require launching CubeMX directly to see its own error dialog.

If ST-LINK is missing, check the data-capable USB cable, board connector, driver/udev rules and other running debuggers. With multiple boards, check Target Board. If breakpoints do not match, clean and rebuild before starting debugging.

Supported project format

Standard single-core STM32 MCU projects generated with the Makefile export, with literal TARGET and BUILD_DIR assignments. CMake, IAR/EWARM, CubeIDE-managed builds, multi-core and STM32MP projects are not automatically converted. The setup guide explains how to select the required CubeMX export.

Native binaries are supplied for all six desktop OS/architecture combinations. macOS Intel is the locally exercised runtime. Other platform runtimes and actual board flashing/debug sessions still need verification on those systems.

Installation and development

Download the .vsix from the latest GitHub Release, then use Extensions → … → Install from VSIX… and select the downloaded file. Development packages are also available under Artifacts in successful Release extension runs (GitHub sign-in required; unzip the download first). The dauhuniec publisher in this source is a local packaging identifier; register your publisher before Marketplace publishing.

Maintainers build the native binaries from the repository root with go run ./cmd/package, then run pnpm install --frozen-lockfile, pnpm test and pnpm run package here. Go and Node.js are build-time requirements only. Serial access uses go.bug.st/serial; the extension has no runtime npm dependencies. Dauhuniec is licensed under the MIT License, included in LICENSE. Third-party licenses are included in GO-LICENSE.txt and THIRD-PARTY-NOTICES.txt.

Status bar toolbar

The bottom left status bar shows the active CubeMX project, Build, Flash, Debug and More Actions. Click the project name to switch projects. Until the environment is ready, Configure replaces the build actions.

Running tasks show a progress spinner and a Stop button. Build output stays in the task terminal; compiler diagnostics appear in Problems. A failed task adds a shortcut to Problems. More Actions includes Clean, environment checks, ST-LINK probes, the .ioc file, logs, terminal, settings and the guide. The USER CODE toggle remains on the right for the current editor.

Editor title buttons

C/C++ files containing CubeMX USER CODE blocks show two buttons at the top right of the editor: Focus on USER CODE (switches to Show Full File while focused) and Go to USER CODE Block. Hover over an icon for its command name. These actions work before build setup and keep the file contents unchanged.

USER CODE focus keeps function signatures (including multiline parameters) and their opening/closing braces visible, so editable blocks retain their surrounding function context.

CubeMX command integration can be tested with a fake executable in an empty temporary workspace: pnpm run test:host /path/to/empty/workspace --cubemx (macOS/Linux). Serial Monitor terminal integration in an empty workspace can be tested with pnpm run test:host /path/to/empty/workspace --serial. Target selection and uploads against fake ST-LINK probes can be tested with pnpm run test:host /path/to/empty/workspace --targets (macOS/Linux).

Status bar shortcuts

The status bar provides four compact icons, each performing its action directly:

  • Home opens the Dauhuniec side panel.
  • Build Firmware compiles without flashing.
  • Flash Firmware flashes the existing ELF without building.
  • Build and Flash builds, flashes and runs the firmware.

Hover over an icon to see its action and active project. During a task, the Home icon shows progress and Stop is available for cancellable tasks. Build and flash shortcuts return when the task finishes. Setup and project selection stay in the side panel. Both flash actions verify the write and reset the MCU. If no ELF exists, build first. These actions use Dauhuniec's configured ARM tools and ST-LINK, without a CMake kit selection.

MCU, board and offline documentation

Open Resources → Documentation · MCU / Board / HAL / RTOS, Project → Documentation, or Dauhuniec: Open Documentation (MCU / Board / HAL / RTOS). The command is also available on .ioc editor titles and in Explorer.

The picker reads the selected project's .ioc even before Makefile generation or Dauhuniec setup. MCU entries open ST's Documentation tab for datasheets, reference manuals, programming manuals and errata. Recognized ST board names open their board documentation (manuals and schematics where supplied by ST). These links require internet access. The hardware identity comes from the IOC, independently of the physical ST-LINK target selected for flashing.

HAL / LL uses full, unmodified STMicroelectronics manuals. The matching family manual appears for the selected IOC; HAL / LL · Choose STM32 family… provides the catalog without a project. The catalog covers STM32F0/F1/F2/F3/F4/F7, G0/G4, H5/H7, L0/L1/L4/L5, U5, WB and WL. Distinct families such as WBA, WB0 and H7RS do not fall back to a WB or H7 manual. The official firmware-package page provides additional documentation; check its version against your installed package, especially when using a newer HAL generation.

RTOS opens the full FreeRTOS documentation and Arm CMSIS-RTOS v1/v2 API references. ST's UM1722 is available as an integration guide. The optional FreeRTOS V10.0.0 PDF is explicitly labeled legacy; use the online reference for current APIs. These are publisher documents, not Dauhuniec-authored summaries. The complete source catalog is included in docs/SOURCES.md.

PDF manuals download only when selected, then open from the extension's global storage on the workspace host. Subsequent opens reuse the downloaded copy without internet. Update Downloaded Manual… fetches a fresh copy; a failed download preserves the previous file. The cache is shared by projects, separate from firmware sources. Downloads validate PDF signatures and completion; publisher error/sign-in pages are not saved as manuals. If a download fails, Open Online opens the original publisher URL. Online HTML API references require internet; the extension does not mirror entire websites.

Local PDF, Markdown and HTML files in the project appear in the same searchable picker. Add firmware-package or documentation directories with the resource setting dauhuniec.documentationPaths (absolute paths or paths relative to the project). Each directory contributes up to 200 results; build and dependency folders are excluded. Open Local Document… opens any downloaded manual or schematic, including documentation for third-party boards and other components.

Use Choose MCU or ST board… if the IOC has no recognized model. Automatic product links cover conventional STM32 MCU and common ST board naming schemes; custom boards use local documentation. Markdown opens in VS Code; local desktop PDF/HTML uses the system viewer. SSH/WSL/container files open through VS Code, where PDFs may require a PDF viewer extension. For proxy-restricted hosts, use Open Online, save the PDF with your browser and select Open Local Document….

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft