Skip to main content
ARai
Associate II
Oct 6, 2019 6:56 PM UTC
Question

STM32L4 toggle pin issue.

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
Oct 6, 2019 8:40 PM UTC

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

Tesla DeLorean
Guru
Oct 6, 2019 10:27 PM UTC

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
Oct 6, 2019 10:43 PM UTC

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
Oct 6, 2019 11:17 PM UTC

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..