cancel
Showing results for 
Search instead for 
Did you mean: 

LL_GPIO_Init on STM32F103

Martin Mare¨
Associate
Posted on June 20, 2018 at 23:24

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 << 😎 | 0x04000020U).

#stm32f103
1 REPLY 1
Posted on June 21, 2018 at 21:28

https://community.st.com/0D70X000006SzELSA0