2017-04-07 01:39 AM
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.
#irda #stm32f0 #stm32cubemx2017-04-07 01:42 AM
Hi,
Could you please share your .ioc and precise which CubeMX version are your using ?
I will check this case and come back to you soon.
Thanks
Imen
2017-04-07 03:51 AM
Hi,
I'm using the 4.20 version of CubeMX and the firmware package for STM32F0 v1.7.0.
You will find the .ioc attached to this answer.
Thank you.
________________ Attachments : Test Fo irda.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyfF&d=%2Fa%2F0X0000000bBc%2Fb1lYLC3qYP7Gn.vq75kzYn9vYStxxfYeC6KuKrG75FE&asPdf=false2017-04-07 10:43 AM
Hi
Garivet.Mathieu
,I have reported thisissue internally.
Thank you for your contribution.
Thanks
Imen
2017-05-04 03:03 AM
Hi
Garivet.Mathieu
,
This issue will be delivered in the next CubeMX release (4.21) that will be available soon!
Thanks for your post.
BR. Eric