Skip to content

Commit

Permalink
boards: Set nucleo_f429zi compatible with configuration guidelines
Browse files Browse the repository at this point in the history
According to Default Configuration Guidelines, update nucleo_f429zi
- Add SPI_1, pinmux compatible with arduino spi
- Change PWM from PA0 to PE13 (Arduino D3)
- Disable I2C by default
- Update board dts with arduino connectors
- update board yaml file
- update board documentation

Signed-off-by: Erwan Gouriou <[email protected]>
  • Loading branch information
erwango authored and galak committed Jul 5, 2018
1 parent deb0941 commit 2a490fd
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 13 deletions.
21 changes: 21 additions & 0 deletions boards/arm/nucleo_f429zi/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,32 @@ config ETH_STM32_HAL

endif # NETWORKING

if SERIAL

config UART_STM32_PORT_6
default y

endif # SERIAL

if I2C

config I2C_1
def_bool y

endif # I2C

if SPI

config SPI_1
def_bool y

endif # SPI

if PWM

config PWM_STM32_1
def_bool y

endif # PWM

endif # BOARD_NUCLEO_F429ZI
17 changes: 11 additions & 6 deletions boards/arm/nucleo_f429zi/doc/nucleof429zi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ The Zephyr nucleo_f249zi board configuration supports the following hardware fea
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+

| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+

Other hardware features are not yet supported on this Zephyr port.

Expand Down Expand Up @@ -141,11 +142,15 @@ For mode details please refer to `STM32 Nucleo-144 board User Manual`_.
Default Zephyr Peripheral Mapping:
----------------------------------

- UART_3_TX : PD8
- UART_3_RX : PD9
- PWM_2_CH1 : PA0
- I2C1_SCL : PB8
- I2C1_SDA : PB9
The Nucleo F429ZI board features a ST Zio connector (extended Arduino Uno V3)
and a ST morpho connector. Board is configured as follows

- UART_3 TX/RX : PD8/PD9 (ST-Link Virtual Port Com)
- UART_6 TX/RX : PG14/PG9 (Arduino Serial)
- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
- SPI1 NSS/SCK/MISO/MOSI : PA4/PA5/PA6/PA7 (Arduino SPI)
- PWM_2_CH1 : PE13
- ETH : PA1, PA2, PA7, PB13, PC1, PC4, PC5, PG11, PG13
- USER_PB : PC13
- LD1 : PB0
- LD2 : PB7
Expand Down
15 changes: 15 additions & 0 deletions boards/arm/nucleo_f429zi/nucleo_f429zi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
zephyr,console = &usart3;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,ccm = &ccm0;
};

leds {
Expand Down Expand Up @@ -49,17 +50,31 @@
};
};

arduino_i2c: &i2c1 {};
arduino_spi: &spi1 {};
arduino_serial: &usart6 {};

&i2c1 {
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;
};

&spi1 {
status = "ok";
};

&usart3 {
current-speed = <115200>;
pinctrl-0 = <&usart3_pins_b>;
pinctrl-names = "default";
status = "ok";
};
&usart6 {
current-speed = <115200>;
pinctrl-0 = <&usart6_pins_a>;
pinctrl-names = "default";
status = "ok";
};

&timers2 {
status = "ok";
Expand Down
6 changes: 6 additions & 0 deletions boards/arm/nucleo_f429zi/nucleo_f429zi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ arch: arm
toolchain:
- zephyr
- gccarmemb
ram: 256
flash: 2048
supported:
- netif:eth
- i2c
- spi
- gpio
- pwm
4 changes: 0 additions & 4 deletions boards/arm/nucleo_f429zi/nucleo_f429zi_defconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CONFIG_ARM=y
CONFIG_BOARD_NUCLEO_F429ZI=y
CONFIG_SOC_SERIES_STM32F4X=y
CONFIG_SOC_STM32F429XI=y
# 180MHz system clock
Expand All @@ -21,9 +20,6 @@ CONFIG_PINMUX=y
# enable GPIO
CONFIG_GPIO=y

# enable I2C
CONFIG_I2C=y

# clock configuration
CONFIG_CLOCK_CONTROL=y

Expand Down
16 changes: 13 additions & 3 deletions boards/arm/nucleo_f429zi/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_STM32_PORT_3
{STM32_PIN_PD8, STM32F4_PINMUX_FUNC_PD8_USART3_TX},
{STM32_PIN_PD9, STM32F4_PINMUX_FUNC_PD9_USART3_RX},
#endif /* #ifdef CONFIG_UART_STM32_PORT_3 */
#ifdef CONFIG_PWM_STM32_2
{STM32_PIN_PA0, STM32F4_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_UART_STM32_PORT_3 */
#ifdef CONFIG_UART_STM32_PORT_6
{STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_USART6_TX},
{STM32_PIN_PG9, STM32F4_PINMUX_FUNC_PG9_USART6_RX},
#endif /* CONFIG_UART_STM32_PORT_6 */
#ifdef CONFIG_PWM_STM32_1
{STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_PWM1_CH3},
#endif /* CONFIG_PWM_STM32_2 */
#ifdef CONFIG_ETH_STM32_HAL
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ETH},
Expand All @@ -38,6 +42,12 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_I2C1_SDA},
#endif
#ifdef CONFIG_SPI_1
{STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS},
{STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO},
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI},
#endif /* CONFIG_SPI_1 */
};

static int pinmux_stm32_init(struct device *port)
Expand Down
2 changes: 2 additions & 0 deletions drivers/pinmux/stm32/pinmux_stm32f4.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@

#define STM32F4_PINMUX_FUNC_PE8_UART7_TX \
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_PULLUP)
#define STM32F4_PINMUX_FUNC_PE13_PWM1_CH3 \
(STM32_PINMUX_ALT_FUNC_1 | STM32_PUSHPULL_PULLUP)

/* Port F */
#define STM32F4_PINMUX_FUNC_PF0_I2C2_SDA \
Expand Down

0 comments on commit 2a490fd

Please sign in to comment.