Issues with IDE
In this article, let’s talk about the issues with the STM32CubeIDE.
This issue is related to the debugging session of the IDE, and you may also encounter it. If you encounter it, then you can troubleshoot it, which I will discuss now.
Here I have a simple project.
And let me debug this project first. For that, select the project and Right-click over that, select Debug As, and select STM32 Cortex-M C/C++ Application, as shown in Figure 2.
Here, you can see that(Figure 3) the IDE is going into the debug perspective. Let’s click on Switch.
Everything is as expected, and you can see the Debug perspective. Let’s enable the tracing, and let me test this. You can see that there are some unknown characters shown in Figure 4.
To solve this issue, you can click on Remove all collected SWV data, then a click on Reset the chip and restart debug session, and after a click on Step Over, as shown in Figure 5.
Now it works. It prints a “hello world” message, as shown in Figure 6.
Now you want to go back to your C and C++ perspective. That is your editing perspective. So, you should be terminating this debug session. There are two termination options. One is Terminate, and another one is a Terminate and relaunch, as shown in Figure 7.
If you click the Terminate and relaunch button, the debug session will be terminated, but it will again relaunch.
Now, let me click the Terminate button. And when I click that, you can see that the IDE automatically went back to the C/C++ perspective, where you can again edit your code, build your code, and again debug.
Let’s again try to debug.
And here you can see that(Figure 8), it again goes into the debug perspective. That’s correct.
This should be normal behavior. But the problem comes when there is one more terminate button here(as shown in Figure 9). Now the problem comes when you use this button to terminate the debug session.
Now let’s use that button to terminate the debug session.
Let’s click that button, and here you can see that the debug session is terminated, and the perspective is changed back to the C and C++ perspective(as shown in Figure 10).
Now try to debug the code once again. And here is a problem, as shown in Figure 11.
Now it says that “Error in final launch sequence.” This error is observed in newer versions of STM32CubeIDE.
In the older versions, I didn’t find these problems. I don’t know whether it is a known bug or it may not be a bug.
Now the workaround for this issue is very simple. Just click OK, and go to the debug perspective manually, Right-Click on that option, click on Terminate and remove, as shown in Figure 12.
And then go back to the C and C++ perspective. After that, again try to debug the code, and this time it should work. I don’t know whether you will face this issue, but if you face this issue, just use this workaround or don’t use that terminate button; always use the above terminate button.
FastBit Embedded Brain Academy Courses
Click here: https://fastbitlab.com/course1