2018-04-25 01:17 AM
We encountered a problem with CubeMx and I2C Low Layer libraray on an STM32F413RH.
The code fall in an assertion.
The initialization from CubeMx :
I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C;
I2C_InitStruct.ClockSpeed = 100000; I2C_InitStruct.DutyCycle = LL_I2C_DUTYCYCLE_2; I2C_InitStruct.OwnAddress1 = 0; I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; LL_I2C_Init(I2C1, &I2C_InitStruct);The assertion in stm32f4xx_ll_i2c.c, line 173:
uint32_t LL_I2C_Init(I2C_TypeDef *I2Cx, LL_I2C_InitTypeDef *I2C_InitStruct)
{ LL_RCC_ClocksTypeDef rcc_clocks; /* Check the I2C Instance I2Cx */ assert_param(IS_I2C_ALL_INSTANCE(I2Cx)); /* Check the I2C parameters from I2C_InitStruct */ assert_param(IS_LL_I2C_PERIPHERAL_MODE(I2C_InitStruct->PeripheralMode)); assert_param(IS_LL_I2C_CLOCK_SPEED(I2C_InitStruct->ClockSpeed)); assert_param(IS_LL_I2C_DUTY_CYCLE(I2C_InitStruct->DutyCycle));&sharpif defined(I2C_FLTR_ANOFF)&&defined(I2C_FLTR_DNF) assert_param(IS_LL_I2C_ANALOG_FILTER(I2C_InitStruct->AnalogFilter)); // failed here assert_param(IS_LL_I2C_DIGITAL_FILTER(I2C_InitStruct->DigitalFilter));&sharpendifCubeMx version 4.25.0
Package STM32Cube FW_F4 V1.21.0
#cube #low-layer #lowlayer2018-04-25 03:30 AM
Hi Nicola,
Could you please share your ioc file. This will help us for the debug.
Thanks!
Khouloud.
2018-04-25 06:53 AM
Done.
The problem is that the AnalogFilter and DigitalFilter in the struct are not initialized, so it can contain anything.
A call to LL_I2C_StructInit should be done I think.
2018-05-02 06:59 AM
nicolas.bonnec
Hi,
This issue will be fixed in CubeMX next release .
regards,
Houda
2018-07-04 02:23 AM
Issue not fixed with CubeMX 4.26.0 and FW_F4 V1.21.0.