AnsweredAssumed Answered

Bug: STM32CubeMX code generation for TrueStudio

Question asked by Gavin Baker on Feb 15, 2018
Latest reply on Mar 5, 2018 by Jeanne Joly

STM32CubeMX Version: 4.24.0

Target MCU: STM32F103RFTx LQFP64

Target IDE: Atollic TrueStudio


Steps to reproduce:


  1. Start with a valid, working .ioc file
  2. Select Save and Generate Code
  3. The first time, it successfully generates the code
  4. Note that the VCS reports changes to certain files (eg .cproject, .project, *.elf.launch, main.h, main.c) have been applied as expected
  5. Without changing anything at all in CubeMX, select Generate Code again
  6. This second time, an error occurs:
"The Code is successfully generated under C:/ProjectX/Firmware/MainBoard
but TrueSTUDIOproject generation have a problem"


The tail of the log file shows the exception:



2018-02-15 14:43:53,475 [INFO] CodeEngine:179 - oldGeneratedFile, C:\ProjectX\Firmware\MainBoard\Src\main.c_save
2018-02-15 14:43:53,690 [INFO] CodeEngine:197 - Generated code: C:\ProjectX\Firmware\MainBoard\Src\main.c
2018-02-15 14:43:53,902 [INFO] ProjectBuilder:1243 - Time for Copy HAL[2] : 8mS.
2018-02-15 14:43:53,913 [INFO] ProjectBuilder:1711 - Project Generator version: 2.27.0
2018-02-15 14:43:53,925 [INFO] ConfigFileManager:448 - The Die is : DIE430
2018-02-15 14:43:56,164 [INFO] ToolchainGenerator:124 - stack trace : java.lang.NullPointerException
at generators.TrueStudioGenerator.setFiles(
at convertor.Convertor.generateTSTKProject(
at convertor.Convertor.generateTrueStudioFiles(
at convertor.Convertor.generate(
at convertor.Convertor.convert(
at convertor.Convertor.updateProject(

2018-02-15 14:43:56,165 [INFO] ToolchainGenerator:125 - [Project Generator] Problem in the update of the project
2018-02-15 14:43:56,166 [INFO] ConfigFileManager:741 - mx.scratch is deleted!
2018-02-15 14:43:56,166 [INFO] ProjectBuilder:1777 - Time for Generating toolchain IDE Files: 2260mS.
2018-02-15 14:43:56,166 [ERROR] ProjectBuilder:1783 - Error in Project Generation
2018-02-15 14:43:56,166 [ERROR] ProjectBuilder:610 - Error in Project Generation



This failure is consistent and repeatable. It is also severe as it is stopping progress on this project.

If I revert the project to the last known good state, I can rerun the steps above.

Please let me know if you need any further details to resolve this urgent issue.


Thanks -


  :: Gavin