2018-06-20 02:24 PM
I am trying to initialize GPIO ports on STM32F103C8 using the LL library. When I set up pin PC13 by a sequence of individual calls (LL_GPIO_SetPinMode, LL_GPIO_SetPinOutputType), it is initialized correctly. However, when I ask LL_GPIO_Init to do the same, the pin is configured incorrectly (input instead of output). The function call matches both documentation and the code generated by STM32CubeMX.
I suspect that the implementation of LL_GPIO_Init in the STM32F1 firmware package is wrong. It expects GPIO_InitStruct->Pin to be a simple bit mask (as it was in the STM32F0 package), but stm32f1xx_ll_gpio.h for F1 defines it differently ((GPIO_BSRR_BS13 << 8) | 0x04000020U).
#stm32f1032018-06-21 12:28 PM