cancel
Showing results for 
Search instead for 
Did you mean: 

glitch-free initialization of GPIO-pins with HAL-LL possible?

PGsel.1
Associate

I do LL_GPIO_SetOutputPin() before LL_GPIO_Init() so the ODR-Register is preloaded and the pin goes directly from Hi-Z to Highlevel. However, in LL_GPIO_Init() there is a call to LL_GPIO_SetPinPull() wich sets the ODR to an unwanted value. This call should only be done for Input-pins (in my opinion). I am using the STM32CubeMX-generated code (STM32Cube FW_F1 V1.8.0). The problematic behavior is in stm32f1xx_ll_gpio.c#196

1 REPLY 1
berendi
Principal

As you have looked at the code, you can see that the answer is no.

CubeMX and the HAL and LL libraries cover only a small part of the capabilities of STM32 MCUs. You have hit a use case that the authors did not anticipate.

Looks like you are familiar with the GPIO registers and functionality, so nothing prevents you from replace HAL with actually functioning code.