@@ -75,117 +75,174 @@ extern ${variable.value} ${variable.name};
7575 #define WOLFSSL_STM32WB
7676 #define WOLFSSL_STM32_PKA
7777 #undef NO_STM32_CRYPTO
78+ #ifndef HAL_CONSOLE_UART
7879 #define HAL_CONSOLE_UART huart1
80+ #endif
7981#elif defined(STM32WBA52xx)
8082 #define WOLFSSL_STM32WBA
8183 #define WOLFSSL_STM32_PKA
8284 #undef NO_STM32_HASH
8385 #undef NO_STM32_CRYPTO
8486 /* NUCLEO-WBA52CG USART1 (TX=PB12 / RX=PA8) */
87+ #ifndef HAL_CONSOLE_UART
8588 #define HAL_CONSOLE_UART huart1
89+ #endif
8690#elif defined(STM32WL55xx)
8791 #define WOLFSSL_STM32WL
8892 #define WOLFSSL_STM32_PKA
8993 #undef NO_STM32_CRYPTO
94+ #ifndef HAL_CONSOLE_UART
9095 #define HAL_CONSOLE_UART huart2
96+ #endif
9197#elif defined(STM32F407xx)
9298 #define WOLFSSL_STM32F4
99+ #ifndef HAL_CONSOLE_UART
93100 #define HAL_CONSOLE_UART huart2
94- #elif defined(STM32F437xx)
101+ #endif
102+ #elif defined(STM32F437xx) || defined(STM32F439xx)
95103 #define WOLFSSL_STM32F4
96104 #undef NO_STM32_HASH
97105 #undef NO_STM32_CRYPTO
98106 #define STM32_HAL_V2
99- #define HAL_CONSOLE_UART huart4
107+ #ifndef HAL_CONSOLE_UART
108+ #ifdef STM32F439xx
109+ #define HAL_CONSOLE_UART huart3
110+ #else
111+ #define HAL_CONSOLE_UART huart4
112+ #endif
113+ #endif
100114#elif defined(STM32F777xx)
101115 #define WOLFSSL_STM32F7
102116 #undef NO_STM32_HASH
103117 #undef NO_STM32_CRYPTO
104118 #define STM32_HAL_V2
119+ #ifndef HAL_CONSOLE_UART
105120 #define HAL_CONSOLE_UART huart2
121+ #endif
106122#elif defined(STM32F756xx)
107123 #define WOLFSSL_STM32F7
108124 #undef NO_STM32_HASH
109125 #undef NO_STM32_CRYPTO
110126 #define STM32_HAL_V2
127+ #ifndef HAL_CONSOLE_UART
111128 #define HAL_CONSOLE_UART huart3
129+ #endif
112130#elif defined(STM32H7S3xx)
113131 #define WOLFSSL_STM32H7S
114132 #undef NO_STM32_HASH
115133 #undef NO_STM32_CRYPTO
116134 #define WOLFSSL_STM32_PKA
135+ #ifndef HAL_CONSOLE_UART
117136 #define HAL_CONSOLE_UART huart3
137+ #endif
118138#elif defined(STM32H753xx)
119139 #define WOLFSSL_STM32H7
120140 #undef NO_STM32_HASH
121141 #undef NO_STM32_CRYPTO
142+ #ifndef HAL_CONSOLE_UART
122143 #define HAL_CONSOLE_UART huart3
144+ #endif
123145#elif defined(STM32H723xx) || defined(STM32H725xx) || defined(STM32H743xx)
124146 #define WOLFSSL_STM32H7
147+ #ifndef HAL_CONSOLE_UART
125148 #define HAL_CONSOLE_UART huart3
149+ #endif
126150#elif defined(STM32L4A6xx)
127151 #define WOLFSSL_STM32L4
128152 #undef NO_STM32_HASH
129153 #undef NO_STM32_CRYPTO
154+ #ifndef HAL_CONSOLE_UART
130155 #define HAL_CONSOLE_UART hlpuart1
156+ #endif
131157#elif defined(STM32L475xx)
132158 #define WOLFSSL_STM32L4
159+ #ifndef HAL_CONSOLE_UART
133160 #define HAL_CONSOLE_UART huart1
161+ #endif
134162#elif defined(STM32L562xx)
135163 #define WOLFSSL_STM32L5
136164 #define WOLFSSL_STM32_PKA
137165 #undef NO_STM32_HASH
138166 #undef NO_STM32_CRYPTO
167+ #ifndef HAL_CONSOLE_UART
139168 #define HAL_CONSOLE_UART huart1
169+ #endif
140170#elif defined(STM32L552xx)
141171 #define WOLFSSL_STM32L5
142172 #undef NO_STM32_HASH
173+ #ifndef HAL_CONSOLE_UART
143174 #define HAL_CONSOLE_UART hlpuart1
175+ #endif
144176#elif defined(STM32F207xx)
145177 #define WOLFSSL_STM32F2
178+ #ifndef HAL_CONSOLE_UART
146179 #define HAL_CONSOLE_UART huart3
180+ #endif
147181#elif defined(STM32F217xx)
148182 #define WOLFSSL_STM32F2
183+ #ifndef HAL_CONSOLE_UART
149184 #define HAL_CONSOLE_UART huart2
185+ #endif
150186#elif defined(STM32F107xC)
151187 #define WOLFSSL_STM32F1
152- #define HAL_CONSOLE_UART huart4
153188 #define NO_STM32_RNG
189+ #ifndef HAL_CONSOLE_UART
190+ #define HAL_CONSOLE_UART huart4
191+ #endif
154192#elif defined(STM32F401xE)
155193 #define WOLFSSL_STM32F4
156- #define HAL_CONSOLE_UART huart2
157194 #define NO_STM32_RNG
158195 #define WOLFSSL_GENSEED_FORTEST /* no HW RNG is available use test seed */
196+ #ifndef HAL_CONSOLE_UART
197+ #define HAL_CONSOLE_UART huart2
198+ #endif
159199#elif defined(STM32G071xx)
160200 #define WOLFSSL_STM32G0
161- #define HAL_CONSOLE_UART huart2
162201 #define NO_STM32_RNG
163202 #define WOLFSSL_GENSEED_FORTEST /* no HW RNG is available use test seed */
203+ #ifndef HAL_CONSOLE_UART
204+ #define HAL_CONSOLE_UART huart2
205+ #endif
164206#elif defined(STM32G491xx)
165207 #define WOLFSSL_STM32G4
166208 #define HAL_CONSOLE_UART hlpuart1
167209#elif defined(STM32U575xx) || defined(STM32U585xx) || defined(STM32U5A9xx)
168- #define HAL_CONSOLE_UART huart1
169210 #define WOLFSSL_STM32U5
170211 #define STM32_HAL_V2
171212 #if defined(STM32U585xx) || defined(STM32U5A9xx)
172213 #undef NO_STM32_HASH
173214 #undef NO_STM32_CRYPTO
174215 #define WOLFSSL_STM32_PKA
175216 #endif
217+ #ifndef HAL_CONSOLE_UART
218+ #define HAL_CONSOLE_UART huart1
219+ #endif
176220#elif defined(STM32H563xx)
177221 #define WOLFSSL_STM32H5
178- #define HAL_CONSOLE_UART huart3
179222 #define STM32_HAL_V2
180223 #undef NO_STM32_HASH
224+ #ifndef HAL_CONSOLE_UART
225+ #define HAL_CONSOLE_UART huart3
226+ #endif
181227#elif defined(STM32MP135Fxx)
182228 #define WOLFSSL_STM32MP13
183- #define HAL_CONSOLE_UART huart4
184229 #define STM32_HAL_V2
185230 #undef NO_STM32_HASH
186231 #undef NO_STM32_CRYPTO
187232 #define WOLFSSL_STM32_PKA
188233 #define WOLFSSL_STM32_PKA_V2
234+ #ifndef HAL_CONSOLE_UART
235+ #define HAL_CONSOLE_UART huart4
236+ #endif
237+ #elif defined(STM32N657xx)
238+ #define WOLFSSL_STM32N6
239+ #define STM32_HAL_V2
240+ #undef NO_STM32_HASH
241+ #undef NO_STM32_CRYPTO
242+ #define WOLFSSL_STM32_PKA
243+ #ifndef HAL_CONSOLE_UART
244+ #define HAL_CONSOLE_UART huart1
245+ #endif
189246#else
190247 #warning Please define a hardware platform!
191248 /* This means there is not a pre-defined platform for your board/CPU */
@@ -199,16 +256,19 @@ extern ${variable.value} ${variable.name};
199256 /* Debug UART used for printf */
200257 /* The UART interface number varies for each board/CPU */
201258 /* Typically this is the UART attached to the ST-Link USB CDC UART port */
259+ #ifndef HAL_CONSOLE_UART
202260 #define HAL_CONSOLE_UART huart4
261+ #endif
203262
204263 /* Hardware Crypto - uncomment as available on hardware */
264+ //#define STM32_HAL_V2
205265 //#define WOLFSSL_STM32_PKA
266+ //#define WOLFSSL_STM32_PKA_V2
206267 //#define NO_STM32_RNG
207268 //#undef NO_STM32_HASH
208269 //#undef NO_STM32_CRYPTO
209270 /* if no HW RNG is available use test seed */
210271 //#define WOLFSSL_GENSEED_FORTEST
211- //#define STM32_HAL_V2
212272#endif
213273
214274
0 commit comments