Skip to main content
ARai
Associate II
October 6, 2019
Question

STM32L4 toggle pin issue.

  • October 6, 2019
  • 4 replies
  • 1263 views

I am using STM32 for the first time. I have Atollic and STM32CubeMX installed. The controller I am using is STM32L475VG. I am trying to toggle the LED pin and am using HAL_GPIO_TogglePin to do it. But the compiler is throwing up an error 'undefined reference to `HAL_GPIO_TogglePin' '.

I have HAL_Init() and HAL_Delay() functions working fine.

Is there any file that needs to be included?

This topic has been closed for replies.

4 replies

S.Ma
Principal
October 6, 2019

I would suggest to start from a working example, say a Nucleo board GPIO example.

Tesla DeLorean
Guru
October 6, 2019

Need source for GPIO library code in project, and enable GPIO module in stm32l4xx_hal_conf.h

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ARai
ARaiAuthor
Associate II
October 6, 2019

Thank you for the reply. The GPIO module has been enabled in the stm32l4xx_hal_conf.h file. Which file should i include for GPIO library code ?

Tesla DeLorean
Guru
October 6, 2019

stm32l4xx_hal_gpio.c ?

Why not "grep" the library files for the function you're missing?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..