Developing firmware for MSP432 devices with Visual Studio

This tutorial shows how to create a basic “Blinking LED” program for the MSP432 LaunchPad evaluation board. Before you begin, please install VisualGDB 5.0 or later and update your OpenOCD package to the latest version using the Embedded Tools Manager.

  1. Start Visual Studio and open the VisualGDB Embedded Project Wizard:01-newprj
  2. Proceed with the default choice of creating a new binary:02-binary
  3. On the next page select the ARM toolchain and pick the MSP432P401R device from the list:03-msp432If this is the first MSP432 project created on this machine, VisualGDB will suggest automatically installing the MSP432 package. Proceed with the installation.
  4. Once the package is downloaded and installed, press “Next” to proceed with the default settings:04-select
  5. The next page of the wizard allows selecting the sample project. The MSP432 package provides only one sample – LEDBlink. According to the MSP432 LaunchPad schematics, a red LED is connected to port PIO1.0 which is the default choice when creating a VisualGDB project. If you want to use a different port, you can change it here:05-blink
  6. If you have connected your MSP432 LaunchPad via USB and are using the latest OpenOCD package, VisualGDB will automatically detect and select the corresponding programming interface:06-debugEnsure that the interface is recognized as XDS110, not the generic CMSIS-DAP, that would be much slower.
  7. Press “Test” to verify that the connection to the board works:07-tested
  8. Press Finish to complete creating your project. Then build it with Ctrl-Shift-B:08-errorThe first build will fail due to an error in the ASSERT() statement.
  9. The error happens due to a typo in the MSP432 SDK. To work around it, either remove the problematic ASSERT() statements, or simply change the condition above the ASSERT() definition to never trigger:09-debug
  10. Press F5 to start debugging and observe the red LED on the MSP432 LaunchPad board:board
  11. Set a breakpoint on the call to GPIO_toggleOutputOnPin() and wait until it is hit:10-stopped
  12. You can debug your code just like any other Visual Studio project. If you are using the Clang IntelliSense, you can also use the Code Map to explore the relations between various functions and variables in your code:10-codemap