Skip to content

Commit 77bbc42

Browse files
tagunilgalak
authored andcommitted
arch: arm: soc: stm32l0: fix port H EXTI
Ports F and G are not present on some STM32L0 parts, so for these parts port H external interrupt should be enabled by writing value 0x5 instead of 0x7 to SYSCFG_EXTICRn registers (see e.g. RM0367, 10.2.4). Signed-off-by: Ilya Tagunov <[email protected]>
1 parent bd583ed commit 77bbc42

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

arch/arm/soc/st_stm32/stm32l0/soc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
#include "soc_irq.h"
3333

34+
#include <stm32l0xx_ll_system.h>
35+
3436
#ifdef CONFIG_SERIAL_HAS_DRIVER
3537
#include <stm32l0xx_ll_usart.h>
3638
#endif
@@ -39,7 +41,6 @@
3941
#include <stm32l0xx_ll_utils.h>
4042
#include <stm32l0xx_ll_bus.h>
4143
#include <stm32l0xx_ll_rcc.h>
42-
#include <stm32l0xx_ll_system.h>
4344
#endif /* CONFIG_CLOCK_CONTROL_STM32_CUBE */
4445

4546
#ifdef CONFIG_I2C_STM32_V2

arch/arm/soc/st_stm32/stm32l0/soc_gpio.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ int stm32_gpio_enable_int(int port, int pin)
135135
return -EINVAL;
136136
}
137137

138+
/*
139+
* Ports F and G are not present on some STM32L0 parts, so
140+
* for these parts port H external interrupt should be enabled
141+
* by writing value 0x5 instead of 0x7.
142+
*/
143+
if (port == STM32_PORTH) {
144+
port = LL_SYSCFG_EXTI_PORTH;
145+
}
146+
138147
shift = 4 * (pin % 4);
139148

140149
exticr->val &= ~(0xf << shift);

0 commit comments

Comments
 (0)