Module 7: Avoiding Pitfalls and Feature Mapping
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.
| Issue | Common Pitfall | How to Avoid it |
|---|---|---|
| Looking for MPLAB X IDE Toolbar Functions | MPLAB 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:
|
| 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:
|
| Compiler Not Found | A 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:
|
| Expecting Build Configuration Dialogs | Users often look for MPLAB X IDE-style project property windows and build configuration dialogs. However, VS Code uses:
| Learn where the project configuration files are stored and understand:
|
| CMake Build Workflow Confusion | Users may expect the MPLAB X IDE build system to work identically, but VS Code heavily uses a CMake-based workflow:
| 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:
|
| Missing Debug Configurations | Users may press F5 and expect the debugger to work immediately, whereas for VS Code, debugging is configuration-driven. | Before attempting to debug, verify:
|
| Troubleshooting the Wrong Way | Users may look only at build output when VS Code is highly modular. | When things fail:
|
MPLAB X IDE Features That Map Directly to MPLAB for VS Code
| Action | VS Code Keyboard Shortcut / Icon | VS Code Switch to Command Palette | MPLAB X IDE Keyboard Shortcut / Icon |
|---|---|---|---|
| Use Command Palette | Press CRTL + Shift + P or F1, then enter command | In the search bar, press >, then enter command | N/A |
| PROJECT | |||
| Create Project | >MPLAB: Create New Project | ||
| Open Project | >File: Open Folder... | ||
| Configure Project | >MPLAB: Edit Project Properties | ||
| Open file in Project | Ctrl + P | Go to file... | Alt + Shift + O |
| Search all Files | Ctrl + Shift + F | >Search: Find in Files | Ctrl + Shift + F |
| BUILD | |||
| Build Project | Ctrl + Shift + B | >MPLAB CMake: Build | |
| DEBUG | |||
| Debug Main Project | F5, | >Debug: Start Debugging | |
| Stop Debugging | Shift + F5, | >Debug: Stop | |
| Pause/Halt | F6, | >Debug: Pause | |
| Reset | >MPLAB: Reset... | ||
| Toggle Breakpoint | F9 | >Debug: Toggle Breakpoint | Ctrl + F8 |
| Step Over | F10, | >Debug: Step Over | |
| Step In | F11, | >Debug: Step Into | |
| Step Out | Shift + F11, | >Debug: Step Out | |
| Go To Symbol | Ctrl + T | Ctrl + Alt + Shift + O | |
| PROGRAM | |||
| Make and Program Device | >MPLAB: Program Device | ||
| TOOLS | |||
| Launch MPLAB AI Coding Assistant | >MPLAB AI Coding Assistant: New Session | ||
| Launch MPLAB Code Configurator | >MPLAB MCC: Launch | ||
| Launch MPLAB Data Visualizer | >MPLAB: Data Visualizer |
Resources
- Migration Guide from MPLAB® X IDE to MPLAB Tools for VS Code® (specifically Table 1-1. MPLAB X IDE Icons and MPLAB Tools for VS Code Commands)
- Migration Guide from AVR® and PIC16/PIC18F to PIC32CM Development Tools Ecosystem.