Giter VIP home page Giter VIP logo

mplab-extension's Introduction

VSLABX (MPLABX Extension)

An extension that enables building and debugging MPLABX projects from within Visual Studio Code

VSLABX Prerequisites

  • MPLABX v5.40 or greater installed on machine
    • Older installations may work but are not validated

Build

Building can be started by either using the command MPLABX: Build Project from the command pallet or creating setting up a build task in .vscode/tasks.json. For a build to be successful, several auto-generated files are needed. These files can be generated by opening the project in MPLABX, or by running the MPLABX: Update private make files command.

MPLABX: Build Project

When called from the command pallet, this command will do the following:

  • Scans the current workspace for MPLABX project folders by looking for a Makefile contained in a folder that end's with .X
    • If more then one MPLABX project folder is found, the user will be prompted to select one of the project folders found
  • Invokes MPLABX's make with at the directory of the selected project

Build Task

To create a build task:

  • Create the .vscode/task.json file
    • Issue the Tasks: Run Build Task command from the command pallet, or by using the build keybinding "ctrl+b"
    • A "No build task configured..." message should appear. Press enter to create to select a task template.
    • Select "create task.json from task template"
    • Select "Others"
  • Added the mplabxbuild configuration
    • Clear out the contents tasks object (from square bracket open to close)
    • Start typing mplabx-build and press enter to insert the following snippet
     {
         "label": "MPLABX Build",
         "type": "mplabx",
         "task": "build",
         "projectFolder": "${workspaceFolder}/\"Path to MPLABX Project\"",
         "configuration": "default",
         "problemMatcher": [
             {
                 "base": "$xc",
                 "fileLocation": [
                     "relative",
                     "${workspaceFolder}/\"Path to MPLABX Project\""
                 ],
             }
         ],
         "group": {
             "kind": "build",
             "isDefault": true
         }
     }
    
    • If the MPLABX project is not the same as the workspaceFolder append the rest of the path to the projectFolder item e.g. "${workspaceFolder}\TestProject.X"
    • If building an MPASM project, replace the problem matcher with the following:
    "problemMatcher": [
                "$mpasm",
                "$mpasm-msg"
            ],
    
  • Save the file
  • Run the Tasks: Run Build Task command again
    • Press enter to select a build task
  • Select "MPLABX Build"
  • Now running the build command will build the selected project

Program

TODO: Implement

Debug

Setup Debugging

Debugging is setup by adding the MPLABX: Debug Launch configuration to the launch.json file.

{
    "type": "mplabx",
    "request": "launch",
    "name": "MPLABX Debug",
    "program": "${workspaceFolder}/",
    "stopOnEntry": true,
    "preLaunchTask": "MPLABX Build"
}

If a launch.json file has not been created, one can be created by going to the debug tab in the side bar and clicking create a launch.json file, and selecting MPLABX: Debug.

All programer settings are pulled from the project file in nbproject/configuration.xml. This includes what tool to use and any voltage settings. If programer settings need to be changed, it is recommended to change them from withing MPLABX to prevent corrupting the project.

Running Debugger

Use F5 or the run button on the debugger tab. The preLaunchTask item in the configuration will call the build task before connecting to the hwtool, programing, and starting. These tasks can take a while to execute.

Debugger Notes

The names of programers do not match between the configuration file and the mdb tool. As such, the names of the tools need to matched up manually. If you would like to use a tool that is not listed below, please submit an issue on GitHub with the name of the tool listed in nbproject\configuration e.g. (<platformTool>pk4hybrid</platformTool>)

Supported Tools

  • PICKit3
  • PICKit4
  • Simulator
    • Stimulus files are not yet supported
    • Submit an issue if you would like stimulus support

mplab-extension's People

Contributors

callwyat avatar dabs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.