Module 7: Avoiding Pitfalls and Feature Mapping

Last modified by Microchip on 2026/10/12 13:10

Overview

In this lesson, we will uncover common pitfalls and frequently asked questions. You will learn practical tips for working efficiently in VS Code® and explore a clear mapping of MPLAB® X IDE features that have direct equivalents, partial equivalents, or no equivalents in VS Code.

Learning Objectives

Understand common pitfalls and create realistic expectations when using MPLAB Extensions for VS Code to create new projects

  • Common pitfalls and how to avoid them
  • MPLAB X IDE features that map directly to VS Code
  • Features that work differently or are not present

Activity

Quick references for independent use.

Common Pitfalls When Switching From MPLAB® X IDE to MPLAB for VS Code®

The main issue when switching is understanding the workflow differences between MPLAB X IDE and MPLAB for VS Code (or more precisely, VS Code). MPLAB X IDE uses a dedicated toolbar-centric workflow, whereas VS Code uses a command-driven, extension-based workflow.

IssueCommon PitfallHow to Avoid it
Looking for MPLAB X IDE Toolbar FunctionsMPLAB X IDE users often expect a dedicated toolbar for project creation, build, debug, and configuration. However, VS Code relies heavily on the Command Palette (Ctrl+Shift+P) and extension-specific views rather than a fixed IDE toolbar.

Learn the key MPLAB commands in the Command Palette:

  • MPLAB: Create Project
  • MPLAB CMake: Full Build
  • MPLAB: Data Visualizer
  • MPLAB: Edit Project Properties
Assuming a Project Can Be Opened Directly

Users open a .X project folder and expect it to behave exactly like it does in MPLAB X IDE.

The project usually needs to be imported using the Project Importer extension.

To avoid problems:

  1. Import the MPLAB X IDE project by simply opening the folder.
  2. Check any generated project configuration files to ensure they are correct.
  3. Check any imported configurations before building.
Compiler Not FoundA new XC compiler is installed, but VS Code cannot find it. Note that VS Code needs to register a compiler before it can find it.

After installing a compiler:

  • Run MPLAB: Reinitialize Toolchains Registration
  • If necessary, manually register the compiler by running MPLAB: Add Toolchain
Expecting Build Configuration Dialogs

Users often look for MPLAB X IDE-style project property windows and build configuration dialogs.

However, VS Code uses:

  • JSON/UI configuration files
  • CMake-based project management
  • Command-driven operations

Learn where the project configuration files are stored and understand:

  • .vscode - this project-specific folder contains configuration files
  • *.mplab.json
  • CMake configuration files
CMake Build Workflow ConfusionUsers may expect the MPLAB X IDE build system to work identically,

but VS Code heavily uses a CMake-based workflow:

  • MPLAB CMake: Full Build
  • MPLAB CMake: Clean Build

Understand that Configure, Generate, and Build are separate steps when troubleshooting build issues.

Workspace vs Project Confusion

Users sometimes open the wrong folder level.

VS Code distinguishes between: Folders, Workspaces, and Projects

For VS Code:

  • Open the correct project root.
  • Save a workspace file for multi-project development.
  • Keep related repositories in the same workspace when appropriate.
Missing Debug ConfigurationsUsers may press F5 and expect the debugger to work immediately, whereas for VS Code, debugging is configuration-driven.

Before attempting to debug, verify:

  • Debug probe selection
  • Launch configuration
  • Device selection
  • Project configuration
Troubleshooting the Wrong WayUsers may look only at build output when VS Code is highly modular.

When things fail:

  • Check the Output window
  • Check MPLAB extension logs
  • Verify toolchain registration
  • Ensure device packs are installed

MPLAB X IDE Features That Map Directly to MPLAB for VS Code

ActionVS Code Keyboard Shortcut / IconVS Code Switch to Command PaletteMPLAB X IDE Keyboard Shortcut / Icon
Use Command PalettePress CRTL + Shift + P or F1, then enter commandIn the search bar, press >, then enter commandN/A 
PROJECT   
Create Project >MPLAB: Create New ProjectCreate New Project Icon
Open Project >File: Open Folder...Open Project Folder Icon
Configure Project >MPLAB: Edit Project PropertiesEdit Project Properties Icon
Open file in ProjectCtrl + PGo to file...Alt + Shift + O
Search all FilesCtrl + Shift + F>Search: Find in FilesCtrl + Shift + F
BUILD   
Build ProjectCtrl + Shift + B>MPLAB CMake: BuildBuild Icon
DEBUG   
Debug Main ProjectF5, Start Debugging Icon>Debug: Start DebuggingDebug Icon
Stop DebuggingShift + F5, Stop Icon>Debug: StopFinish Debug Session Icon
Pause/HaltF6, Continue Icon>Debug: PausePause Icon
ResetRestart Icon>MPLAB: Reset...Reset Icon
Toggle BreakpointF9>Debug: Toggle BreakpointCtrl + F8
Step OverF10, Step-Over-Icon-Dark.png>Debug: Step OverStep Over Icon
Step InF11, Step Into Icon>Debug: Step IntoStep Into Icon
Step OutShift + F11, Step Out Icon>Debug: Step OutStep Out Icon
Go To SymbolCtrl + T Ctrl + Alt + Shift + O
PROGRAM   
Make and Program Device >MPLAB: Program DeviceMake and Program Icon
TOOLS   
Launch MPLAB AI Coding Assistant >MPLAB AI Coding Assistant: New Session 
Launch MPLAB Code Configurator >MPLAB MCC: LaunchMCC Icon
Launch MPLAB Data Visualizer >MPLAB: Data VisualizerDV Icon

Back to Top

Resources

Back to Top