cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CubeMX bug tracker/feature request

sincoon
Associate II
Posted on March 29, 2016 at 21:05

Is there some bug tracker or feature request branch on forum? How can I leave feedback for this software?

Anyway, here I'll post my proposition.

CubeMX generates initialization of periphery like this:

  /* Initialize all configured peripherals */

  MX_GPIO_Init();

  MX_DMA_Init();

  MX_I2C3_Init();

  MX_USART2_Init();

  /* USER CODE BEGIN 2 */

But sometimes I need to place code BEFORE before, for example, MX_DMA_Init() but after this block

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */

  HAL_Init();

  /* Configure the system clock */

  SystemClock_Config();

My real example: I have MPU6050 MEMS accelerometer/gyro. And it does not have reset pin. Due to that this is I2C device, it have one problem as ''I2C lockup''. The one possible solution is reconfigure I2C pins as push-pull and toggle clock pin until device becomes free. I've placed this procedure after

MX_GPIO_Init();

But every time when CubeMX regenerate code, it clears my code, because there are no ''use begin-end'' block.

My proposition is place additional user begin/end blocks there.

#!stm32-!cubemx
2 REPLIES 2
Nesrine M_O
Lead II
Posted on March 30, 2016 at 11:41

Hi sinitsin.artyom,

You can always post your requests & report your issues in our STM32 related forums. This way, you will contribute in the enhancement of our STM32 related solutions.

Regarding your request I will raise it to our MX team.

-Syrine-
stm32cube-t
Senior III
Posted on April 12, 2016 at 15:58

Dear user,

Please note the Advanced Settings tab under the Project settings window. In there you can control the order in which you want the calls to occur (Rank column) and whether or not you want the init call to be made automatically. Checking the option not to generate the MX_xxx_Init() allows you to call that function where ever you want in your code.

Can you let us know if that covers your needs or if you're still missing a user section  somewhere.

Currently we do not offer a user section within this part:

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

  HAL_Init();

  /* Configure the system clock */

  SystemClock_Config();

  /* Initialize all configured peripherals */

  MX_GPIO_Init();

Thanks