Microcontroller Embedded C Programming Lecture 50 | Issues with IDE

 

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.

Figure 1. Simple Project
Figure 1. 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.

Figure 2. Debug the project
Figure 2. Debug the project

 

Here, you can see that(Figure 3) the IDE is going into the debug perspective. Let’s click on Switch.

Figure 3. Confirm Perspective Switch
Figure 3. Confirm Perspective 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.

Figure 4. Unknown characters
Figure 4. Unknown characters

 

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.

Figure 5. Solving the issue
Figure 5. Solving the issue

 

Now it works. It prints a “hello world” message, as shown in Figure 6.

Figure 6. Hello world message
Figure 6. Hello world message

 

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.

Issues with IDE
Figure 7. Terminate, Terminate and relaunch button

 

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.

Issues with STM32CubeIDE
Figure 8. Confirm Perspective Switch

 

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.

Issues with STM32CubeIDE
Figure 9. One more terminate button

 

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).

Issues with STM32CubeIDE
Figure 10. C and C++ perspective

 

Now try to debug the code once again. And here is a problem, as shown in Figure 11.

Issues with STM32CubeIDE
Figure 11.Problem Occured

 

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.

Issues with IDE
Figure 12. Solving the problem

 

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

 

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.