Visual Studio 2022 extends its C++ IDE to embedded and IoT development through a dedicated toolset built for microcontrollers and real-time operating systems. The Linux and embedded development with C++ workload adds the Peripheral View for inspecting hardware registers, the Serial Monitor for UART communication, and the RTOS Object View for inspecting thread and kernel object state — all within the same IDE you use for desktop development.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MicrosoftDocs/cpp-docs/llms.txt
Use this file to discover all available pages before exploring further.
Installing the Embedded Tooling
- Visual Studio 2022
- VS Code
Select the workload
Click Modify next to Visual Studio 2022. On the Workloads tab, scroll to Other toolsets and select Linux and embedded development with C++.The workload includes:
- Visual C++ for Linux development (GCC/Clang remote compiler support)
- CMake support for cross-compilation
- Peripheral View and RTOS View debugger extensions
- Serial Monitor extension
Use Cases for Embedded C++ Development
Embedded development covers a wide range of targets and use cases:Microcontrollers (MCUs)
Bare-metal or RTOS-based firmware for STM32, NXP i.MX RT, Nordic nRF, and similar Cortex-M / Cortex-A targets. No OS — your C++ code runs directly on the hardware.
IoT Devices
Connected devices with wireless stacks (Wi-Fi, BLE, LoRa, Cellular). Often run lightweight RTOSes such as FreeRTOS, Azure RTOS (ThreadX), or Zephyr.
Industrial Control
PLCs, motor controllers, and real-time control systems with strict timing requirements. Frequently use RTOS scheduling with hard deadlines.
Embedded Linux
Linux-based embedded boards (Raspberry Pi, NVIDIA Jetson, BeagleBone). These are debugged with GDB over SSH using the Linux development workload.
Peripheral View
The Peripheral View allows you to inspect and modify hardware peripheral registers while paused at a breakpoint during a debug session. It reads SVD (System View Description) files — an industry-standard XML format published by chip vendors — to display peripherals, registers, and bitfields with their names, descriptions, and current values.Opening the Peripheral View
In Visual Studio, the Peripheral View appears automatically during a debug session on embedded hardware. Navigate to Debug → Windows → Peripheral View if it isn’t already docked.Peripheral View Capabilities
| Capability | Description |
|---|---|
| Navigate peripherals | Expand and collapse the peripheral tree. Use arrow keys to scroll through peripheral groups, registers, and bitfields. |
| Edit register values | Click a writeable register value and press Enter to submit a new value. Press F2 to enter edit mode, Esc to cancel. |
| Access memory | Click a linked memory address to open that location in the Memory window. |
| Pin peripherals | Click the pin icon next to frequently-used peripherals to keep them at the top of the view. |
| Search | Type in the search bar to filter the peripheral tree by name or description. |
Providing an SVD File
Most chip vendors publish SVD files on their product pages or in their SDK. Load an SVD file in yourlaunch.json or OpenOCD configuration:
Serial Monitor
The Serial Monitor lets you configure, monitor, and communicate with serial (UART) ports — the primary communication channel for most microcontrollers. It is essential for reading debugprintf output, testing AT commands, and sending configuration data to a device.
Installing the Serial Monitor
In Visual Studio: go to Extensions → Manage Extensions, search for Serial Monitor 2, and click Install. Restart Visual Studio to complete the installation.Key Serial Monitor Settings
| Setting | Description | Common Values |
|---|---|---|
| Port | The COM port connected to your device | COM3, COM4, /dev/ttyUSB0 |
| Baud Rate | Must match the UART baud rate in your firmware | 9600, 115200, 250000 |
| Line Ending | Appended to messages you send | None, LF, CR, CRLF |
| Data bits | Bits per serial frame | 8 (standard) |
| Parity | Error detection bit | None (standard) |
| Timestamp | Prefix received lines with PC timestamp | On / Off |
| Autoscroll | Auto-scroll to latest data | On / Off |
| File Logging | Save all serial output to a file | On / Off |
Firmware Example: Debug Output via UART
RTOS Object View
The RTOS Object View lets you inspect the live state of RTOS kernel objects — threads, queues, semaphores, timers, and memory pools — while paused at a breakpoint. It replaces manual memory inspection with a structured, named view of your system’s concurrency state.Supported RTOSes
Azure RTOS (ThreadX)
Azure RTOS (ThreadX)
All features work out of the box with no special build flags. Inspectable objects include:
- Threads — name, state, priority, stack usage
- Queues, Semaphores, Mutexes, Event Flags
- Block pools and Byte pools
- Timers
FreeRTOS
FreeRTOS
Most features are available. Additional build flags unlock more detail:
configUSE_MUTEXES=1— enables thread base priority reportingconfigGENERATE_RUN_TIME_STATS=1— enables per-thread run-time countersconfigRECORD_STACK_HIGH_ADDRESS=1— enables stack end-address reportingconfigMAX_PRIORITIES— set to the minimum value your app requires for faster thread-list retrieval
Zephyr
Zephyr
Requires specific Kconfig options in your board configuration:
CONFIG_DEBUG_THREAD_INFO=y— all thread informationCONFIG_INIT_STACKS=y+CONFIG_THREAD_STACK_INFO=y— stack usageCONFIG_TRACING=y+CONFIG_TRACING_OBJECT_TRACKING=y— non-thread objects
Using the RTOS Object View
During a debug session paused at a breakpoint:- The RTOS Object View panel populates automatically with detected kernel objects.
- Use the Up / Down arrow keys to navigate objects. Press Enter to follow a linked memory address to the Memory window.
- Click a thread name to jump to its current state in the Watch window.
- Object values update each time the debugger pauses (breakpoint, step, or manual halt).