Skip to content

Commit 834e900

Browse files
committed
fix: take into account STM32G0B0 USART IRQ multiplexing specificities
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
1 parent 650ec46 commit 834e900

File tree

2 files changed

+14
-2
lines changed
  • cores/arduino/stm32
  • libraries/SrcWrapper/src/stm32

2 files changed

+14
-2
lines changed

cores/arduino/stm32/uart.h

+12
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ struct serial_s {
116116
#elif defined(LPUART1_BASE)
117117
#define USART3_IRQn USART3_4_LPUART1_IRQn
118118
#define USART3_IRQHandler USART3_4_LPUART1_IRQHandler
119+
#elif defined(STM32G0B0xx)
120+
#define USART3_IRQn USART3_4_5_6_IRQn
121+
#define USART3_IRQHandler USART3_4_5_6_IRQHandler
119122
#else
120123
#define USART3_IRQn USART3_4_IRQn
121124
#define USART3_IRQHandler USART3_4_IRQHandler
@@ -140,6 +143,9 @@ struct serial_s {
140143
#define USART4_IRQn USART3_4_5_6_LPUART1_IRQn
141144
#elif defined(LPUART1_BASE)
142145
#define USART4_IRQn USART3_4_LPUART1_IRQn
146+
#elif defined(STM32G0B0xx)
147+
#define USART4_IRQn USART3_4_5_6_IRQn
148+
#define USART4_IRQHandler USART3_4_5_6_IRQHandler
143149
#else
144150
#define USART4_IRQn USART3_4_IRQn
145151
#endif
@@ -157,6 +163,9 @@ struct serial_s {
157163
#elif defined(STM32G0xx)
158164
#if defined(LPUART2_BASE)
159165
#define USART5_IRQn USART3_4_5_6_LPUART1_IRQn
166+
#elif defined(STM32G0B0xx)
167+
#define USART5_IRQn USART3_4_5_6_IRQn
168+
#define USART5_IRQHandler USART3_4_5_6_IRQHandler
160169
#endif
161170
#elif defined(STM32L0xx)
162171
#define USART5_IRQn USART4_5_IRQn
@@ -174,6 +183,9 @@ struct serial_s {
174183
#elif defined(STM32G0xx)
175184
#if defined(LPUART2_BASE)
176185
#define USART6_IRQn USART3_4_5_6_LPUART1_IRQn
186+
#elif defined(STM32G0B0xx)
187+
#define USART6_IRQn USART3_4_5_6_IRQn
188+
#define USART6_IRQHandler USART3_4_5_6_IRQHandler
177189
#endif
178190
#endif /* STM32F0xx */
179191
#endif

libraries/SrcWrapper/src/stm32/uart.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ void USART3_IRQHandler(void)
10241024
if (uart_handlers[UART4_INDEX] != NULL) {
10251025
HAL_UART_IRQHandler(uart_handlers[UART4_INDEX]);
10261026
}
1027-
#if defined(STM32F030xC) || defined(STM32G0xx) && defined(LPUART2_BASE)
1027+
#if defined(STM32F030xC) || defined(STM32G0xx) && (defined(LPUART2_BASE) || defined(STM32G0B0xx))
10281028
if (uart_handlers[UART5_INDEX] != NULL) {
10291029
HAL_UART_IRQHandler(uart_handlers[UART5_INDEX]);
10301030
}
@@ -1093,7 +1093,7 @@ void UART5_IRQHandler(void)
10931093
* @param None
10941094
* @retval None
10951095
*/
1096-
#if defined(USART6_BASE) && !defined(STM32F0xx)
1096+
#if defined(USART6_BASE) && !defined(STM32F0xx) && !defined(STM32G0B0xx)
10971097
void USART6_IRQHandler(void)
10981098
{
10991099
HAL_NVIC_ClearPendingIRQ(USART6_IRQn);

0 commit comments

Comments
 (0)