2018-04-13 12:24 AM
STM32CubeMX v4.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 memberPullis notinitialized that leads to the program may be blocked atassert_param().
Hope to improve.Thanks !
#ll-gpio2018-04-16 02:59 AM
Hello,
Your reported issue is raised internally to CubeMx team for check.
Best Regards,
Imen
2018-04-16 04:36 AM
I've seen the same problem for years.
One work-around is to modify the code to initialize the struct to zero e.g.,
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
When re-generating code, merge the new file (probably main.c in this case) with a backup of the old file using a code-merging utility and keep your changes.