Skip to main content
Graduate
January 16, 2024
Solved

Debugging using vscode + ST-Link + cortex-debug with external flash (qspi)

  • January 16, 2024
  • 2 replies
  • 17560 views

VSCode is gaining in popularity at work and so I had a requirement to use it as the development platform for an ST mcu based project. I have very little experience with vscode and as I was unable to find an answer to my problem I thought that I would share what worked for me.


My application uses both internal and external flash for code (qspi). I created an external loader (MT25Q128A_STM32F746_KAL_AB.stldr) and was able to program this in STM32CubeIDE by configuring the external loader details in the debugger tab. VSCode requires certain extensions - cortex-debug; MemoryView; Peripheral Viewer and RTOS Views. Sorry if I've missed any.

The way to debug the application is to create a launch.json file. Below is mine. Hope it helps

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "<myapp Debug>",
"cwd": "${workspaceFolder}",
"executable": "./debug/<myapp>.elf",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"servertype": "stlink",
"serverArgs":
[
"-s",
"-m", "0",
"-k",
"--frequency", "21000",
"-el C:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin\\ExternalLoader\\MT25Q128A_STM32F746_KAL_AB.stldr"
],
"armToolchainPath": "C:/ST/STM32CubeIDE_1.6.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235/tools/bin",
"device":"STM32F746IGK7" ,
"svdFile": "C:/ST/STM32CubeIDE_1.6.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.productdb.debug_2.1.100.202311191741/resources/cmsis/STMicroelectronics_CMSIS_SVD/STM32F746.svd"
}
]
}

    This topic has been closed for replies.
    Best answer by DRega.1

    This is just to mark the solution as accepted

    2 replies

    Technical Moderator
    January 16, 2024

    Hello @DRega.1 

     

    If you would like to learn more about how to implement and use your external loader, please check this article How to implement and use your own external flash l... - STMicroelectronics Community

    Graduate II
    January 16, 2024

    The post suggests the @DRega.1 has already done that successfully..

    Technical Moderator
    January 17, 2024

    Thank you @Tesla DeLorean . I didn't catch it. Thanks @DRega.1  for sharing your implementation

    DRega.1AuthorAnswer
    Graduate
    January 24, 2024

    This is just to mark the solution as accepted