cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMXIDE multiple definition bug still here

Harvey White
Senior III

FreeRTOS project:

code generated includes code in Drivers/CMSIS/Device/ST/STM32F4x/Source/templates

File is of definitions, likely stm32F4xx.h

This conflicts with the file included at Drivers/CMSIS/Device/ST/STM32F4x/Include.

This seems to only happen when using FreeRTOS and CMSIS V2 interface.

Did you mean to include something like stm32F4xx.C in the templates location?

The information is redundant, giving me about 8 multiple definitions. Deleting the template file produces working code.

This has been around for a long while.

17 REPLIES 17
Sara BEN HADJ YAHYA
ST Employee

Hello @Harvey White​ ,

Thanks for your feedback,

Could you please share your ioc file and specify the CubeMX version?

Thanks,

Sara.

Harvey White
Senior III

copied existing project into another directory and renamed it to avoid messing up existing project.

Project compiled properly.

opened IOC perspective and changed main memory heap assignment in FreeRTOS from 128000 to 120000.

Saved to generate code.

Duplicate file appears.

system_stm32f4xx.c

multiple definitions since a .c file is not protected.

did you mean to add system_stm32f4xx.h?

Note that this is a bit of a complicated project.

Sara BEN HADJ YAHYA
ST Employee

Hello @Harvey White​ ,

Does this issue still exists?

I couldn't reproduce it from my side.

Sara.

Harvey White
Senior III

The issue exists and can be reproduced here.

I can create a project that does not have this fault. At some point in project development, changing the IOC file, changing parameters in FreeRTOS, something gets triggered and CubeMXIDE decides that it needs to put that file in. It's only one file, it's only in one place, but after that is triggered, it's consistent.

If it were simple to reproduce, I might have figured it out and could have told you how to reproduce this problem.

All I can do is make some suggestions on how to find the problem.

1) What was the idea behind putting that system_stmf4xx.c file under the template folder? It seems to have no purpose (and if you wanted to put the .h file in, it might make more sense). The file does duplicate an existing file, so one of them (likely the template file) is just simply wrong.

2) if it is right, then what triggers the inclusion of that file? And what (also) triggers the existing file? Since the default must have that file included, and it isn't in the template folder by default, why is it there?

There has to be a set of conditions that cause that file to be included. The structure is there, the template folder is there, but the folder is empty. What code causes that to be put in?

3) what calls that code? Under what circumstances? Since when it gets included, it seems to stay included, that points to either a set of conditions that gets tripped, or perhaps a global in your code that is never initialized.

I can't answer these questions, someone needs to look at the code to find out what's going on. This is in the current version (1.8.0), and it's been in previous versions for the two to three years at least.

If your update completely installs the version, and does not leave older files behind, then this has persisted from version to version. If you leave older files behind, then it's possible that a completely new install would work.

Since you can't reproduce it with the IOC file, it has nothing to do with the IOC file itself, but much to with how the CubeMXIDE program treats the IOC data.

Sara BEN HADJ YAHYA
ST Employee

Hello @Harvey White​ ,

Did you try the CubeMX standalone version and got the same result ?

@mattias norlander​  could you please check this issue ?

Sara.

Harvey White
Senior III

CubeMX standalone *may* not generate the same error, but the code generation process gives me an error,

!SESSION 2022-02-16 11:32:29.245 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.10
java.vendor=AdoptOpenJDK
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -application com.st.stm32cube.ide.common.services.mx.rcpApp -rmiServerPort 64063 -projectUpdate -buildType exec -src cube -cubeScratchFile C:\Users\madyn\OneDrive\Documents\Projects\ARM projects\PROJECT 20\PROJECTS\F469I_disco\F469I\mx.scratch
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -application com.st.stm32cube.ide.common.services.mx.rcpApp -data C:\Users\madyn\.stm32cubeide\.workspace_207863113403245355 -rmiServerPort 64063 -projectUpdate -buildType exec -src cube -cubeScratchFile C:\Users\madyn\OneDrive\Documents\Projects\ARM projects\PROJECT 20\PROJECTS\F469I_disco\F469I\mx.scratch
 
