I want to use uart without uncommenting stm32****_HAL_conf.h:
#define HAL_UART_MODULE_ENABLED
I've tried to add it on main.h and/or including manually:
#include "stm32h7xx_hal_uart.h"
but these adding causes to cubeIDE to tell: Undefined reference to.
I wonder why uncommenting that define solve all errors (Note: thos only causes uart header to being included in HAL_conf.h
) but customly adding them to main.h
will giving us error. Since by every cubeMX refresh the HAL_conf.h resets to it's default. Also I've seen this usefull question undefined reference when including a header file .
It seems the defenition in the code changes linker behaviour, doesn't it? But how?
What I've done?
1.Added required file to the project uart header and source. 2.including the header file in program 3.defining the flag to let #ifdef's to doing their job But no work is done.