cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE hangs while attempting to open .ioc file

msch
Associate III

I have intermittent problems in STM32CubeIDE 1.8.0 opening a .ioc file. When I double click on the file in the Project Explorer, I get a progress bar titled "Loading IOC". When things are working well, as soon as that bar fills up, it is replaced with a progress bar titled "Completing IOC Load"; and when that fills up, the configuration screen is dsplayed.

Sometimes the IDE gets into a state where the first progress bar will fill up, but the second one never appears. Instead, the window hangs--I get a spinning cursor, and the Windows message "not responding". This lasts forever. If I force quit the IDE and retry, many times, eventually it starts working again.

How can I keep this from happening, and if it does happen, how can I reliably and quickly recover?

11 REPLIES 11
mattias norlander
ST Employee

Hi,

How often does the error state happens? 1 in 10 attempts to open the ioc-file or more frequently?

I am wondering if it would be possible to copy the ioc-file and open it in CubeMX stand-alone to see if the same error occurs in MX stand-alone. That insight would indicate where we should start to have a deeper look (In MX or in the bridge/integration between MX and IDE)..

Are you able to share the ioc-file producing this issue? But maybe it only happens on your system...

Next time you encounter the issue could you immediately have a look in the workspace log-files and see if there are any exceptions that seem related (with related I mean "time stamp wise") to the error?

The log-files are in the folder $(workspace_dir)\.metadata\.

  • The one related to the IDE framework is called .log.
  • The one related to CubeMX is intuitively named .ide.log :p

Post your findings please!

TDK
Guru

The latest CubeIDE versions seem to have a lot more unnecessary communicating with the ST servers than previous versions which seems to lead to this behavior if something goes slightly amiss. It's very annoying. If you load an IOC file, and all necessary libraries are already on your PC, the IDE shouldn't need to check for new versions or talk to ST servers at all, and yet it does.

If you feel a post has answered your question, please click "Accept as Solution".
msch
Associate III

@TDK​ Have you also experienced this hang? It would be helpful to know that it's not just the installation on my machine that is doing this (admittedly, I'm using W7, and the computer only has 8G RAM, so it's possible that it's a Windows or memory-related issue).

msch
Associate III

@mattias norlander​ It's hard to say how often this happens--I had it happen a few times in one day recently, after not encountering it for a number of days. Once it happens, though, it's stuck--many quits and restarts of the IDE don't fix it. I did in fact investigate the logfiles. The suspicious thing I noticed was a message to the effect (on IDE launch) that an instance of MX was already running. So I suspect that maybe there is an ophaned MX process or a leftover lockfile. If you could tell me the Windows process name for MX and/or the locations and names of any lockfiles that I might delete, that would be helpful. I have looked but so far haven't figured out either of those. Obvioulsy *something* is retaining some state to cause it to keep hanging after relaunching STM32CubeIDE.

mattias norlander
ST Employee

Hypothesis: Maybe The CubeMX plug-in does not shutdown properly leaving an orphaned process. Maybe this could block you from opening the same, or another, ioc-file again.

I doubt that a restart of CubeIDE would solve that.

But rebooting the computer should clean out such process.

So, next time this happens could you try the following four step approach to see what works?

  1. Restart CubeIDE
    1. Is this sufficient to open the ioc-file?
  2. If not, try to launch CubeMX stand-alone (if you have it installed) and open any ioc-file?
    1. Is MX able to launch and open an ioc-file or blocked?
  3. If step2 did not work, try rebooting the computer. Are you now able to open an ioc-file inside CubeMX or CubeIDE?
  4. If step3 fails, you can clean out the tools metadata in the user folder.
    1. First to be safe, make sure you have back-up of workspace/projects even though they should not be touched.
    2. Delete the folders (or rename them if you want to be super safe): c:\User\MyUserName\
      1. .stm32cubemx
      2. .stmcufinder
    3. The metadata is auto re-created at next launch of CubeMX or next load of the ioc-file in CubeIDE.

These could be some pointers as to how you can troubleshoot this.

It is a bit difficult to give guidance since I cannot re-produce your problems.

From the next release, CubeIDE will officially only support Win10 and later versions.

We will also drop support to any MacOS version previous to 10.15.

We have already seen some issues with Windows version which are end-of-life. Another factor is that we cannot claim support for OS versions that our underlying frameworks even officially support...

msch
Associate III

1) Restarting CubeIDE does not help--I've done that many times.

2) I did try CubeMX standalone a while back, and although my memory is not clear, I think that it worked but I still had the problem when I went back to CubeIDE.

3) Yesterday in fact I did try rebooting the computer, and in that instance it fixed the problem.

msch
Associate III

I think I have found the trigger for the issue. If I am duplicating a project, if I've copied and renamed the .ioc ifle, but don't edit it to update the two places that the project name appears inside, that causes the problem.

To answer your question 4), deleting .stm32cubemx and .stmcufinder does not help. And when I recreated the problem this way, this time rebooting the computer *did not* fix the problem. Also, opening the .ioc in the standalone MX did not fix the problem with the IDE MX, even if I "generate code" from the standalone MX.

Right now, it is in the state where it hangs if I try to open the .ioc file. When I launch the IDE, this is what appears in .metadata/.log:

--------------------------------------------------------------------------------------------------------------

!SESSION 2022-02-02 11:15:30.771 -----------------------------------------------

eclipse.buildId=Version 1.8.0

java.version=11.0.11

java.vendor=AdoptOpenJDK

BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

Command-line arguments: -os win32 -ws win32 -arch x86_64

!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2022-02-02 11:15:35.724

!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.

!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2022-02-02 11:15:35.794

!MESSAGE Log4j initialized with config file C:\Users\mschuman\STM32CubeIDE\workspace_1.8.0\.metadata\.log4j.xml

!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2022-02-02 11:15:41.981

!MESSAGE Started RMI Server, listening on port 41337

-------------------------------------------------------------------------------------------------------------------

So it must be looking at some lockfile or other indicator of status to tell it that there is an unfinished MX session out there. It should be possible to look at the code and see what prompts that logfile entry.....

Ok, not sufficient log level to catch anything.

Could you try to increase the log level?

If using CubeMX standalone:

Set the log4j,properties in .stm32cubemx folder

It is the line: log4j.rootLogger=*** which defines the level of log (INFO = standard, TRACE = INFO + additional information)

If using CubeMX integrated in CubeIDE:

In the file /.metadata/.log4j.xml

Modify the line :

param name="Threshold" value="INFO"/

with

param name="Threshold" value="TRACE"/

SamHansen42
Associate III

Ran into this issue on macOS. Restarting the OS (NOT just ide) solved issue.