Associate III
April 25, 2018
Question
[Issue] CubeMx Assert failed with I2C Low Layer
- April 25, 2018
- 3 replies
- 891 views
Posted on April 25, 2018 at 10:17
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 #lowlayer