Skip to content

Commit 504a115

Browse files
erwangogalak
authored andcommitted
boards: nucleo_f429zi: Configure I2C1
Enable and configure I2C1. This configuration enables ready to use compatibility with expansion shields based on Arduino type connectors Additionally, fix comment on clock speed in board _defconfig Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 8409532 commit 504a115

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed

boards/arm/nucleo_f429zi/Kconfig.board

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
config BOARD_NUCLEO_F429ZI
99
bool "NUCLEO-144 F429ZI Development Board"
10+
select HAS_DTS_I2C_DEVICE
1011
depends on SOC_STM32F429XI

boards/arm/nucleo_f429zi/Kconfig.defconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ config ETH_STM32_HAL
2727

2828
endif # NETWORKING
2929

30+
if I2C
31+
32+
config I2C_1
33+
def_bool y
34+
35+
endif # I2C
36+
3037
endif # BOARD_NUCLEO_F429ZI

boards/arm/nucleo_f429zi/doc/nucleof429zi.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ The Zephyr nucleo_f249zi board configuration supports the following hardware fea
9595
+-----------+------------+-------------------------------------+
9696
| PWM | on-chip | pwm |
9797
+-----------+------------+-------------------------------------+
98+
| I2C | on-chip | i2c |
99+
+-----------+------------+-------------------------------------+
98100

99101

100102
Other hardware features are not yet supported on this Zephyr port.
@@ -141,6 +143,8 @@ Default Zephyr Peripheral Mapping:
141143
- UART_3_TX : PD8
142144
- UART_3_RX : PD9
143145
- PWM_2_CH1 : PA0
146+
- I2C1_SCL : PB8
147+
- I2C1_SDA : PB9
144148
- USER_PB : PC13
145149
- LD1 : PB0
146150
- LD2 : PB7

boards/arm/nucleo_f429zi/nucleo_f429zi.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
};
1919
};
2020

21+
&i2c1 {
22+
status = "ok";
23+
clock-frequency = <I2C_BITRATE_FAST>;
24+
};
25+
2126
&usart3 {
2227
current-speed = <115200>;
2328
pinctrl-0 = <&usart3_pins_b>;

boards/arm/nucleo_f429zi/nucleo_f429zi_defconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ CONFIG_PINMUX=y
2121
# enable GPIO
2222
CONFIG_GPIO=y
2323

24+
# enable I2C
25+
CONFIG_I2C=y
26+
2427
# clock configuration
2528
CONFIG_CLOCK_CONTROL=y
2629

@@ -32,7 +35,7 @@ CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
3235
# however, the board does not have an external oscillator, so just use
3336
# the 8MHz clock signal coming from integrated STLink
3437
CONFIG_CLOCK_STM32_HSE_BYPASS=y
35-
# produce 96MHz clock at PLL output
38+
# produce 180MHz clock at PLL output
3639
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=8
3740
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=360
3841
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=2

boards/arm/nucleo_f429zi/pinmux.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ static const struct pin_config pinconf[] = {
3434
{STM32_PIN_PG13, STM32F4_PINMUX_FUNC_PG13_ETH},
3535
{STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_ETH},
3636
#endif /* CONFIG_ETH_STM32_HAL */
37+
#ifdef CONFIG_I2C_1
38+
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL},
39+
{STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA},
40+
#endif
3741
};
3842

3943
static int pinmux_stm32_init(struct device *port)

0 commit comments

Comments
 (0)