25 #include "cpu_conf_common.h"
27 #if defined(CPU_LINE_STM32F030x4)
28 #include "vendor/stm32f030x4.h"
29 #elif defined(CPU_LINE_STM32MP157Cxx)
30 #include "vendor/stm32mp157cxx_cm4.h"
32 #include "stm32f0xx.h"
33 #include "irqs/f0/irqs.h"
35 #include "stm32f1xx.h"
36 #include "irqs/f1/irqs.h"
38 #include "stm32f2xx.h"
39 #include "irqs/f2/irqs.h"
41 #include "stm32f3xx.h"
42 #include "irqs/f3/irqs.h"
44 #include "stm32f4xx.h"
45 #include "irqs/f4/irqs.h"
47 #include "stm32f7xx.h"
48 #include "irqs/f7/irqs.h"
50 #include "stm32g0xx.h"
51 #include "irqs/g0/irqs.h"
53 #include "stm32g4xx.h"
54 #include "irqs/g4/irqs.h"
56 #include "stm32l0xx.h"
57 #include "irqs/l0/irqs.h"
59 #include "stm32l1xx.h"
60 #include "irqs/l1/irqs.h"
62 #include "stm32l4xx.h"
63 #include "irqs/l4/irqs.h"
65 #include "stm32l5xx.h"
66 #include "irqs/l5/irqs.h"
68 #include "stm32wbxx.h"
69 #include "irqs/wb/irqs.h"
71 #error Not supported CPU family
82 #define CPU_DEFAULT_IRQ_PRIO (1U)
84 #if !defined(CPU_FAM_STM32MP1)
85 #define CPU_FLASH_BASE FLASH_BASE
89 #if defined(CPU_LINE_STM32F030x4)
90 #define CPU_IRQ_NUMOF (28U)
91 #elif defined(CPU_MODEL_STM32MP157CAC)
92 #define CPU_IRQ_NUMOF (150U)
100 #if defined(CPU_FAM_STM32WB)
101 #define FLASHPAGE_SIZE (4096U)
102 #elif defined(CPU_LINE_STM32F091xC) || defined(CPU_LINE_STM32F072xB) \
103 || defined(CPU_LINE_STM32F030xC) || defined(CPU_LINE_STM32F103xE) \
104 || defined(CPU_FAM_STM32F3) || defined(CPU_FAM_STM32L4) \
105 || defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32G0) \
106 || defined(CPU_FAM_STM32L5)
107 #define FLASHPAGE_SIZE (2048U)
108 #elif defined(CPU_LINE_STM32F051x8) || defined(CPU_LINE_STM32F042x6) \
109 || defined(CPU_LINE_STM32F070xB) || defined(CPU_LINE_STM32F030x8) \
110 || defined(CPU_LINE_STM32F030x4) || defined(CPU_LINE_STM32F103xB) \
111 || defined(CPU_LINE_STM32F031x6)
112 #define FLASHPAGE_SIZE (1024U)
113 #elif defined(CPU_FAM_STM32L1)
114 #define FLASHPAGE_SIZE (256U)
115 #elif defined(CPU_FAM_STM32L0)
116 #define FLASHPAGE_SIZE (128U)
119 #define FLASHPAGE_NUMOF (STM32_FLASHSIZE / FLASHPAGE_SIZE)
124 #if defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32WB) || \
125 defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32G0) || \
126 defined(CPU_FAM_STM32L5)
127 #define FLASHPAGE_WRITE_BLOCK_SIZE (8U)
128 typedef uint64_t stm32_flashpage_block_t;
129 #elif defined(CPU_FAM_STM32L0) || defined(CPU_FAM_STM32L1)
130 #define FLASHPAGE_WRITE_BLOCK_SIZE (4U)
131 typedef uint32_t stm32_flashpage_block_t;
133 #define FLASHPAGE_WRITE_BLOCK_SIZE (2U)
134 typedef uint16_t stm32_flashpage_block_t;
137 #if defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32WB) || \
138 defined(CPU_FAM_STM32G4) || defined(CPU_FAM_STM32G0) || \
139 defined(CPU_FAM_STM32L5)
140 #define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (8U)
143 #define FLASHPAGE_WRITE_BLOCK_ALIGNMENT (4U)
152 #define CPU_HAS_BITBAND 1