Skip to main content
Visitor
September 3, 2026
Question

STM32CubeMX hangs during first code generation on U: drive – FileNotFoundException in MXTmpFiles

  • September 3, 2026
  • 1 reply
  • 11 views

Hello,
 

I am experiencing a reproducible issue with STM32CubeMX when generating a project for the first time on our U: drive. Our environment is part of an Active Directory domain, and each user has a U: drive mapped to their personal network home folder.

 

Error in STM32CubeMX.log

During generation, CubeMX successfully creates several temporary files in:

 
 
U:\FreeRTOS_M2\testv10\MXTmpFiles\
 

For example:

 
 
17:02:54.994 oldGeneratedFile ...\rtos_kernelStart.tmp_save
17:02:55.076 Generated code: ...\rtos_kernelStart.tmp
 

However, during the next generation pass, CubeMX tries to access the .tmp_save file again:

 
 
17:02:56.195 oldGeneratedFile ...\rtos_kernelStart.tmp_save
17:02:56.200 ERROR ProjectBuilder

java.io.FileNotFoundException:
U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_kernelStart.tmp_save
(The system cannot find the file specified)
 
2026-09-03 17:02:55,707 [INFO] CodeEngine:297 - oldGeneratedFile, U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_threads.tmp_save
2026-09-03 17:02:55,774 [INFO] CodeEngine:321 - Generated code: U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_threads.tmp
2026-09-03 17:02:55,850 [INFO] Middleware:1457 - No code input for Bsp Dependency
2026-09-03 17:02:55,936 [INFO] CodeEngine:297 - oldGeneratedFile, U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_inc.tmp_save
2026-09-03 17:02:56,025 [INFO] CodeEngine:321 - Generated code: U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_inc.tmp
2026-09-03 17:02:56,075 [INFO] CodeEngine:297 - oldGeneratedFile, U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_kernelInit.tmp_save
2026-09-03 17:02:56,149 [INFO] CodeEngine:321 - Generated code: U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_kernelInit.tmp
2026-09-03 17:02:56,195 [INFO] CodeEngine:297 - oldGeneratedFile, U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_kernelStart.tmp_save
2026-09-03 17:02:56,200 [ERROR] ProjectBuilder:2275 - 
java.io.FileNotFoundException: U:\FreeRTOS_M2\testv10\MXTmpFiles\rtos_kernelStart.tmp_save (Le fichier spécifié est introuvable)
    at java.io.FileInputStream.open0(Native Method) ~[?:?]
    at java.io.FileInputStream.open(FileInputStream.java:213) ~[?:?]
    at java.io.FileInputStream.<init>(FileInputStream.java:152) ~[?:?]
    at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1138) ~[STM32CubeMX.exe:?]
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1091) ~[STM32CubeMX.exe:?]
    at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:302) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:6698) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCode(CodeGenerator.java:5484) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCodeFile(CodeGenerator.java:1906) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:2289) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:11396) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1612) ~[STM32CubeMX.exe:?]
    at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:3469) ~[?:?]
    at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2272) ~[?:?]
    at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:821) ~[?:?]
    at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61) ~[?:?]
 
 

The exception comes from FileUtils.copyFile() / CodeEngine.genCode().

What is interesting is that the rtos_kernelStart.tmp file had been successfully generated immediately before the failure, together with the other FreeRTOS temporary files.

Workaround / additional observations

If I kill the STM32CubeMX process after it hangs, reopen CubeMX and open the same project, code generation succeeds on the second attempt.

This behavior is reproducible.

More importantly, if I create exactly the same project under a local directory such as:

 
 
C:\temp\testv10
 

code generation succeeds normally on the first attempt.

Therefore, the problem seems related to file handling / temporary file creation or renaming in MXTmpFiles when the project is located on the U: drive.

It looks like there may be a timing / file access issue between the creation of:

 
 
rtos_kernelStart.tmp
 

and the handling of:

 
 
rtos_kernelStart.tmp_save
 

Could you please confirm whether this is a known issue in STM32CubeMX 6.18.1-RC2, especially when projects are stored on a non-local drive?  Could you please let us know if there is any workaround that would allow us to keep generating and storing STM32CubeMX projects directly on the U: drive it’s a network drive personnal folder, each user have they own one, as our students are not permitted to write files to other locations?

I provide the complete STM32CubeMX.log.

Thank you.

1 reply

alikhan
Visitor
September 5, 2026

This looks more like a file-access or timing issue with the mapped network drive than a problem with the project itself. Since the same project works correctly from a local path, testing a local temp directory while keeping the project on U: might be worth trying.

alikhan