Marus/cortex-debug

Peripherals/XPeripherals view not showing

al-martyn1 opened this issue · 16 comments

Initially the view was displayed. Some time ago it disappeared and there is no way to find it to enable display.

I don't know how to reproduce it. My colleague has the same version of VSCode and Cortex-Debug plugin, and everything is displayed for him.

  • Cortex-Debug Version (this extension) - 1.12.1 (autoupdate enabled)
  • OS: Windows 10
  • GDB Version: GNU gdb (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.90.20231008-git
  • Compiler Toolchain Version: arm-none-eabi-g++.exe (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.1 20231009

launch.json

{
  "configurations" : 
  [
    {
      "name": "Host App Debug",
      "type": "cppdbg",
      "request": "launch",
      "program": "${command:cmake.launchTargetPath}",
      "cwd": "${workspaceFolder}",
      "args": [],
      "stopAtEntry": false,
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "gdb",
      "preLaunchTask": "FW: build",
      "presentation" : {
          "group": "win32"
      }
    },
    {
      "name" : "Cortex Debug (Flash-n-Launch)",
      "type" : "cortex-debug",
      "device" : "STM32F429II",
      "svdFile" : "${workspaceRoot}/src/scripts/STM32F429.svd",
      "svdPath" : "${workspaceRoot}/src/scripts/STM32F429.svd",
      "servertype" : "openocd",
      "configFiles": [ "interface/stlink.cfg", "target/stm32f4x.cfg" ],
      "openOCDPreConfigLaunchCommands": ["adapter speed 1800"],
      "openOCDLaunchCommands": [
        "adapter speed 1800"
      ],
      "cwd" : "${workspaceFolder}",
      "executable" : "${command:cmake.launchTargetPath}",
      "request" : "launch",
      "runToEntryPoint" : "main",
      "showDevDebugOutput" : "raw",
      "preLaunchTask" : "FW: build",
      "preLaunchCommands": [
          "set remote hardware-breakpoint-limit 6",
          "set remote hardware-watchpoint-limit 4",
          "enable breakpoint",
          "monitor halt",
          "monitor reset init",
          "load",
          "monitor halt",
          "monitor reset init"
      ],
      "preRestartCommands" : [
          "set remote hardware-breakpoint-limit 6",
          "set remote hardware-watchpoint-limit 4",
          "enable breakpoint",
          "monitor halt",
          "monitor reset init"
      ],
      "presentation" : {
          "group": "stm32"
      }
    },
    {
      "name" : "Cortex Debug (Launch)",
      "type" : "cortex-debug",
      "device" : "STM32F429II",
      "svdFile" : "${workspaceRoot}/src/scripts/STM32F429.svd",
      "servertype" : "openocd",
      "configFiles": [ "interface/stlink.cfg", "target/stm32f4x.cfg" ],
      "openOCDPreConfigLaunchCommands": ["adapter speed 1800"],
      "openOCDLaunchCommands": [
        "adapter speed 1800"
      ],
      "cwd" : "${workspaceFolder}",
      "executable" : "${command:cmake.launchTargetPath}",
      "request" : "launch",
      "runToEntryPoint" : "main",
      "showDevDebugOutput" : "raw",
      "preLaunchCommands": [
          "set remote hardware-breakpoint-limit 6",
          "set remote hardware-watchpoint-limit 4",
          "enable breakpoint",
          "monitor reset"
      ],
      "preRestartCommands": [
          "enable breakpoint",
          "monitor reset init"
      ],
      "presentation" : {
          "group": "stm32"
      }
    },
    {
      "name" : "Cortex Debug (Attach, Non-complete)",
      "type" : "cortex-debug",
      "device" : "STM32F429II",
      "svdFile" : "${workspaceRoot}/src/scripts/STM32F429.svd",
      "servertype" : "openocd",
      "configFiles": [ "interface/stlink.cfg", "target/stm32f4x.cfg" ],
      "cwd" : "${workspaceFolder}",
      "executable" : "${command:cmake.launchTargetPath}",
      "request" : "attach",
      "showDevDebugOutput" : "raw",
      "presentation" : {
          "group": "stm32"
      }
    }
  ],
  "version" : "0.2.0"
}

debug_console.txt

Two things,

The Peripherals window is actually a separate extension. I am assuming that all required extensions have been installed (automatically done if you install with VSCode). If you are getting errors/warnings when you first run the debugger in VSCode (or during VSCode startup), then you have an install problem. Try uninstalling and re-installing..

Are you sure you did not hide the window? In VSCode Panels, you can show/hide many views. Make sure you see the XPeripherals . Use the ... on the right edge of the panel to get a menu of if views

image image

LiveWatch displayed, but no Peripherals View- OnlyLiveWatch

No Peripherals View in menu - NoPeripheralsViewInMenu

I dont undestand which '...' is on second screen - I have no such -
Image

The three dots always exist at the top right of the debug section (right above the Variables panel)

How did you install cortexc-debug? If you did it on the command line, then VSCode does not auto install dependencies. Make sure all of these are installed

image

I want to make sure that the peripheral viewer is actualy running and doing something. Can you send the log of this window? It is is the OUTPUT tab and use the dropdown to select messages from the peripheral viewer

image

The three dots always exist at the top right of the debug section (right above the Variables panel)

Ok. There is no "Peripherals" item in the "three dots" menu

How did you install cortexc-debug? If you did it on the command line, then VSCode does not auto install dependencies. Make sure all of these are installed

I installed Cortex-debug via VSCode Extensions (Ctrl+Shift+X). At that time it was a single plugin. Currently it was splitted into five different plugins, and all of them are installed -
InstalledPlugins

There is no "Peripherals" item in Output dropdown menu:
OutputDropdown

output.txt

It seems I was send wrong log.
Also, I try to find "Peripherals" in the wrong menu. I find another dropdown at right? but there is not "Peripherals" in it too:
dropdown

To see debug otput in the OUTPUT tab, you have to enable debug-level for both User/Workspace

image

Above screenshot is in the VSCode Settings Editor. Search for "Peripheral"

One simple thing to do is to remove all cortex-debug and mcu-debug extensions and install cortex debug from scratch. It appears that the Peripheral Viewer is not even starting. It will not harm any of your projects but be safe.

Right peripherals log - output.txt

I try to uninstall "debug-tracker-vscode", "MemoryView", "Peripheral Viewer", "RTOS Views" and then "Cortex-Debug".
Then I close VSCode and start it again.
Then, I install "Cortex-Debug" - dependencies are installed automatically.
Then, I close VSCode and start it again.
When I try to start debugging, I see the same picture - there is no "Peripherals" view at all, only "Cortex Live Watch"

To see debug otput in the OUTPUT tab, you have to enable debug-level for both User/Workspace

image

Did you enable debug for the peripheral extension?

Btw, is the output you attached is actually the Preipheral Viewers Log? Before we couldn't even find that.

Btw, your startup sequece is very complicated and is suplicating a lot of the stuff cortex-debug already does. For instance, you are doing a load and so are we. You are doing resets and so are we. If you want to override what we do then use the overrideXXX settings and not the preLaunch setttings. Technically, what you did should work but it does generate a LOT of events that we do not expect at startup. See

https://github.com/Marus/cortex-debug/wiki/Cortex-Debug-Under-the-hood

I notice the following.

      "svdFile" : "${workspaceRoot}/src/scripts/STM32F429.svd",
      "svdPath" : "${workspaceRoot}/src/scripts/STM32F429.svd",

Can you comment out the "svdPath" line, restart VSCode and try to see if starts working, svdPath is used by some other extension and may cause issues

Also, make sure that there are no other extensions handling SVD files like the MS Embedded tools, etc. and if so, temporarily disable them.

I may have found your problem....

https://stackoverflow.com/questions/63327052/the-watch-panel-disappear-when-i-debug-my-code-in-vs-code

Your missing window is probabkly sitting n the sidebar because you accidentallly did it. You need to drag it back into the Debug Window. It is easy to drag things around to new places and not so easy to undo that.

I just tried that with the CallStack panel and at first I couldn't tell what had happened. This is a VSCode thing and has nothing to do with us.

"svdPath" : "${workspaceRoot}/src/scripts/STM32F429.svd",

I added this yesterday hoping it would show me the "Peripheral" view )

Your right about side bar - I found "Peripherals" in the "Secondary Side Bar". Thanks a lot! I don't know how it happened and I would never have guessed.

My startup sequece is very complicated cause I configure I before I start using Cortex-Debug plugin. Thanks for the advice, I'll check my launch.json.

You should probably add this to the FAQ )