AnsweredAssumed Answered

STM32F1 - LL_GPIO_Init() problem

Question asked by Bogdan Golab on Mar 17, 2018
Latest reply on Mar 19, 2018 by Bogdan Golab

Hi,

 

A piece of code from STM32CubeMX v4.25.0 and latest F1 drivers generated  for STM32VLDiscovery (the button is pulled-down by external resistor):

 

static void MX_GPIO_Init(void)
{

  LL_GPIO_InitTypeDef GPIO_InitStruct;

 

  /* GPIO Ports Clock Enable */
  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD);
  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);

 

  GPIO_InitStruct.Pin = LL_GPIO_PIN_0;
  GPIO_InitStruct.Mode = LL_GPIO_MODE_FLOATING;
  LL_GPIO_Init(GPIOA, &GPIO_InitStruct);

}

 

and the results from the Keil debugger:

 

So commented the line below to prove that there is only one line of code used for GPIOA initialization:

// LL_GPIO_Init(GPIOA, &GPIO_InitStruct);

 

and got as expected (the default settings for GPIOA)

 

It seems that the LL_GPIO_Init gives messy config on more than one pin. Am I wrong?

 

Have no luck with F1 line and LL drivers - this issue seems to be continuation of my previous finding:

https://community.st.com/message/190160-re-stm32cubemx-v4240-stm32f1-gpio-ll-led-blinking-fails?commentID=190160#comment… 

 

--------------------------------

So switching back to register programming when working with boards with low SRAM size. It takes less time than investigating issues in LL drivers.

 

I wonder if you use LL drivers for F1 line. I know that more people prefer SPL drivers for this line.

Outcomes