cancel
Showing results for 
Search instead for 
Did you mean: 

[CUBE-MX] Annoying behavoiour

stanzanim
Associate III
Posted on May 03, 2016 at 17:10

Hello community

here they are my 5 cent of opinion about the - otherwise great - Cube MX.

I ee that, whenever I regenerate a project for whatever reason (changing clock scheme, using DMA for USART instead of polling etc.), if I keep the same project name the Cube re-generate the HAL coden of the select peripherals (OK), keep the user code inside the 'user-code begin / end' keyword of the source files (also OK) but

- a - recreate a new project file everytime (do not like)

- b - delete the user files under the directory <proj_name>/src and inc (do not like)

My project is under revision control so -b- is not too much annoying but -a- is: I cannot restore the old project file without loosing any new option introduced by the lastest Cube MX run

Please comment or advice in case I am doing something wrong or using a bad methodology

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Jeanne Joly
Senior III
Posted on May 09, 2017 at 17:09

Hello

stanzani.marco

,

This issue was delivered in CubeMX4. Don't hesitate to upgrade CubeMX with the latest release.

BR. Eric

View solution in original post

7 REPLIES 7
matic
Associate III
Posted on May 03, 2016 at 22:56

When we add our project under revision control, we separate it away from Cube. Whenever I want to make a change (and if I am not sure how to do it my way), I have another (exactly the same or at least similar) project created by Cube. Here I play and make all kind of changes. But then, the final change (which works), I manually put into the real project. Also, in that project we completely re-organised file structure. Peripheral initialization is no longer in main.c file, but in a dedicated driver file just for that peripheral. Also we throw out that interrupt file and MSP file which are generated by Cube.

stanzanim
Associate III
Posted on May 05, 2016 at 10:13

thanks obid.mac

I do nearly the same than you in real life. To enforce the consistency between Cube-MX (great) job and real life project I'd love that Cube-MX will not detroy the user file, though (why should so that: since Cube-MX preserve the user code inside the automatically generated files, it should preserve project structures and user files as well, IMO).

Mine is a suggestion to the Cube-MX development team (I can live without, BTW)
stm32cube-t
Senior III
Posted on May 10, 2016 at 17:31

Hello,

Note re-generating the code should not be removing your user files from inc/src directories.

Can you please indicate under which OS you are working and which toolchain you have selected for project generation.

Thank you

stanzanim
Associate III
Posted on May 25, 2016 at 14:40

here you go

I am using Keil 5.2 end CubeMX 4.13.1 under Windows 10@64bit
B Zikhali
Associate III
Posted on August 24, 2016 at 15:11

I have exactly the same problem with CubeMX 4.15.1 with True Studio on Windows 10. My code is deleted and sometimes whole files are deleted. If it wasn't for version control I'd be having to manually replace my files but it is making changing configuration a nightmare.

Sirma Siang
ST Employee
Posted on November 02, 2016 at 16:32

Hello Stanzani,

A bug has been recently corrected about a sync with windows indexer.

That led to some file deleted or partially updated.

The correction was added in 4.17.

Could you please try with that version to check if it solve your symptoms ?

Great thanks in advance.

Kind Regards

Sirma

Jeanne Joly
Senior III
Posted on May 09, 2017 at 17:09

Hello

stanzani.marco

,

This issue was delivered in CubeMX4. Don't hesitate to upgrade CubeMX with the latest release.

BR. Eric