Cortex-debug powerful extension for VSCode

In the process of working on a new example (timer), I had some difficulty to make it work. I've found out it that my current setup for Black Magic Probe doesn't work with interrupts. Luckily, in the process of debugging I have found a very useful tool for debugging Cortex MCUs which supports Black Magic Probe debugger and with it, everything works much better because it has preloaded setup for BMP. The name of the extension is Cortex-debug.


In the time of writing this text version, 0.1.21 doesn't support powering board over BMP (monitor twpr enable) so I modified the source of the extension to enable it. Link to the modified extension is here. If you are Linux user you need to unpack this zip in to /home/your_user_name/.vscode/extensions/ and restart VSCode.

Now your Pixracer (or other board) will be power up before you start debugging it.

Another useful thing you can do is to add a static name to your black magic probe instead check if it is ttyACM0 or ttyACM1. You can create or modify the file

sudo nano /etc/udev/rules.d/50-usb.rules

and then add this line:



ACTION=="add", ATTRS{interface}=="Black Magic GDB Server", MODE="0777", SYMLINK+="ttyBMP"

and after editing, do this:


sudo udevadm trigger

and your BMP will always be ttyBMP.

Comments

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Sorry for late reply. I have used my own custom version:

      {
      "version": "0.2.0",


      {
      "type": "cortex-debug",
      "request": "launch",
      "servertype": "bmp",
      "cwd": "${workspaceRoot}",
      "executable": "timer.elf",
      "name": "Debug (Black Magic Probe)",
      "device": "STM32F427VI",
      "powerOverBMP": "enable",
      "BMPGDBSerialPort": "/dev/ttyBMP",
      "targetId": 1
      }
      ]
      }

      This version is now merged with last core-debug version on Github.

      Delete

Post a Comment

Popular posts from this blog

AUTOSAR and CRC calculation

Flashing/debugging/running code at external memory in the memory-mapped mode

Debugging EK-TM4C123GXL with Visual Studio Code on Linux