Skip to content

Commit

Permalink
boards: Add stm32h747i_disco, C-M7 target
Browse files Browse the repository at this point in the history
Add C-M7 target for board stm32h747i_disco.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
  • Loading branch information
erwango authored and nashif committed Jul 4, 2019
1 parent 4d7a580 commit afcb1ae
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 0 deletions.
7 changes: 7 additions & 0 deletions boards/arm/stm32h747i_disco/CMakeLists.txt
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/drivers)
endif()
11 changes: 11 additions & 0 deletions boards/arm/stm32h747i_disco/Kconfig.board
@@ -0,0 +1,11 @@
# Kconfig - STM32H747I Discovery board configuration
#
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

config BOARD_STM32H747I_DISCO_M7
bool "STM32H747I Discovery Development Board"
depends on SOC_STM32H747XX
select CPU_CORTEX_M7
27 changes: 27 additions & 0 deletions boards/arm/stm32h747i_disco/Kconfig.defconfig
@@ -0,0 +1,27 @@
# Kconfig - STM32H747I DISCOVERY board configuration
#
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

if BOARD_STM32H747I_DISCO_M7

config BOARD
default "stm32h747i_disco_m7" if BOARD_STM32H747I_DISCO_M7

if UART_CONSOLE

config UART_1
default y

endif # UART_CONSOLE

if SERIAL

config UART_8
default y

endif # SERIAL

endif # BOARD_STM32H747I_DISCO_M7
37 changes: 37 additions & 0 deletions boards/arm/stm32h747i_disco/pinmux.c
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <kernel.h>
#include <device.h>
#include <init.h>
#include <pinmux.h>
#include <sys_io.h>

#include <pinmux/stm32/pinmux_stm32.h>

/* pin assignments for STM32H747I-DISCO board */
static const struct pin_config pinconf[] = {
#ifdef CONFIG_UART_1
{STM32_PIN_PA9, STM32H7_PINMUX_FUNC_PA9_USART1_TX},
{STM32_PIN_PA10, STM32H7_PINMUX_FUNC_PA10_USART1_RX},
#endif /* CONFIG_UART_1 */
#ifdef CONFIG_UART_8
{STM32_PIN_PJ8, STM32H7_PINMUX_FUNC_PJ8_UART8_TX},
{STM32_PIN_PJ9, STM32H7_PINMUX_FUNC_PJ9_UART8_RX},
#endif /* CONFIG_UART_8 */
};

static int pinmux_stm32_init(struct device *port)
{
ARG_UNUSED(port);

stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));

return 0;
}

SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
66 changes: 66 additions & 0 deletions boards/arm/stm32h747i_disco/stm32h747i_disco.dtsi
@@ -0,0 +1,66 @@
/*
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
leds {
compatible = "gpio-leds";
green_led_1:led_1 {
gpios = <&gpioi 12 GPIO_INT_ACTIVE_HIGH>;
label = "User LD1";
status = "disabled";
};
orange_led_2:led_2 {
gpios = <&gpioi 13 GPIO_INT_ACTIVE_HIGH>;
label = "User LD2";
status = "disabled";
};
red_led_3:led_3 {
gpios = <&gpioi 14 GPIO_INT_ACTIVE_HIGH>;
label = "User LD3";
status = "disabled";
};
blue_led_4:led_4 {
gpios = <&gpioi 15 GPIO_INT_ACTIVE_HIGH>;
label = "User LD4";
status = "disabled";
};
};

gpio_keys {
compatible = "gpio-keys";
wake_up: button {
label = "Wakeup";
gpios = <&gpioc 13 GPIO_INT_ACTIVE_HIGH>;
status = "disabled";
};
joy_center: joystick_center {
label = "joystick center";
gpios = <&gpiok 2 GPIO_INT_ACTIVE_LOW>;
status = "disabled";
};
joy_down: joystick_down {
label = "joystick down";
gpios = <&gpiok 3 GPIO_INT_ACTIVE_LOW>;
status = "disabled";
};
joy_up: joystick_up {
label = "joystick up";
gpios = <&gpiok 6 GPIO_INT_ACTIVE_LOW>;
status = "disabled";
};
joy_left: joystick_left {
label = "joystick left";
gpios = <&gpiok 4 GPIO_INT_ACTIVE_LOW>;
};
joy_right: joystick_right {
label = "joystick right";
gpios = <&gpiok 5 GPIO_INT_ACTIVE_LOW>;
status = "disabled";
};
};
};

arduino_serial: &uart8 {};
56 changes: 56 additions & 0 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m7.dts
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <st/h7/stm32h747Xi_m7.dtsi>
#include "stm32h747i_disco.dtsi"

/ {
model = "STMicroelectronics STM32H747I DISCOVERY board";
compatible = "st,stm32h747i-disco", "st,stm32h747";

/* HW resources are split between CM7 and CM4 */
chosen {
zephyr,console = &usart1;
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};

leds {
green_led_1:led_1 {
status = "okay";
};
orange_led_2:led_2 {
status = "okay";
};
};

gpio_keys {
wake_up: button {
status = "okay";
};
};

aliases {
led0 = &green_led_1;
led1 = &orange_led_2;
sw0 = &wake_up;
};
};


&usart1 {
current-speed = <115200>;
pinctrl-names = "default";
status = "ok";
};

&uart8 {
current-speed = <115200>;
pinctrl-names = "default";
status = "ok";
};
12 changes: 12 additions & 0 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m7.yaml
@@ -0,0 +1,12 @@
identifier: stm32h747i_disco_m7
name: STM32H747IDISCOVERY
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 512
flash: 1024
supported:
- gpio
48 changes: 48 additions & 0 deletions boards/arm/stm32h747i_disco/stm32h747i_disco_m7_defconfig
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_ARM=y
CONFIG_BOARD_STM32H747I_DISCO_M7=y
CONFIG_SOC_SERIES_STM32H7X=y
CONFIG_SOC_STM32H747XX=y
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

# enable pinmux
CONFIG_PINMUX=y

# enable GPIO
CONFIG_GPIO=y

# clock configuration
CONFIG_CLOCK_CONTROL=y

# Clock configuration for Cube Clock control driver
CONFIG_CLOCK_STM32_HSE_CLOCK=25000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y

# use HSE (bypass) as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
CONFIG_CLOCK_STM32_HSE_BYPASS=y

# produce 400MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=5
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=160
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=4
CONFIG_CLOCK_STM32_PLL_R_DIVISOR=2

CONFIG_CLOCK_STM32_D1CPRE=1
# HCLK: 200MHz
CONFIG_CLOCK_STM32_HPRE=2
# APBX: 100MHz
CONFIG_CLOCK_STM32_D2PPRE1=2
CONFIG_CLOCK_STM32_D2PPRE2=2
CONFIG_CLOCK_STM32_D1PPRE=2
CONFIG_CLOCK_STM32_D3PPRE=2

# enable uart driver
CONFIG_SERIAL=y

# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

0 comments on commit afcb1ae

Please sign in to comment.