diff --git a/CI/update/templates/system_stm32yyxx.c b/CI/update/templates/system_stm32yyxx.c
index 7fc841f8ac..10fcaf9a2a 100644
--- a/CI/update/templates/system_stm32yyxx.c
+++ b/CI/update/templates/system_stm32yyxx.c
@@ -1,5 +1,3 @@
-#define USE_HAL_DRIVER
-
 {% for system in system_list %}
   {% if loop.first %}
 #ifdef {{system.serie}}
diff --git a/cmake/set_base_arduino_config.cmake b/cmake/set_base_arduino_config.cmake
index cec1d09c39..ece885aeaf 100644
--- a/cmake/set_base_arduino_config.cmake
+++ b/cmake/set_base_arduino_config.cmake
@@ -22,6 +22,7 @@ target_link_libraries(base_config INTERFACE
 	gcc
 )
 target_compile_definitions(base_config INTERFACE
+	USE_HAL_DRIVER
 	USE_FULL_LL_DRIVER
 	ARDUINO_ARCH_STM32
 )
diff --git a/cores/arduino/stm32/stm32_def.h b/cores/arduino/stm32/stm32_def.h
index 8b193a8c87..00113faa89 100644
--- a/cores/arduino/stm32/stm32_def.h
+++ b/cores/arduino/stm32/stm32_def.h
@@ -20,8 +20,6 @@
                                         |(STM32_CORE_VERSION_PATCH << 8U )\
                                         |(STM32_CORE_VERSION_EXTRA))
 
-#define USE_HAL_DRIVER
-
 #if defined(STM32C0xx)
   #include "stm32c0xx.h"
 #elif defined(STM32F0xx)
diff --git a/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c b/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
index 1a04669fb4..4019fbe230 100644
--- a/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
+++ b/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
@@ -1,5 +1,3 @@
-#define USE_HAL_DRIVER
-
 #ifdef STM32C0xx
   #include "system_stm32c0xx.c"
 #elif STM32F0xx
diff --git a/platform.txt b/platform.txt
index d7ed5acb0d..4df3db3de5 100644
--- a/platform.txt
+++ b/platform.txt
@@ -58,7 +58,7 @@ compiler.objcopy.cmd=arm-none-eabi-objcopy
 compiler.elf2hex.cmd=arm-none-eabi-objcopy
 compiler.libraries.ldflags=
 
-compiler.extra_flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -DVECT_TAB_OFFSET={build.flash_offset} -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"
+compiler.extra_flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -DVECT_TAB_OFFSET={build.flash_offset} -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"
 
 compiler.S.flags={compiler.extra_flags} -c -x assembler-with-cpp {compiler.stm.extra_include}
 
diff --git a/tools/platformio/platformio-build.py b/tools/platformio/platformio-build.py
index 19a16715c8..89336ca215 100644
--- a/tools/platformio/platformio-build.py
+++ b/tools/platformio/platformio-build.py
@@ -243,6 +243,7 @@ def get_arduino_board_id(board_config, mcu):
         "ARDUINO_%s" % board_id,
         ("BOARD_NAME", '\\"%s\\"' % board_id),
         "HAL_UART_MODULE_ENABLED",
+        "USE_HAL_DRIVER",
         "USE_FULL_LL_DRIVER",
         (
             "VARIANT_H",