Changes

Jump to: navigation, search
no edit summary
== Introduction ==
[https://code.visualstudio.com/ Visual Studio Code] (VSC VSCode for short) is a powerful integrated development environment (IDE). In the last years, it has gotten growing popularity among software developers of any kind, thanks to its excellent flexibility. [https://marketplace.visualstudio.com/VSCode Numerous extensions], native git support, availability for all of the most common platforms are some of the features that have made it so successful.
Even though it was not designed for embedded software development specifically, it is so versatile that it can be used for this purpose as well. This application note shows, for instance, how to configure it in order to remotely debug an application running on the Bora/BoraX platform. As host machine, the Virtual Machine released along with the BELK/BXELK kit was used.
It assumed that the reader is familiar with BELK/BXELK kit and with VSCVSCode.
==Host configuration==
The example project is the umpteenth flavor of the world-famous [https://en.wikipedia.org/wiki/%22Hello,_World!%22_program "Hello, world!" program]. Source code is available [ here] for download.
The example makes use of a simple <code>Makefile</code> for cross-building. This <code>Makefile</code> can be used either to build the application manually or to build it automatically as part of a VSCVSCode-controlled debugging session.
The following image shows the files that the VSC VSCode workspace consists of.
[[File:BELK-AN-009-workspace.png|thumb|center|600px|VSC VSCode workspace]]
**The source file of the program
*<code>Makefile</code>
**This file allows building the program manually from the command line. It is also used by VSC VSCode to build the program before starting a debug session.
*<code>remote-debugging.sh</code>
**This script is invoked by VSC VSCode to
***Build the program for the embedded target
***Start a remote debug session.
****As stated before, this task invokes the <code>remote-debugging.sh</code> script.
 
==Starting a debug session==
In practice, once the target is up and running and the example project was copied onto the host machine, follow these steps to start a cross-debugging session:
*Open the VSC VSCode workspace
*Select the <code>(gdb) Cross launch</code> configuration
*Click on the green ''Start Debugging'' or select the ''Debug->Start Debugging'' menu item. Alternatively, press F5. You should see something like the following picture. It is worth remembering that the scripts take care of killing any <code>gdbserver</code> instance running on the target before starting a new debugging session. This allows starting it with just one click.
4,650
edits

Navigation menu