cancel
Showing results for 
Search instead for 
Did you mean: 

Win11 - Failed to generate code CubeMX 6.13

p2baron
Associate

Hi,

CubeMX is unable to generate code. The program freezes and I find the following message in the logs.

 

2025-01-04 21:22:40,906 [INFO] BlockDiagram:2766 - set Specific Code input for plugin: RCC
2025-01-04 21:22:40,921 [INFO] CodeGenerator:896 - code generatio: config db path: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\\db\
2025-01-04 21:22:41,089 [INFO] CodeEngine:255 - oldGeneratedFile, G:\Mijn Drive\Workspace\vscode_stm32\Finger\MXTmpFiles\license.tmp_save
2025-01-04 21:22:41,551 [INFO] CodeEngine:279 - Generated code: G:\Mijn Drive\Workspace\vscode_stm32\Finger\MXTmpFiles\license.tmp
2025-01-04 21:22:41,759 [ERROR] CodeEngine:200 - catch error: Failed to copy full contents from 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\templates\gpio_c.ftl' to 'G:\Mijn Drive\Workspace\vscode_stm32\Finger\gpio_c.ftl'
2025-01-04 21:22:41,759 [ERROR] ProjectBuilder:2207 - 
java.lang.NullPointerException: Cannot invoke "com.st.microxplorer.codegenerator.TemplateFile.getPath()" because "this.template" is null
	at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:243) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:6282) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generatePinoutConfigCode(CodeGenerator.java:2935) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:1948) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:10606) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1594) ~[STM32CubeMX.exe:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:3026) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2204) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:809) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61) ~[?:?]

 

 

Are there any restriction to what path it can handle? 

I'm trying to save it to my google drive which is being mapped to G: by the Google drive client.

Saving it to a location on my physical drives works without any troubles.

1 ACCEPTED SOLUTION

Accepted Solutions
p2baron
Associate

Turned out I had my Google drive client set to 'stream' my files in stead of making a local copy.

Changing this solved my issue.

Here is some more info also how to get rid fo the space in "My drive".

 

thanks for everyone's suggestions.

 

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

I'm trying to save it to my google drive which is being mapped to G:

Better don't. If one actively looks for problems, one finds them pretty soon. 

 

 

Pausing the drive client makes no difference.

Too bad, I like to use drive to sync my workspace..

Version control tools (git and others) exist for this goal.

 

TDK
Guru

> G:\Mijn Drive\

The issue could be a space appearing in the path. Better to avoid that as not every program handles it appropriately.

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

Turned out I had my Google drive client set to 'stream' my files in stead of making a local copy.

Changing this solved my issue.

Here is some more info also how to get rid fo the space in "My drive".

 

thanks for everyone's suggestions.