!ENTRY org.eclipse.osgi 4 0 2022-02-16 11:32:32.625
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
	at com.st.stm32cube.common.projectcreation.core.ProjectUtilities$ProjectRessourceVisitor.visit(ProjectUtilities.java:835)
	at org.eclipse.core.internal.resources.Resource.lambda$1(Resource.java:117)
	at org.eclipse.core.internal.resources.Resource.lambda$0(Resource.java:85)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85)
	at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90)
	at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:55)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:117)
	at org.eclipse.core.internal.resources.Resource.accept(Resource.java:105)
	at com.st.stm32cube.common.projectcreation.core.ProjectUtilities$ProjectRessourceVisitor.getResources(ProjectUtilities.java:842)
	at com.st.stm32cube.common.projectcreation.core.ProjectUtilities.removeProjectOrphanLinkResources(ProjectUtilities.java:816)
	at com.st.stm32cube.ide.common.services.project.ProjectUpdateService.doProjectUpdate(ProjectUpdateService.java:53)
	at com.st.stm32cube.ide.common.services.project.HierarchicalProjectTreeSetupService.HierarchicalProjectTreeSetup(HierarchicalProjectTreeSetupService.java:138)
	at com.st.stm32cube.ide.common.services.project.HierarchicalProjectTreeUpdateService.doProjectUpdate(HierarchicalProjectTreeUpdateService.java:41)
	at com.st.stm32cube.ide.common.services.adapted.core.project.ProjectUpdateRcpServiceProcess.doProjectUpdate(ProjectUpdateRcpServiceProcess.java:245)
	at com.st.stm32cube.ide.common.services.adapted.core.project.ProjectUpdateRcpServiceProcess.doProjectUpdate(ProjectUpdateRcpServiceProcess.java:239)
	at com.st.stm32cube.ide.common.services.adapted.core.project.ProjectUpdateRcpServiceProcess.doProjectUpdate(ProjectUpdateRcpServiceProcess.java:170)
	at com.st.stm32cube.ide.common.services.adapted.core.project.ProjectUpdateRcpServiceProcess.run(ProjectUpdateRcpServiceProcess.java:121)
	at com.st.stm32cube.ide.common.services.mx.core.project.ProjectUpdateRcpService.doProjectUpdate(ProjectUpdateRcpService.java:171)
	at com.st.stm32cube.ide.common.services.mx.core.project.ProjectUpdateRcpService.run(ProjectUpdateRcpService.java:166)
	at com.st.stm32cube.ide.common.services.mx.update.MxUpdateProjectRcpService.run(MxUpdateProjectRcpService.java:111)
	at com.st.stm32cube.ide.common.services.mx.update.MxUpdateProjectRcpService.run(MxUpdateProjectRcpService.java:104)
	at com.st.stm32cube.ide.common.services.mx.rcp.CubeIdeServices.start(CubeIdeServices.java:93)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
 
!ENTRY org.eclipse.core.resources 2 10035 2022-02-16 11:32:32.655
!MESSAGE The workspace will exit with unsaved changes in this session.

the error log is above.

So I'm not sure that it's generating code or not.

This is the latest version of CubeMX.

Sara BEN HADJ YAHYA
ST Employee

Hello @Harvey White​ ,

Could you please share with us the CubeMX standalone log file (STM32CubeMX.log) located in C:\Users\<Your_User_Name>\.stm32cubemx and the CubeMX plugin log file (.ide.log) located in C:\Users\<Your_User_Name>\STM32CubeIDE\workspace_1.8.0\.metadata.

The one you shared is related to eclipse.

Please make sure to delete the .stm32cubemx before generating the code when using CubeMX standalone.

Thanks,

Sara.

Harvey White
Senior III

STM32CubeIDE\workspace_1.8.0 does not exist

STM32CubeIDE\workspace_1.3.0 does, but has an updated data of 8/11/2021

Can't find the plugin log file

CubeMX standalone does not generate the extra file.

Running the standalone version after running the IDE version, and then refreshing (F5) causes the extra file to vanish.

I've been updating the IDE as needed, but I'm not sure where the 1.8 workspace is now.

Could that be a problem?

Sara BEN HADJ YAHYA
ST Employee

Hello @Harvey White​ ,

The workspace is where the project is saved, when you create a new project using CubeIDE, either you use the default location or you can change it (please refer to the attachment).

0693W00000KZZO8QAP.pngThe workspace can be changed by selecting [File]>[Switch Workspace], So it is not an issue when the workspace_1.8.0 does not exist, please check where your projects are saved and you will find the .metadata folder.

Did the project compiled correctly when you used the CubeMX standalone and after refreshing the project ?

Please make sure that the workspace and the project names must contain only ascii characters. This is also valid for the path to the workspace.

Could you please try to re-install CubeIDE and reproduce the issue ?

Sara.