cancel
Showing results for 
Search instead for 
Did you mean: 

GRAPHICS_Init() in BoardConfiguration.cpp is modifed by CubeMX every time I generate a new project. Why?

Mvill.17
Associate III

GRAPHICS_Init() in BoardConfiguration.cpp is continuosly overwritten when I generate a new project with CubeMx 5.0 and this is particularly boring as I have to use my custom initialization for the LCD (specifically the LANDSCAPE orientation). Is it a bug of CubeMX ? Is there a way to tell CubeMX not tou touch that function?

7 REPLIES 7
Martin KJELDSEN
Chief III

Hi @Mvill.17​,

I feel your pain. CubeMX has a tendency to overwrite things it shouldn't. And overwrite fixes to things that weren't generated correctly. If you can give me a very specific example of what you're experiencing i can send it along to the cubeMX team.

A tip for a more bearable solution to this is to commit BoardConfiguration.cpp with git and simply restore it with "git checkout BoardConfiguration.cpp" every time CubeMX misbehaves.

/Martin

Mvill.17
Associate III

Thank you for the answer.

It's not a big issue: I'm working on a project based on the STM32F429 discovery. This board has a 240x320 display but as my board will have a 320x240 display I had

to rotate the display and so every time I update the project from CUBEMX it restore the things for the original display deleting my customizations.

Okay Marco,

And you're sure that none of these modifications cannot be done directly in cubemx?

/Martin

I'm not totally sure but can you suggest me where, in Cubemx, I can set the LANDSCAPE orientation perhaps?

I think it's under LTDC configuration.

OK I'll see.

It would be better anyway to know where CubeMX gets the platform files to integrate in the project so I can modify them, once for all, without re-generate a new project which is always a source of troubles

Cheers

It's not as simple as CubeMX copying some file from one location to another. Code generation in CubeMX is based on templates and i'm not sure they're publicly available through the release. I can try to check, though.

/Martin