boards: stm32l496g_disco: Conform to default configuration guidelines

Update stm32l496g_disco configuration to match with
default configuration guidelines:
-Deactivate features by default
-Configure available connectors

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2018-09-13 16:51:40 +02:00 committed by Anas Nashif
commit b3645eb62b
8 changed files with 79 additions and 7 deletions

View file

@ -18,6 +18,30 @@ config UART_STM32_PORT_2
endif # UART_CONSOLE
if SERIAL
config UART_STM32_LPUART_1
default y
endif # SERIAL
if I2C
config I2C_1
default y
endif # I2C
if SPI
config SPI_STM32_INTERRUPT
default y
config SPI_1
default y
endif # SPI
if PWM
config PWM_STM32_2

View file

@ -139,6 +139,8 @@ The Zephyr stm32l496g_disco board configuration supports the following hardware
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| PWM | on-chip | pwm |
+-----------+------------+-------------------------------------+
@ -160,10 +162,11 @@ For mode details please refer to `STM32L496G Discovery board User Manual`_.
Default Zephyr Peripheral Mapping:
----------------------------------
- UART_1_TX : PB6
- UART_1_RX : PG10
- UART_2_TX : PA2
- UART_2_RX : PD6
- UART_1 TX/RX : PB6/PG10
- UART_2 TX/RX : PA2/PD6 (ST-Link Virtual Port Com)
- LPUART_1 TX/RX : PG7/PG8 (Arduino Serial)
- I2C1 SCL/SDA : PB8/PB7 (Arduino I2C)
- SPI1 SCK/MISO/MOSI : PA5/PB4/PB5 (Arduino SPI)
- I2C_1_SCL : PB8
- I2C_1_SDA : PB7
- PWM_2_CH1 : PA0

View file

@ -23,10 +23,19 @@ static const struct pin_config pinconf[] = {
{STM32_PIN_PA2, STM32L4X_PINMUX_FUNC_PA2_USART2_TX},
{STM32_PIN_PD6, STM32L4X_PINMUX_FUNC_PD6_USART2_RX},
#endif /* CONFIG_UART_STM32_PORT_2 */
#ifdef CONFIG_UART_STM32_LPUART_1
{STM32_PIN_PG7, STM32L4X_PINMUX_FUNC_PG7_LPUART1_TX},
{STM32_PIN_PG8, STM32L4X_PINMUX_FUNC_PG8_LPUART1_RX},
#endif /* CONFIG_UART_STM32_LPUART_1 */
#ifdef CONFIG_I2C_1
{STM32_PIN_PB8, STM32L4X_PINMUX_FUNC_PB8_I2C1_SCL},
{STM32_PIN_PB7, STM32L4X_PINMUX_FUNC_PB7_I2C1_SDA},
#endif /* CONFIG_I2C_1 */
#ifdef CONFIG_SPI_1
{STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK},
{STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO},
{STM32_PIN_PB5, STM32L4X_PINMUX_FUNC_PB5_SPI1_MOSI},
#endif /* CONFIG_SPI_1 */
#ifdef CONFIG_PWM_STM32_2
{STM32_PIN_PA0, STM32L4X_PINMUX_FUNC_PA0_PWM2_CH1},
#endif /* CONFIG_PWM_STM32_2 */

View file

@ -55,6 +55,10 @@
};
};
arduino_i2c: &i2c1 {};
arduino_spi: &spi1 {};
arduino_serial: &lpuart1 {};
&usart1 {
current-speed = <115200>;
pinctrl-0 = <&usart1_pins_c>;
@ -69,6 +73,13 @@
status = "ok";
};
&lpuart1 {
current-speed = <115200>;
pinctrl-0 = <&usart1_pins_c>;
pinctrl-names = "default";
status = "ok";
};
&timers2 {
status = "ok";
@ -77,6 +88,15 @@
};
};
&i2c1 {
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;
};
&spi1 {
status = "ok";
};
&rtc {
status = "ok";
};

View file

@ -5,5 +5,10 @@ arch: arm
toolchain:
- zephyr
- gnuarmemb
ram: 320
flash: 1024
supported:
- pwm
- i2c
- spi
- gpio

View file

@ -34,6 +34,3 @@ CONFIG_CLOCK_STM32_APB2_PRESCALER=1
# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
#enable pwm
CONFIG_PWM=y

View file

@ -55,8 +55,12 @@
(STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB3_SPI3_SCK \
(STM32_PINMUX_ALT_FUNC_6 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO \
(STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB4_SPI3_MISO \
(STM32_PINMUX_ALT_FUNC_6 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB5_SPI1_MOSI \
(STM32_PINMUX_ALT_FUNC_5 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB5_SPI3_MOSI \
(STM32_PINMUX_ALT_FUNC_6 | STM32_PUSHPULL_NOPULL)
#define STM32L4X_PINMUX_FUNC_PB6_I2C1_SCL \
@ -127,6 +131,10 @@
/* Port G */
#define STM32L4X_PINMUX_FUNC_PG7_I2C3_SCL \
(STM32_PINMUX_ALT_FUNC_4 | STM32_OPENDRAIN_PULLUP)
#define STM32L4X_PINMUX_FUNC_PG7_LPUART1_TX \
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_PULLUP)
#define STM32L4X_PINMUX_FUNC_PG8_LPUART1_RX \
(STM32_PINMUX_ALT_FUNC_8 | STM32_PUPDR_NO_PULL)
#define STM32L4X_PINMUX_FUNC_PG8_I2C3_SDA \
(STM32_PINMUX_ALT_FUNC_4 | STM32_OPENDRAIN_PULLUP)
#define STM32L4X_PINMUX_FUNC_PG9_USART1_TX \

View file

@ -63,6 +63,12 @@
tx = <STM32_PIN_PA0 (STM32_PINMUX_ALT_FUNC_7 | STM32_PUSHPULL_NOPULL)>;
};
};
lpuart1_pins_a: lpuart1_a {
rx_tx {
rx = <STM32_PIN_PG8 (STM32_PINMUX_ALT_FUNC_8 | STM32_PUPDR_NO_PULL)>;
tx = <STM32_PIN_PG7 (STM32_PINMUX_ALT_FUNC_8 | STM32_PUSHPULL_NOPULL)>;
};
};
can_pins_a: can_a {
rx_tx {
rx = <STM32_PIN_PA11 (STM32_PINMUX_ALT_FUNC_9 | STM32_PUPDR_PULL_UP)>;