Difference between revisions of "BELK-TN-008: Integrating Visual Studio Code and Lauterbach PowerView TRACE32"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{InfoBoxTop}} {{Applies To Bora}} {{Applies To BoraX}} {{Applies To BoraLite}} {{InfoBoxBottom}} __FORCETOC__ {{WarningMessage|text=This technical note was validated against...")
 
(Testbed)
(2 intermediate revisions by the same user not shown)
Line 20: Line 20:
  
 
== Introduction ==
 
== Introduction ==
 +
This Technical Note (TN) shows how to integrate Visual Studio Code (VSC) and Lauterbach PowerView TRACE32 (PVT32). The integration aims to:
 +
*Debugging the program in VSC by using PVT32 to run it on the target
 +
*To jump from PVT32 to VSC (in editing mode) to edit the source file where the bug was found.
 +
 +
This article also shows how to configure VSC in order to cross-build a Makefile-based application. This configuration supports cross-toolchain error messages to jump on erroneous lines with a simple click.
 +
 +
==Testbed==
 +
To test the procedure, the same testbed described [[BELK-TN-007:_FreeRTOS_on_single-core_Bora_Lite_SoM|here]] was used. Therefore, the application used to validate the procedure is <code>freertos_hello_world</code>.
 +
 +
With regard to VSC, the following version was used:
 +
<pre>
 +
Version: 1.41.1 (system setup)
 +
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
 +
Date: 2019-12-18T14:58:56.166Z
 +
Electron: 6.1.5
 +
Chrome: 76.0.3809.146
 +
Node.js: 12.4.0
 +
V8: 7.6.303.31-electron.0
 +
OS: Windows_NT x64 6.1.7601
 +
</pre>
 +
 +
==Integrating VSC e PVRT32==
 +
===Debugging in VSC===
 +
After opening VSC from the root directory of the <code>freertos_hello_world</code> project, install the ''Native Debug'' extension.
 +
 +
Then, create a <code>launch.json</code> file by selecting ''Debug->Add Configuration->GDB''. The file should look like this:
 +
<syntaxhighlight lang="text" line="line">
 +
{
 +
    // Use IntelliSense to learn about possible attributes.
 +
    // Hover to view descriptions of existing attributes.
 +
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
 +
    "version": "0.2.0",
 +
    "configurations": [
 +
        {
 +
            "name": "Debug (PowerView TRACE32)",
 +
            "type": "gdb",
 +
            "request": "launch",
 +
            //"target": "${workspaceRoot}/Debug/freertos_hello_world.elf",
 +
            "target": "r:/home/llandre/devel/formulasae/ecu/boralite/workspace-2019.1/freertos_hello_world/Debug/freertos_hello_world.elf",
 +
            "gdbpath": "e:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe",
 +
            "cwd": "${workspaceRoot}",
 +
            "valuesFormatting": "parseText",
 +
            "autorun": [
 +
                "target remote localhost:30000",
 +
                "symbol-file ${workspaceRoot}/Debug/freertos_hello_world.elf",
 +
            ]
 +
        }
 +
    ]
 +
}
 +
</syntaxhighlight>

Revision as of 16:39, 12 February 2020

Info Box
Bora5-small.jpg Applies to Bora
BORA Xpress.png Applies to BORA Xpress
BORALite-TOP.png Applies to BORA Lite


Warning-icon.png This technical note was validated against specific versions of hardware and software. What is described here may not work with other versions. Warning-icon.png

History[edit | edit source]

Version Date Notes
1.0.0 February 2020 First public release

Introduction[edit | edit source]

This Technical Note (TN) shows how to integrate Visual Studio Code (VSC) and Lauterbach PowerView TRACE32 (PVT32). The integration aims to:

  • Debugging the program in VSC by using PVT32 to run it on the target
  • To jump from PVT32 to VSC (in editing mode) to edit the source file where the bug was found.

This article also shows how to configure VSC in order to cross-build a Makefile-based application. This configuration supports cross-toolchain error messages to jump on erroneous lines with a simple click.

Testbed[edit | edit source]

To test the procedure, the same testbed described here was used. Therefore, the application used to validate the procedure is freertos_hello_world.

With regard to VSC, the following version was used:

Version: 1.41.1 (system setup)
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:58:56.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 6.1.7601

Integrating VSC e PVRT32[edit | edit source]

Debugging in VSC[edit | edit source]

After opening VSC from the root directory of the freertos_hello_world project, install the Native Debug extension.

Then, create a launch.json file by selecting Debug->Add Configuration->GDB. The file should look like this:

 1 {
 2     // Use IntelliSense to learn about possible attributes.
 3     // Hover to view descriptions of existing attributes.
 4     // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
 5     "version": "0.2.0",
 6     "configurations": [
 7         {
 8             "name": "Debug (PowerView TRACE32)",
 9             "type": "gdb",
10             "request": "launch",
11             //"target": "${workspaceRoot}/Debug/freertos_hello_world.elf",
12             "target": "r:/home/llandre/devel/formulasae/ecu/boralite/workspace-2019.1/freertos_hello_world/Debug/freertos_hello_world.elf",
13             "gdbpath": "e:/Xilinx/SDK/2019.1/gnu/aarch32/nt/gcc-arm-none-eabi/bin/arm-none-eabi-gdb.exe",
14             "cwd": "${workspaceRoot}",
15             "valuesFormatting": "parseText",
16             "autorun": [
17                 "target remote localhost:30000",
18                 "symbol-file ${workspaceRoot}/Debug/freertos_hello_world.elf",
19             ]
20         }
21     ]
22 }