From 2193e0033b437c5e1be5556a067d5d28c20cfe45 Mon Sep 17 00:00:00 2001
From: Alberto Nidasio <alberto.nidasio@skywarder.eu>
Date: Fri, 9 Dec 2022 17:18:39 +0100
Subject: [PATCH] Removed _ARCH_CORTEXM0 macro

---
 miosix/arch/common/core/interrupts.h                      | 8 --------
 miosix/arch/common/core/interrupts_cortexMx.cpp           | 8 ++++----
 .../stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp    | 0
 .../stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp  | 0
 .../interfaces-impl/bsp_impl.h                            | 0
 .../interfaces-impl/hwmapping.h                           | 0
 .../stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld     | 0
 .../stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg     | 0
 .../core/stage_1_boot.cpp                                 | 0
 .../interfaces-impl/bsp.cpp                               | 0
 .../interfaces-impl/bsp_impl.h                            | 0
 .../interfaces-impl/hwmapping.h                           | 0
 .../stm32_128k+20k_rom.ld                                 | 0
 .../stm32f205rc_skyward_ciuti/interfaces-impl/bsp.cpp     | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../stm32f429zi_hre_test_stand/interfaces-impl/bsp.cpp    | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../stm32f429zi_skyward_parafoil/interfaces-impl/bsp.cpp  | 2 +-
 .../interfaces-impl/bsp.cpp                               | 2 +-
 .../stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp | 2 +-
 .../stm32f103c8_skyward_alderaan/board_settings.h         | 0
 .../stm32f103cb_skyward_strain_board/board_settings.h     | 0
 miosix/config/options.cmake                               | 4 ++--
 29 files changed, 19 insertions(+), 27 deletions(-)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/interfaces-impl/bsp_impl.h (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/interfaces-impl/hwmapping.h (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/core/stage_1_boot.cpp (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/interfaces-impl/bsp.cpp (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/interfaces-impl/bsp_impl.h (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/interfaces-impl/hwmapping.h (100%)
 rename miosix/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/stm32_128k+20k_rom.ld (100%)
 rename miosix/config/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103c8_skyward_alderaan/board_settings.h (100%)
 rename miosix/config/arch/{cortexM3_stm32 => cortexM3_stm32f1}/stm32f103cb_skyward_strain_board/board_settings.h (100%)

diff --git a/miosix/arch/common/core/interrupts.h b/miosix/arch/common/core/interrupts.h
index cb8afb23..0402be32 100644
--- a/miosix/arch/common/core/interrupts.h
+++ b/miosix/arch/common/core/interrupts.h
@@ -13,11 +13,3 @@
 #else
 #error "Unknown arch"
 #endif
-
-// Cortex M0 and M0+ does not have some SCB registers, in order to avoid
-// compilation issues a flag is defined to disable code that accesses to 
-// registers not present in these families
-
-#if defined(_ARCH_CORTEXM0_STM32F0)
-#define _ARCH_CORTEXM0
-#endif
diff --git a/miosix/arch/common/core/interrupts_cortexMx.cpp b/miosix/arch/common/core/interrupts_cortexMx.cpp
index dd05ebde..fbfcc8f9 100644
--- a/miosix/arch/common/core/interrupts_cortexMx.cpp
+++ b/miosix/arch/common/core/interrupts_cortexMx.cpp
@@ -99,20 +99,20 @@ void __attribute__((noinline)) HardFault_impl()
     #ifdef WITH_ERRLOG
     IRQerrorLog("\r\n***Unexpected HardFault @ ");
     printUnsignedInt(getProgramCounter());
-    #ifndef _ARCH_CORTEXM0
+    #if !defined(_ARCH_CORTEXM0_STM32F0) && !defined(_ARCH_CORTEXM0_STM32G0) && !defined(_ARCH_CORTEXM0_STM32L0)
     unsigned int hfsr=SCB->HFSR;
     if(hfsr & 0x40000000) //SCB_HFSR_FORCED
         IRQerrorLog("Fault escalation occurred\r\n");
     if(hfsr & 0x00000002) //SCB_HFSR_VECTTBL
         IRQerrorLog("A BusFault occurred during a vector table read\r\n");
-    #endif //_ARCH_CORTEXM0
+    #endif // !_ARCH_CORTEXM0_STM32F0 && !_ARCH_CORTEXM0_STM32G0 && !_ARCH_CORTEXM0_STM32L0
     #endif //WITH_ERRLOG
     miosix_private::IRQsystemReboot();
 }
 
 // Cortex M0/M0+ architecture does not have the interrupts handled by code
 // below this point
-#ifndef _ARCH_CORTEXM0
+#if !defined(_ARCH_CORTEXM0_STM32F0) && !defined(_ARCH_CORTEXM0_STM32G0) && !defined(_ARCH_CORTEXM0_STM32L0)
 
 void __attribute__((naked)) MemManage_Handler()
 {
@@ -262,7 +262,7 @@ void DebugMon_Handler()
     miosix_private::IRQsystemReboot();
 }
 
-#endif //_ARCH_CORTEXM0
+#endif // !_ARCH_CORTEXM0_STM32F0 && !_ARCH_CORTEXM0_STM32G0 && !_ARCH_CORTEXM0_STM32L0
 
 void PendSV_Handler()
 {
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/core/stage_1_boot.cpp
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/bsp.cpp
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/bsp_impl.h b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/bsp_impl.h
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/bsp_impl.h
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/bsp_impl.h
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/hwmapping.h b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/hwmapping.h
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/interfaces-impl/hwmapping.h
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/interfaces-impl/hwmapping.h
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/stm32_64k+20k_rom.ld
diff --git a/miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg b/miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg
rename to miosix/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/stm32vldiscovery.cfg
diff --git a/miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/core/stage_1_boot.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/core/stage_1_boot.cpp
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/core/stage_1_boot.cpp
rename to miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/core/stage_1_boot.cpp
diff --git a/miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/bsp.cpp b/miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/bsp.cpp
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/bsp.cpp
rename to miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/bsp.cpp
diff --git a/miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/bsp_impl.h b/miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/bsp_impl.h
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/bsp_impl.h
rename to miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/bsp_impl.h
diff --git a/miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/hwmapping.h b/miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/hwmapping.h
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/interfaces-impl/hwmapping.h
rename to miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/interfaces-impl/hwmapping.h
diff --git a/miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/stm32_128k+20k_rom.ld b/miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/stm32_128k+20k_rom.ld
similarity index 100%
rename from miosix/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/stm32_128k+20k_rom.ld
rename to miosix/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/stm32_128k+20k_rom.ld
diff --git a/miosix/arch/cortexM3_stm32f2/stm32f205rc_skyward_ciuti/interfaces-impl/bsp.cpp b/miosix/arch/cortexM3_stm32f2/stm32f205rc_skyward_ciuti/interfaces-impl/bsp.cpp
index fccaa166..2298d313 100644
--- a/miosix/arch/cortexM3_stm32f2/stm32f205rc_skyward_ciuti/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM3_stm32f2/stm32f205rc_skyward_ciuti/interfaces-impl/bsp.cpp
@@ -41,7 +41,7 @@
 #include "board_settings.h"
 #include "config/miosix_settings.h"
 #include "drivers/dcc.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f407vg_skyward_tortellino/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f407vg_skyward_tortellino/interfaces-impl/bsp.cpp
index f72d0200..f8b86a7c 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f407vg_skyward_tortellino/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f407vg_skyward_tortellino/interfaces-impl/bsp.cpp
@@ -44,7 +44,7 @@
 #include "filesystem/file_access.h"
 #include "filesystem/console/console_device.h"
 #include "drivers/serial.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "board_settings.h"
 #include "hwmapping.h"
 
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_hre_test_stand/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_hre_test_stand/interfaces-impl/bsp.cpp
index 3be8347f..bb9b8884 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_hre_test_stand/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_hre_test_stand/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack/interfaces-impl/bsp.cpp
index 783564a3..55893a52 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack/interfaces-impl/bsp.cpp
@@ -44,7 +44,7 @@
 #include "filesystem/file_access.h"
 #include "filesystem/console/console_device.h"
 #include "drivers/serial.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "board_settings.h"
 #include "hwmapping.h"
 
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
index e642dcc2..27898778 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_v3/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x/interfaces-impl/bsp.cpp
index 9e6e449f..4542a90f 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x_maker_faire/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x_maker_faire/interfaces-impl/bsp.cpp
index 108263a6..6e9248a3 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x_maker_faire/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_death_stack_x_maker_faire/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation/interfaces-impl/bsp.cpp
index f8672b49..7d90be57 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation/interfaces-impl/bsp.cpp
@@ -44,7 +44,7 @@
 #include "filesystem/file_access.h"
 #include "filesystem/console/console_device.h"
 #include "drivers/serial.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "board_settings.h"
 #include "hwmapping.h"
 // #include "kernel/IRQDisplayPrint.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_parafoil/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_parafoil/interfaces-impl/bsp.cpp
index fe6906f3..83434b01 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_parafoil/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_parafoil/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2/interfaces-impl/bsp.cpp
index 0ab256db..1bee7351 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_groundstation_v2/interfaces-impl/bsp.cpp
@@ -44,7 +44,7 @@
 #include "filesystem/file_access.h"
 #include "filesystem/console/console_device.h"
 #include "drivers/serial.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "board_settings.h"
 #include "hwmapping.h"
 // #include "kernel/IRQDisplayPrint.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_parafoil/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_parafoil/interfaces-impl/bsp.cpp
index 407fd39d..9c56ea14 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_parafoil/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_parafoil/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_pyxis_auxiliary/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_pyxis_auxiliary/interfaces-impl/bsp.cpp
index 061176ed..a8581e1e 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_pyxis_auxiliary/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_pyxis_auxiliary/interfaces-impl/bsp.cpp
@@ -39,7 +39,7 @@
 
 #include "board_settings.h"
 #include "config/miosix_settings.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "drivers/serial.h"
 #include "filesystem/console/console_device.h"
 #include "filesystem/file_access.h"
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
index 6a207a0b..7ed2ca5f 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
@@ -44,7 +44,7 @@
 #include "filesystem/file_access.h"
 #include "filesystem/console/console_device.h"
 #include "drivers/serial.h"
-#include "drivers/sd_stm32f2_f4.h"
+#include "drivers/sd_stm32f2_f4_f7.h"
 #include "board_settings.h"
 // #include "kernel/IRQDisplayPrint.h"
 
diff --git a/miosix/config/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/board_settings.h b/miosix/config/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/board_settings.h
similarity index 100%
rename from miosix/config/arch/cortexM3_stm32/stm32f103c8_skyward_alderaan/board_settings.h
rename to miosix/config/arch/cortexM3_stm32f1/stm32f103c8_skyward_alderaan/board_settings.h
diff --git a/miosix/config/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/board_settings.h b/miosix/config/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/board_settings.h
similarity index 100%
rename from miosix/config/arch/cortexM3_stm32/stm32f103cb_skyward_strain_board/board_settings.h
rename to miosix/config/arch/cortexM3_stm32f1/stm32f103cb_skyward_strain_board/board_settings.h
diff --git a/miosix/config/options.cmake b/miosix/config/options.cmake
index 53dcbdc5..5ac5f8db 100644
--- a/miosix/config/options.cmake
+++ b/miosix/config/options.cmake
@@ -3247,7 +3247,7 @@ elseif(${ARCH} STREQUAL cortexM7_stm32h7)
 ##
 elseif(${ARCH} STREQUAL cortexM0_stm32f0)
     ## Base directory with else header files for this board
-    set(ARCH_INC arch/cortexM0_stm32/common)
+    set(ARCH_INC arch/cortexM0_stm32f0/common)
 
     ##-------------------------------------------------------------------------
     ## BOARD: stm32f072rb_stm32f0discovery
@@ -3255,7 +3255,7 @@ elseif(${ARCH} STREQUAL cortexM0_stm32f0)
     if(${OPT_BOARD} STREQUAL stm32f072rb_stm32f0discovery)
 
         ## Base directory with header files for this board
-        set(BOARD_INC arch/cortexM0_stm32/stm32f072rb_stm32f0discovery)
+        set(BOARD_INC arch/cortexM0_stm32f0/stm32f072rb_stm32f0discovery)
 
         ## Select linker script and boot file
         ## Their path must be relative to the miosix directory.
-- 
GitLab