Skip to main content
Visitor II
March 21, 2021
Question

How to debug STM32MP1(Cortex-M4) firmware on user board?

  • March 21, 2021
  • 1 reply
  • 2437 views

I have the STM32MP157C-DK2, and I plan to make a user board.

Before creating a user board, I have a question.

1. I want to know how to debug Cortex-M4 firmware on the user board. GDB debug is used in No. 7 in the link below.

https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-M4/Modify,_rebuild_and_reload_a_firmware

In STM32CubeIDE, STM32MP157C-DK2 can debug the firmware through ST-LINK MCU (OpenOCD), but there is no ST-LINK MCU on the user board, so I am curious about how to debug in STM32CubeIDE. Is debugging by connecting Segger J-link or ST-LINK (V2/V3) to the user board? I want to know if it is possible and how to do it if possible.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    March 23, 2021

    Hi @HAPPYDAY​ ,

    If there's no embed ST-Link in your design you can use external STLinkV2/V3 probe since you expose SWD signal on one connector.

    Olivier

    HAPPYDAYAuthor
    Visitor II
    March 24, 2021

    Debugging works by connecting cables to CN7 and CN11 in STM32MP157C-DK2 and setting them as shown in the attached figure.

    0693W000008xl87QAA.jpgHowever, if you connect ST-LINK v2/v3 to CN12 pin header of STM32MP157C-DK2 and set it as shown in the attached picture, debugging will not proceed and a command aborted message will be displayed as shown in the attached picture.

    0693W000008xl9jQAA.jpgDebugging does not work even if the resistors of SB17, SB19, SB20, SB22 are removed from the board and the debugging settings are changed. I don't know what the problem is. I want to know how I can debug using ST-LINK.