boards: arm: nucleo_f756zg: Added SPI support

Added support for SPI 1 available from the arduino connector (plus an
extra gpio). Tested against samples/sensor/bme280.

Added warnings in documentation, pinmux and dts highlighting a potential
conflict if using SPI_1 and on-board ethernet at the same time.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
This commit is contained in:
AJ Palmer 2018-11-02 09:36:38 +00:00 committed by Kumar Gala
commit a8ce329cc9
5 changed files with 36 additions and 1 deletions

View file

@ -51,4 +51,11 @@ config PWM_STM32_1
endif # PWM
if SPI
config SPI_1
default y
endif # SPI
endif # BOARD_NUCLEO_F756ZG

View file

@ -112,6 +112,8 @@ features:
+-----------+------------+-------------------------------------+
| PWM | on-chip | pwm |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
Other hardware features are not yet supported on this Zephyr port.
@ -138,6 +140,10 @@ and a ST morpho connector. Board is configured as follows:
- USB DP : PA12
- I2C : PB8, PB9
- PWM : PE13
- SPI : PA4, PA5, PA6, PA7
Note. The Arduino Uno v3 specified SPI device conflicts with the on-board ETH
device on pin PA7.
System Clock
------------

View file

@ -52,6 +52,7 @@
arduino_serial: &usart6 {};
arduino_i2c: &i2c1 {};
arduino_spi: &spi1 {};
&usart2 {
current-speed = <115200>;
@ -90,3 +91,11 @@ arduino_i2c: &i2c1 {};
status = "ok";
};
};
&spi1 {
/*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and
* ETH_STM32_HAL. See pinmux.c for further details.
*/
status = "ok";
};

View file

@ -14,3 +14,4 @@ supported:
- usb_device
- i2c
- pwm
- spi

View file

@ -12,7 +12,13 @@
#include <pinmux/stm32/pinmux_stm32.h>
/* NUCLEO-F756ZG pin configurations */
/* NUCLEO-F756ZG pin configurations
*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/
static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_2
{ STM32_PIN_PD5, STM32F7_PINMUX_FUNC_PD5_USART2_TX },
@ -50,6 +56,12 @@ static const struct pin_config pinconf[] = {
#ifdef CONFIG_PWM_STM32_1
{ STM32_PIN_PE13, STM32F7_PINMUX_FUNC_PE13_PWM1_CH3 },
#endif /* CONFIG_PWM_STM32_1 */
#ifdef CONFIG_SPI_1
{ STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS },
{ STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK },
{ STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO },
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI },
#endif /* CONFIG_SPI_1 */
};
static int pinmux_stm32_init(struct device *port)