cancel
Showing results for 
Search instead for 
Did you mean: 

STMCubeMX Code Generation Fails on Linux

kyle_samara
Associate II

Hi,

 

I'm experiencing some issues on Linux with code generation in MX. The system I'm running is:

STM32CubeMX version 6.12.1

Pop!_OS (Ubuntu based) version 22.04

Generating code for a Nucleo-H755ZI-Q [although I doubt this matters]

 

Specifically, when clicking the "Generate Code" button in MX, nothing happens and the following Java error is logged in the background:

 

2024-09-24 19:39:38,855 [ERROR] ProjectManagerView:732 - 
com.teamdev.jxbrowser.ObjectClosedException: Attempted to use a closed object.

You're trying to call a method of a closed object. Usually, it happens when you
call the `close()` method of an object (or its owner) prior to calling methods
of that object.

Another common cause of this exception is working with cached DOM or JavaScript
objects. For example, if you navigate to another web page and try to call
a method of a DOM or a JavaScript object from the previous page, you will get
this exception.

It's also possible that the native Chromium process has crashed. In that case,
all the objects that belong to that process are closed automatically.

The following article explains this exception in detail: https://links.teamdev.com/jxbrowser-object-closed-exception

at com.teamdev.jxbrowser.internal.CloseableImpl.checkNotClosed(CloseableImpl.java:41) ~[STM32CubeMX:?]
at com.teamdev.jxbrowser.browser.internal.BrowserImpl.mainFrame(BrowserImpl.java:233) ~[STM32CubeMX:?]
at com.st.microxplorer.plugins.userauth.WebApp.isAuthenticated(WebApp.java:672) ~[?:?]
at com.st.microxplorer.plugins.userauth.UserAuth.handleAuthentication(UserAuth.java:479) ~[?:?]
at com.st.microxplorer.plugins.userauth.UserAuth.getSpecificTask(UserAuth.java:269) ~[?:?]
at com.st.microxplorer.plugins.projectmanager.gui.ProjectChoiceTab.save(ProjectChoiceTab.java:1458) ~[?:?]
at com.st.microxplorer.plugins.projectmanager.ProjectManagerView.generateCode(ProjectManagerView.java:1069) ~[?:?]
at com.st.microxplorer.plugins.projectmanager.ProjectManagerView.getSpecificTask(ProjectManagerView.java:730) ~[?:?]
at com.st.microxplorer.maingui.RibbonBar$1.actionPerformed(RibbonBar.java:376) ~[STM32CubeMX:?]
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) ~[?:?]
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) ~[?:?]
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?]
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?]
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?]
at java.awt.Component.processMouseEvent(Component.java:6626) ~[?:?]
at javax.swing.JComponent.processMouseEvent(JComponent.java:3389) ~[?:?]
at java.awt.Component.processEvent(Component.java:6391) ~[?:?]
at java.awt.Container.processEvent(Container.java:2266) ~[?:?]
at java.awt.Component.dispatchEventImpl(Component.java:5001) ~[?:?]
at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?]
at java.awt.Component.dispatchEvent(Component.java:4833) ~[?:?]
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) ~[?:?]
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) ~[?:?]
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) ~[?:?]
at java.awt.Container.dispatchEventImpl(Container.java:2310) ~[?:?]
at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?]
at java.awt.Component.dispatchEvent(Component.java:4833) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) ~[?:?]
at java.awt.EventQueue$5.run(EventQueue.java:747) ~[?:?]
at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:744) ~[?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]

 

Please let me know if you have any ideas on what this issue is related to. Or if you suspect an error in setup or possibly coming from Eclipse itself.

 

Thanks,

Kyle

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for the response and the warm welcome @Mahmoud Ben Romdhane.

I don't suspect that it's connect to the `.ioc` file in this case, since the failure occurs for any default unmodified project in MX (such as the `.ioc` file attached). I have also noticed that the example project generation in Cube IDE fails with the same error. My suspicion is that it is related to my host system, so to test I installed MX inside of a Ubuntu 22.04 VM. The code generation there works flawlessly. Additionally, I tried on another machine running Pop!_OS and had no issues there.

I tried the workarounds that @PGump.1 mentioned but unfortunately none did the trick for this particular bug.

For now I've migrated to developing on that second machine. Unfortunately, this is not a very satisfying solution, but I suspect that there was some window configuration on the original machine that caused the Java app to have a crisis.

I'm going to mark this post as the solution, albeit not a very satisfying one.

 

Thanks for the help, all.

View solution in original post

4 REPLIES 4
PGump.1
Senior III

I have had problems with CubeMX with Linux for years... The problems are based on the circular Events() references that the author(s) have designed into the software.  

I'm using Tumbleweed. There are somethings that I have found that can help -

  • Some versions run better with GUI X11, while others work better with Wayland.
  • With MX, only have a network connection when doing a new design. Once the necessary modules have been downloaded, save and close the project without generating code. Close MX. Disconnect from the internet, then open MX, then configure your project, and generate the code.
  • If you are going to change the label of a pin - hide the graphic of the device first, then change the label in the Peripheral > GPIO Tab. Otherwise, you can trigger an endless loop of Label_Change_Events() on that pin...

I hope that helps.

Kind regards
Pedro

 

 

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Mahmoud Ben Romdhane
ST Employee

Hello @kyle_samara ,

Fist let me thank you for posting and welcome to the ST Community.

For more investigation, I suggest that you provide you Ioc.File.

Thanks.

Mahmoud

Thanks for the tips, Pedro. I'll give them a try!

Thank you for the response and the warm welcome @Mahmoud Ben Romdhane.

I don't suspect that it's connect to the `.ioc` file in this case, since the failure occurs for any default unmodified project in MX (such as the `.ioc` file attached). I have also noticed that the example project generation in Cube IDE fails with the same error. My suspicion is that it is related to my host system, so to test I installed MX inside of a Ubuntu 22.04 VM. The code generation there works flawlessly. Additionally, I tried on another machine running Pop!_OS and had no issues there.

I tried the workarounds that @PGump.1 mentioned but unfortunately none did the trick for this particular bug.

For now I've migrated to developing on that second machine. Unfortunately, this is not a very satisfying solution, but I suspect that there was some window configuration on the original machine that caused the Java app to have a crisis.

I'm going to mark this post as the solution, albeit not a very satisfying one.

 

Thanks for the help, all.