I am trying to build some code for stm32 using stm32cube framework and VS code. Although expirienced .NET developer, I have very limited knowledge of C/C++. I have managed to use several libraries but just this one is creating a problem for me. This is what I have in platform.ini:
platform = ststm32
board = genericSTM32F103RB
framework = stm32cube
lib_ldf_mode = deep+
And this is what’s creating problem (this is just relevant portion):
| |-- stm32f1xx_hal_conf.h
| |-- [WDTM]
| | |-- wdt_stm32f1.c
| |-- main.c
wdt_stm32f1.c includes stm32f1xx_hal.h
stm32f1xx_hal.h includes stm32f1xx_hal_conf.h (which I assume will be picked up from my include folder)
stm32f1xx_hal_conf.h defines HAL_IWDG_MODULE_ENABLED which means stm32f1xx_hal_iwdg.h will be included
stm32f1xx_hal_iwdg.c has this function HAL_IWDG_Start which is defined within #ifdef HAL_IWDG_MODULE_ENABLED. HAL_IWDG_Start is called from wdt_stm32f1.c but during build I get error “undefined reference to HAL_IWDG_Start”. It’s like stm32f1xx_hal_conf.h from my include folder that defines HAL_IWDG_MODULE_ENABLED is ignored.
No matter what I do I just can’t get this to work. I have exhausted all the options (considering my limited knowledge) and have nothing left to try. If anyone could point me to right direction I would appreciate very much!