Marus / cortex-debug

Visual Studio Code extension for enhancing debug capabilities for Cortex-M Microcontrollers
MIT License
996 stars 238 forks source link

Peripherals/XPeripherals view not showing #1045

Closed al-martyn1 closed 1 week ago

al-martyn1 commented 1 week ago

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.

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

haneefdm commented 1 week ago

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
al-martyn1 commented 1 week ago

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

haneefdm commented 1 week ago

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
haneefdm commented 1 week ago

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
al-martyn1 commented 1 week ago

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

al-martyn1 commented 1 week ago

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

haneefdm commented 1 week ago

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

image
haneefdm commented 1 week ago

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

haneefdm commented 1 week ago

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.

al-martyn1 commented 1 week ago

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"

haneefdm commented 1 week ago

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.

haneefdm commented 1 week ago

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

haneefdm commented 1 week ago

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.

haneefdm commented 1 week ago

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.

al-martyn1 commented 1 week ago
"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.

al-martyn1 commented 1 week ago

You should probably add this to the FAQ )