AnsweredAssumed Answered

Variable not initialized in STM32 LL MX_GPIO_Init()

Question asked by Jalon Wong on Apr 13, 2018
Latest reply on Apr 16, 2018 by Jim Frederick

STM32CubeMX v4.25.0

STM32CubeF1 Firmware Package v1.6.1

 

The following is the code generated by STM32CubeMX.

void MX_GPIO_Init(void)
{
  LL_GPIO_InitTypeDef GPIO_InitStruct;
  // ...
  GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
  GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
  GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
  LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
  //...
}

ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct)
{
  //...
  assert_param(IS_LL_GPIO_PULL(GPIO_InitStruct->Pull));
  //...
}

The member Pull is not initialized that leads to the program may be blocked at assert_param().

Hope to improve.Thanks !

Outcomes