Skip to main content
Visitor II
January 5, 2020
Question

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

  • January 5, 2020
  • 1 reply
  • 546 views

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

    This topic has been closed for replies.

    1 reply

    Visitor II
    January 5, 2020

    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.