Skip to content

Repository files navigation

STM32 Nucleo-H755ZI 2-Blink Debug Example

This repo is an example of how to setup dual-core debugging using the Cortex Debug VSCode Extension. These instructions were particularly made for the STM32 Nucleo-H755ZI development boards and use the ST-Link to debug.

This setup currently works on Windows 11 with STM32CubeIDE installed, and on Arch Linux without STM32CubeIDE.

The steps below are continually being refined to better suit more workflows and toolchains.

Setup:

There are two ways you can set this up:

  • With STM32CubeIDE

  • Without STM32CubeIDE

    • Requires:
      • Visual Studio Code
      • STM32Cube for Visual Studio Code (Install the prerelease version)
        • With the VSCode extension, the ARM GNU Toolchain, STM32 Programmer CLI, and ST-Link GDB Server are provided, so you do not need to download the next two dependencies. They should be located in a stm32cube/bundles folder.
          • On Linux, they should be stored in /home/$username$/.local/share/stm32cube/bundles/, but this may vary based on distro.
      • ARM GNU Toolchain
        • Cortex Debug requires arm-none-eabi gdb, nm, and objdump
        • You can either use MinGW64 installer only if you are on Windows(You must have MinGW64) or download and extract/tar the zip/archive for all platforms.
      • ST-Link GDB Server and STM32 Programmer CLI

        It is also possible to also use the open-source stlink toolchain using st-util for the GDB Server, but its usage differs from the STM32 GDB Server from the packages above. Instructions to integrate it will come out in the future.

    • After downloading the required toolchains, set up your Cortex Debug extension settings to point to the right /bin locations.

I referenced this issue here to set up my launch.json Marus/cortex-debug#1008

How to Use:

These steps were done on Windows 11 with STM32CubeIDE. When you have all the dependencies and Cortex Debug settings configured, you will need to configure the CMake build using the STM32Cube for VSCode extension. (Instructions coming soon)

  1. To begin, place some breakpoints down.

    alt text

    I have added global variables count and count2 for the CM7 and CM4 cores respectively to monitor in the WATCH tab.

  2. Plug in STM32 Nucleo-H755ZI board

  3. Select Run and Debug or press Ctrl+Shift+D

    alt text

Important: You must start the CM7 debug BEFORE the CM4

  1. At the Run and Debug drop-down menu at the top left , select Debug CM7 - ST-Link and click the green play button to Start Debugging. Wait until Debug CM7 in the Call Stack menu on the left says PAUSED ON BREAKPOINT before continuing.

    alt text

  2. At that same drop-down menu, select Attach CM4 - ST-Link and click the green play button to Start Debugging. Wait until Attach CM4 in the Call Stack menu on the left says PAUSED ON ATTACH before continuing.

    alt text

  3. In the CALL STACK menu, you can see Debug CM7 would be PAUSED ON BREAKPOINT and Attach CM4 would be PAUSED ON ATTACH.

    alt text

    For Debug CM7, click on Continue.

    alt text

  4. By now, you should see Debug CM7 say RUNNING.

    alt text

    Click on Continue for Attach CM4.

    alt text

    Both profiles should now be PAUSED ON BREAKPOINT.

    alt text

  5. On the Nucleo board, you should be able to see both Green and Yellow LEDs on.

    alt text

    In the CALL STACK menu, you should now be able to see both LEDs toggle by clicking Continue for whichever specified profile you want. The Green LED is on the CM7 and the Yellow LED is on the CM4. You can remove either breakpoints to let the CM4/CM7 blink programs continue running without stopping.

    You can use this menu to switch between watching the CM7 and CM4 variables

    alt text

    alt text

  6. To end the session, you can stop both of the debugging sessions. I recommend to Disconnect the CM4 before you Stop the CM7.

    Note: You cannot stop the CM7 and debug the CM4 by itself, the CM4 requires the CM7 in order to function.

    You can also Disconnect the CM4 and debug the CM7 by itself

    alt text

    alt text

About

Example dual core STM32H755 debug setup for Cortex Debug

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages