cancel
Showing results for 
Search instead for 
Did you mean: 

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

DRega.1
Associate III

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"
}
]
}

1 ACCEPTED SOLUTION

Accepted Solutions
DRega.1
Associate III

This is just to mark the solution as accepted

View solution in original post

4 REPLIES 4
FBL
ST Employee

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

DRega.1
Associate III

This is just to mark the solution as accepted