Azure-Samples / Azure-Samples/iot-middleware-freertos-samples

Cannot launch VS Code debugger with STM32

Open
#120 10 comments 0 reactions 0 assignees View on GitHub
customer-issued
Dominant language
CMake
Stars
88
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Well, basically nothing works out of the box or by just simply following the [instructions](https://github.com/Azure-Samples/iot-middleware-freertos-samples/blob/main/demos/projects/ST/b-l475e-iot01a/VSCodeDebug.md):

The first problem is that the PowerShell script simply doesn't work:

![image](https://user-images.githubusercontent.com/13845895/141350514-4890b14d-02f7-4946-94b0-35e3eed2cb99.png)

However, I was able to execute the script manually from the CMD and it successfully fetched the RTOS.

If I skip it I hit the problem with openocd:

![image](https://user-images.githubusercontent.com/13845895/141352798-72d6ce0d-3a48-42e3-8bc9-d67f67e3d966.png)

I tried to add -s command to openocd:
![image](https://user-images.githubusercontent.com/13845895/141358729-853293cc-9c24-404e-b4b5-d0d2eeab41e8.png)

I can launch it manually from the power shell:

![image](https://user-images.githubusercontent.com/13845895/141358551-ce741907-d3cb-4dd4-a533-c772266a996f.png)

OpenOCD folder looks like this:
![image](https://user-images.githubusercontent.com/13845895/141358609-c49d74c4-3086-43e6-b625-67e5445dc835.png)

PATH variable points to C:\ST\OpenOCD-20210729-0.11.0

I have noticed a weird thing...

![image](https://user-images.githubusercontent.com/13845895/141381854-5d7ad232-eed3-4944-b847-5ee73fd926b7.png)

why does it add '-s' and the root folder of the IoT project for the openocd cfg search path?

I couldn't find any JSON settings explicitly doing this.

After I copied folders from the openocd into the root of the project at least the debugger starts.

**Since you guys went through this hassle can you see or possibly identify where the problem might be with all those things?**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.