diff --git a/src/platform/APM32/mk/APM32F4.mk b/src/platform/APM32/mk/APM32F4.mk
index 6172080a02..42896d0957 100644
--- a/src/platform/APM32/mk/APM32F4.mk
+++ b/src/platform/APM32/mk/APM32F4.mk
@@ -113,6 +113,7 @@ VPATH := $(VPATH):$(LIB_MAIN_DIR)/APM32F4/Libraries/Device/Geehy/APM32F4xx
INCLUDE_DIRS += \
$(TARGET_PLATFORM_DIR)/startup \
$(TARGET_PLATFORM_DIR) \
+ $(PLATFORM_DIR)/common/stm32 \
$(STDPERIPH_DIR)/Include \
$(LIB_MAIN_DIR)/$(USBCORE_DIR)/Inc \
$(LIB_MAIN_DIR)/$(USBCDC_DIR)/Inc \
diff --git a/src/platform/AT32/mk/AT32F4.mk b/src/platform/AT32/mk/AT32F4.mk
index 610bb463be..60711a67c0 100644
--- a/src/platform/AT32/mk/AT32F4.mk
+++ b/src/platform/AT32/mk/AT32F4.mk
@@ -63,6 +63,7 @@ DEVICE_STDPERIPH_SRC = $(STDPERIPH_SRC)
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(TARGET_PLATFORM_DIR)/startup \
$(TARGET_PLATFORM_DIR) \
+ $(PLATFORM_DIR)/common/stm32 \
$(STDPERIPH_DIR)/inc \
$(CMSIS_DIR)/cm4/core_support \
$(CMSIS_DIR)/cm4 \
diff --git a/src/platform/SIMULATOR/io_def_generated.h b/src/platform/SIMULATOR/io_def_generated.h
new file mode 100644
index 0000000000..e127e5721f
--- /dev/null
+++ b/src/platform/SIMULATOR/io_def_generated.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of Betaflight.
+ *
+ * Betaflight is free software. You can redistribute this software
+ * and/or modify this software under the terms of the GNU General
+ * Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * Betaflight is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this software.
+ *
+ * If not, see .
+ */
+
+#pragma once
+
+#define DEFIO_PORT_USED_COUNT 0
+#define DEFIO_IO_USED_COUNT 0
diff --git a/src/platform/STM32/mk/STM32F4.mk b/src/platform/STM32/mk/STM32F4.mk
index 712940f561..a4b5aecfa3 100644
--- a/src/platform/STM32/mk/STM32F4.mk
+++ b/src/platform/STM32/mk/STM32F4.mk
@@ -252,3 +252,5 @@ MSC_SRC = \
DSP_LIB := $(LIB_MAIN_DIR)/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM4
+
+include $(TARGET_PLATFORM_DIR)/mk/STM32_COMMON.mk
diff --git a/src/platform/STM32/mk/STM32F7.mk b/src/platform/STM32/mk/STM32F7.mk
index 2cf48120cc..c8f1852ff4 100644
--- a/src/platform/STM32/mk/STM32F7.mk
+++ b/src/platform/STM32/mk/STM32F7.mk
@@ -211,3 +211,5 @@ SIZE_OPTIMISED_SRC += \
DSP_LIB := $(LIB_MAIN_DIR)/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM7
+
+include $(TARGET_PLATFORM_DIR)/mk/STM32_COMMON.mk
diff --git a/src/platform/STM32/mk/STM32G4.mk b/src/platform/STM32/mk/STM32G4.mk
index 2c10613da3..bd904c2dd9 100644
--- a/src/platform/STM32/mk/STM32G4.mk
+++ b/src/platform/STM32/mk/STM32G4.mk
@@ -184,3 +184,5 @@ SIZE_OPTIMISED_SRC += \
DSP_LIB := $(LIB_MAIN_DIR)/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM4
+
+include $(TARGET_PLATFORM_DIR)/mk/STM32_COMMON.mk
diff --git a/src/platform/STM32/mk/STM32H5.mk b/src/platform/STM32/mk/STM32H5.mk
index 21c0bd5a95..ee80cde798 100644
--- a/src/platform/STM32/mk/STM32H5.mk
+++ b/src/platform/STM32/mk/STM32H5.mk
@@ -218,3 +218,5 @@ SIZE_OPTIMISED_SRC += \
DSP_LIB := $(LIB_MAIN_DIR)/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM7
+
+include $(TARGET_PLATFORM_DIR)/mk/STM32_COMMON.mk
diff --git a/src/platform/STM32/mk/STM32H7.mk b/src/platform/STM32/mk/STM32H7.mk
index 2129a1e11a..29d2a67930 100644
--- a/src/platform/STM32/mk/STM32H7.mk
+++ b/src/platform/STM32/mk/STM32H7.mk
@@ -333,3 +333,5 @@ SIZE_OPTIMISED_SRC += \
DSP_LIB := $(LIB_MAIN_DIR)/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM7
+
+include $(TARGET_PLATFORM_DIR)/mk/STM32_COMMON.mk
diff --git a/src/platform/STM32/mk/STM32_COMMON.mk b/src/platform/STM32/mk/STM32_COMMON.mk
new file mode 100644
index 0000000000..f109837f3a
--- /dev/null
+++ b/src/platform/STM32/mk/STM32_COMMON.mk
@@ -0,0 +1,2 @@
+
+INCLUDE_DIRS += $(PLATFORM_DIR)/common/stm32
diff --git a/src/main/drivers/io_def_generated.h b/src/platform/common/stm32/io_def_generated.h
similarity index 100%
rename from src/main/drivers/io_def_generated.h
rename to src/platform/common/stm32/io_def_generated.h
diff --git a/src/test/unit/io_def_generated.h b/src/test/unit/io_def_generated.h
new file mode 100644
index 0000000000..30834f14a2
--- /dev/null
+++ b/src/test/unit/io_def_generated.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of Betaflight.
+ *
+ * Betaflight is free software. You can redistribute this software
+ * and/or modify this software under the terms of the GNU General
+ * Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * Betaflight is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this software.
+ *
+ * If not, see .
+ */
+
+#pragma once
+
+#define DEFIO_PORT_USED_COUNT 0
+#define DEFIO_IO_USED_COUNT 0
+#define IO_TAG_NONE 0
diff --git a/src/test/unit/rx_spi_expresslrs_unittest.cc b/src/test/unit/rx_spi_expresslrs_unittest.cc
index d1cf06679e..e0f25393ed 100644
--- a/src/test/unit/rx_spi_expresslrs_unittest.cc
+++ b/src/test/unit/rx_spi_expresslrs_unittest.cc
@@ -54,7 +54,7 @@ extern "C" {
static rxRuntimeState_t config = rxRuntimeState_t();
static rxSpiExtiConfig_t extiConfig;
static const rxSpiConfig_t injectedConfig = {
- .extiIoTag = IO_TAG(PA0),
+ .extiIoTag = IO_TAG_NONE,
};
}
diff --git a/src/test/unit/rx_spi_spektrum_unittest.cc b/src/test/unit/rx_spi_spektrum_unittest.cc
index 03d6251273..acb1a59e1b 100644
--- a/src/test/unit/rx_spi_spektrum_unittest.cc
+++ b/src/test/unit/rx_spi_spektrum_unittest.cc
@@ -135,7 +135,7 @@ extern "C" {
}
static const rxSpiConfig_t injectedConfig = {
- .extiIoTag = IO_TAG(PA0),
+ .extiIoTag = IO_TAG_NONE,
};
}