cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: STM32CubeMX code generation for TrueStudio

Gavin Baker
Associate III
Posted on February 15, 2018 at 04:53

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(TrueStudioGenerator.java:1228)

at convertor.Convertor.generateTSTKProject(Convertor.java:1230)

at convertor.Convertor.generateTrueStudioFiles(Convertor.java:1113)

at convertor.Convertor.generate(Convertor.java:653)

at convertor.Convertor.convert(Convertor.java:559)

at convertor.Convertor.updateProject(Convertor.java:412)

at com.st.microxplorer.plugins.projectmanager.model.ToolchainGenerator.update(ToolchainGenerator.java:118)

at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createToolChainFolders(ProjectBuilder.java:1769)

at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:594)

at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:41)

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

#code-generation #truestudio #bug #cubemx
7 REPLIES 7
Gavin Baker
Associate III
Posted on February 15, 2018 at 06:20

Some additional information which may be relevant: the project in question has been converted to have a C/C++ Nature.

Posted on February 24, 2018 at 11:37

Hi, I have the same problem...

It occurs on both C and C++ projects, no difference

I tried on several PCs but nothing has changed

The problem emerged with the latest version of 

STM32CubeMX 4.24

The previous one worked fine

Thanks

Rodolfo

Imen.D
ST Employee
Posted on February 26, 2018 at 13:23

Hello,

Please share your ioc file to check this issue.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on February 26, 2018 at 14:55

Hello Imen,

Thank you for your interest, and please excuse my bad english.

I enclose two examples and the sequence for replicating two different problems that emerged in the latest release of CubeMX.

Example N.1

You can open the working project 'Reel-Working' with TrueSTUDIO, you will see that you can rebuild it without problems.

If you regenerate the project with CubeMX, you should get this error (image: Project generation error.PNG).

Now, if you rebuild it, you should see the file 'system_stm32l0xx.c' duplicated in two folders (image: Build error.PNG).

Example N.2

Starting from the Mxt.ioc file, you generate the project.

You should see, by opening it with TrueSTUDIO, that it is not possible to compile it.

Although there are files related to CMSIS and RTOS, from project explorer are not visible, it is probably just a problem of paths, I have not investigated the problem because at the moment I'm working on something else.

I've been working with TrueSTUDIO for about 2 years, I'm not an expert, but I've never had this problem before.

I found the same problem on other projects too, it is very repeatable.

If you need more precise information, do not hesitate to ask.

Thank you!

Best Regards

Rodolfo

________________

Attachments :

Project generation error.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxw4&d=%2Fa%2F0X0000000b2U%2FFQRZ5OGBY7eZrioGGMbeQ7wa.l5qmhDW7OTdqbPG.xA&asPdf=false

Mxt.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxvM&d=%2Fa%2F0X0000000b2R%2FePiEDr9QJNweyarC2hyi0JDAOJwU_VDKX.2FrC61qtQ&asPdf=false

Reel-Working.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxwE&d=%2Fa%2F0X0000000b2W%2Fxh9msODhQJYMgwIlOv7VafA5TDMrfiuUNZgrk8S2wGs&asPdf=false

Build error.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxbg&d=%2Fa%2F0X0000000b2T%2FeQeL8CLdFTttfHXJ8q71w6f7uaiRU22Z34NXI69KZ2c&asPdf=false
Posted on March 02, 2018 at 02:55

I have a similar problem. All I wanted to do was create a F4Discovery project with FreeRTOS, once FreeRTOS was enabled, I could not get the project to be generated correctly. No change in settings other than the checkbox.

________________

Attachments :

FirstTrueStudioF4Disco.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxvf&d=%2Fa%2F0X0000000b2N%2F9Z6wcW6dGIA.X_aEfNf.JGZ17NQNdLHhOpvV3Wg7QnQ&asPdf=false
Jeanne Joly
Senior III
Posted on March 05, 2018 at 14:57

Hi

gavin.baker

,

Beck.Joseph

,

Vigilante.Rodolfo

,

This issue will be fixed in the next CubeMX release (4.25).

Please upgrade your CubeMX release as soon as it is available.

BR. Jeanne

jeffz
Associate II

I still see this problem with CubeMX V4.27.0.

It worked fine at beginning. But after I modified code in TrurStudio, it start to get problem.

Please help.