cancel
Showing results for 
Search instead for 
Did you mean: 

complement or replace CubeMX?

po221
Senior

Hello

I am using CubeIde and cubeMx on a project for several years with no issues.

But I am facing today a limit of CubeMx:
On a STM32L431RCTx I need to have UART2_RX on PA15 and PA2 as GPIO_EXT, not as UART2_TX. CubeMX forces me to have PA2 as UART2_TX :(

I also can't easily use "USER CODE BEGIN/END" areas because CubeMX uses elseif which I can't split (see attached image)

1) Is there a trick to mixing MX setups and personal setups (and this "elseif" not nice)?
2) Is it better to configure everything manually? if so, what is the best practice?

Thank you very much in advance

PS : I'm using CubeID3 1.13 with STM32Cube FW_L4 V1.18.0

22 REPLIES 22
haha. a minute... if you copy-paste.

Exactly. Take the ST example and copy-paste. Done. The amount of knowledge required, time spent and code quality is the same, but at least you can fix it and it will not be modified without you knowing it.

And don't forget 2-3 (typically) reviewers who will ponder on these lines, and then maintainers.

And how does it change with automatically generated code? The /* USER CODE ... */ comments make it even harder to read. And what's really the point of such "thorough" reviewing, if you are accepting a broken drivers anyway?

 

Cube does not support the RX/TX swap with single-wire yet. Or does it already?

No, it's just a little more than 9 years since CubeMX was created. You wouldn't expect the basic USART functionality in such a tiny amount of time, would you?

Nikita91
Lead II

A huge thank you to those who designed CubeMx


Not so huge...

MX restricts the use of UARTs since it does not allow you to configure a UART in RX only (simply by not defining a pin for TX). The designers just didn't think a UART could be used like this.

While this is possible very easily outside MX

This is one of the difficulties with this kind of generator: impossible to think a priori of all the possible uses by hundreds of thousands of users!

The other is to respond to everything that can be imagined with a single code: it is necessarily very heavy...

po221
Senior

Thank you all

I merged my project and removed CubeMx and now I structure the project again by managing the inits more efficiently, without the CubeMx framework but keeping its syntax.

I have a bogus project on the side with CubeMx to test configurations and keep the advantage of CubeMX.

THANKS