AnsweredAssumed Answered

[STM32CubeMX] Bug in firmware package for STM32F0 family v1.7.0

Question asked by Mathieu Garivet on Apr 7, 2017
Latest reply on May 4, 2017 by Jeanne Joly

Hello,

 

I'm using STM32CubeMX to generate a project for a STM32F042. I just found a bug in the automatic code generation concerning the firmware package for STM32F0 family v1.7.0.

It concerns the initialization of the IRDA driver.

 

CubeMX generates the following code :

/* USART1 init function */
static void MX_USART1_IRDA_Init(void)
{

hirda1.Instance = USART1;
hirda1.Init.BaudRate = 115200;
hirda1.Init.WordLength = IRDA_WORDLENGTH_7B;
hirda1.Init.Parity = IRDA_PARITY_NONE;
hirda1.Init.Prescaler = 10;
hirda1.Init.PowerMode = IRDA_POWERMODE_NORMAL;
if (HAL_IRDA_Init(&hirda1) != HAL_OK)
{
         Error_Handler();
}

}

 

It forgets the mode initialization :

hirda1.Init.Mode = IRDA_MODE_TX_RX;

 

Could you please confirm this bug ?

 

Thanks a lot.

Outcomes