Skip to content

Commit b249ec0

Browse files
author
Yurii Hamann
committed
boards: arm: stm32: Support for STM32F746G Discovery board
Related to issue #6982 Signed-off-by: Yurii Hamann <yurii@hamann.site>
1 parent a80dd6a commit b249ec0

File tree

12 files changed

+378
-0
lines changed

12 files changed

+378
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
zephyr_library()
2+
zephyr_library_sources(pinmux.c)
3+
zephyr_library_include_directories(${PROJECT_SOURCE_DIR}/drivers)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Kconfig - STM32F746G Discovery board configuration
2+
#
3+
# Copyright (c) 2018 Yurii Hamann
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
config BOARD_STM32F746G_DISCO
9+
bool "STM32F746G Discovery Development Board"
10+
depends on SOC_STM32F746XG
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Kconfig - STM32F746G DISCOVERY board configuration
2+
#
3+
# Copyright (c) 2018 Yurii Hamann
4+
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
#
8+
9+
if BOARD_STM32F746G_DISCO
10+
11+
config BOARD
12+
default stm32f746g_disco
13+
14+
if UART_CONSOLE
15+
16+
config UART_STM32_PORT_1
17+
default y
18+
19+
endif # UART_CONSOLE
20+
21+
if GPIO_STM32
22+
23+
config GPIO_STM32_PORTI
24+
default y
25+
26+
endif # GPIO_STM32
27+
28+
endif # BOARD_STM32F746G_DISCO
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2018 Yurii Hamann
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef __INC_BOARD_H
8+
#define __INC_BOARD_H
9+
10+
#include <soc.h>
11+
12+
/* Create aliases to make the basic samples work */
13+
#define LED0_GPIO_PORT "GPIOI"
14+
#define LED0_GPIO_PIN 1
15+
16+
#endif /* __INC_BOARD_H */
153 KB
Loading
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
.. _stm32f746g_disco_board:
2+
3+
ST STM32F746G Discovery
4+
#######################
5+
6+
Overview
7+
********
8+
9+
The discovery kit enables a wide diversity of applications taking benefit from audio, multi-sensor support, graphics, security, video and high-speed connectivity features.
10+
11+
12+
- STM32F746NGH6 microcontroller featuring 1 Mbytes of Flash memory and 340 Kbytes of RAM, in BGA216 package
13+
- On-board ST-LINK/V2-1 supporting USB re-enumeration capability
14+
- Five power supply options:
15+
16+
- ST LINK/V2-1
17+
- USB FS connector
18+
- USB HS connector
19+
- VIN from Arduino connector
20+
- External 5 V from connector
21+
22+
- Two pushbuttons (user and reset)
23+
- USB functions: virtual COM port, mass storage, debug port
24+
- 4.3-inch 480x272 color LCD-TFT with capacitive touch screen
25+
- SAI audio codec
26+
- Audio line in and line out jack
27+
- Stereo speaker outputs
28+
- Two ST MEMS microphones
29+
- SPDIF RCA input connector
30+
- 128-Mbit Quad-SPI Flash memory
31+
- 128-Mbit SDRAM (64 Mbits accessible)
32+
- Connector for microSD card
33+
- USB OTG HS with Micro-AB connectors
34+
- USB OTG FS with Micro-AB connectors
35+
- Ethernet connector compliant with IEEE-802.3-2002
36+
37+
.. image:: img/en.stm32f746g-disco.jpg
38+
:width: 500px
39+
:align: center
40+
:height: 357px
41+
:alt: STM32F746G-DISCO
42+
43+
More information about the board can be found at the `32F746G-DISCO website`_.
44+
45+
Hardware
46+
********
47+
48+
STM32F746G Discovery kit provides the following hardware components:
49+
50+
- STM32F746NGH6 in BGA216 package
51+
- ARM |reg| 32-bit Cortex |reg| -M7 CPU with FPU
52+
- 216 MHz max CPU frequency
53+
- VDD from 1.8 V to 3.6 V
54+
- 2 MB Flash
55+
- 384+4 KB SRAM including 64-Kbyte of core coupled memory
56+
- GPIO with external interrupt capability
57+
- LCD parallel interface, 8080/6800 modes
58+
- LCD TFT controller supporting up to XGA resolution
59+
- MIPI |reg| DSI host controller supporting up to 720p 30Hz resolution
60+
- 3x12-bit ADC with 24 channels
61+
- 2x12-bit D/A converters
62+
- RTC
63+
- Advanced-control Timer
64+
- General Purpose Timers (17)
65+
- Watchdog Timers (2)
66+
- USART/UART (8)
67+
- I2C (3)
68+
- SPI (6)
69+
- 1xSAI (serial audio interface)
70+
- SDIO
71+
- 2xCAN
72+
- USB 2.0 OTG FS with on-chip PHY
73+
- USB 2.0 OTG HS/FS with dedicated DMA, on-chip full-speed PHY and ULPI
74+
- 10/100 Ethernet MAC with dedicated DMA
75+
- 8- to 14-bit parallel camera
76+
- CRC calculation unit
77+
- True random number generator
78+
- DMA Controller
79+
80+
More information about STM32F746NGH6 can be found here:
81+
- `STM32F746NGH6 on www.st.com`_
82+
- `STM32F74xxx reference manual`_
83+
84+
Supported Features
85+
==================
86+
87+
The Zephyr stm32f746g_disco board configuration supports the following hardware features:
88+
89+
+-----------+------------+-------------------------------------+
90+
| Interface | Controller | Driver/Component |
91+
+===========+============+=====================================+
92+
| NVIC | on-chip | nested vector interrupt controller |
93+
+-----------+------------+-------------------------------------+
94+
| UART | on-chip | serial port-polling; |
95+
| | | serial port-interrupt |
96+
+-----------+------------+-------------------------------------+
97+
| PINMUX | on-chip | pinmux |
98+
+-----------+------------+-------------------------------------+
99+
| GPIO | on-chip | gpio |
100+
+-----------+------------+-------------------------------------+
101+
102+
Other hardware features are not yet supported on Zephyr porting.
103+
104+
The default configuration can be found in the defconfig file:
105+
106+
``boards/arm/stm32f746g_disco/stm32f746g_disco_defconfig``
107+
108+
109+
Pin Mapping
110+
===========
111+
112+
STM32F746G Discovery kit has 9 GPIO controllers. These controllers are responsible for pin muxing,
113+
input/output, pull-up, etc.
114+
115+
For mode details please refer to `32F746G-DISCO board User Manual`_.
116+
117+
Default Zephyr Peripheral Mapping:
118+
----------------------------------
119+
- UART_1_TX : PA9
120+
- UART_1_RX : PB7
121+
- UART_3_TX : PC6
122+
- UART_3_RX : PC7
123+
- LD1 : PI1
124+
125+
System Clock
126+
============
127+
128+
STM32F746G System Clock could be driven by internal or external oscillator,
129+
as well as main PLL clock. By default System clock is driven by PLL clock at 216MHz,
130+
driven by 25MHz high speed external clock.
131+
132+
Serial Port
133+
===========
134+
135+
The STM32F746G Discovery kit has up to 8 UARTs. The Zephyr console output is assigned to UART1.
136+
Default settings are 115200 8N1.
137+
138+
139+
Programming and Debugging
140+
*************************
141+
142+
Applications for the ``stm32f746g_disco`` board configuration can be built and
143+
flashed in the usual way (see :ref:`build_an_application` and
144+
:ref:`application_run` for more details).
145+
146+
Flashing
147+
========
148+
149+
STM32F746G Discovery kit includes an ST-LINK/V2 embedded debug tool interface.
150+
This interface is supported by the openocd version included in Zephyr SDK.
151+
152+
Flashing an application to STM32F746G
153+
-------------------------------------------
154+
155+
First, connect the STM32F746G Discovery kit to your host computer using
156+
the USB port to prepare it for flashing. Then build and flash your application.
157+
158+
Here is an example for the :ref:`hello_world` application.
159+
160+
.. zephyr-app-commands::
161+
:zephyr-app: samples/hello_world
162+
:board: stm32f746g_disco
163+
:goals: build flash
164+
165+
Run a serial host program to connect with your board:
166+
167+
.. code-block:: console
168+
169+
$ minicom -D /dev/ttyACM0
170+
171+
You should see the following message on the console:
172+
173+
.. code-block:: console
174+
175+
Hello World! arm
176+
177+
178+
Debugging
179+
=========
180+
181+
You can debug an application in the usual way. Here is an example for the
182+
:ref:`hello_world` application.
183+
184+
.. zephyr-app-commands::
185+
:zephyr-app: samples/hello_world
186+
:board: stm32f746g_disco
187+
:goals: debug
188+
189+
190+
.. _32F746G-DISCO website:
191+
http://www.st.com/en/evaluation-tools/32f746gdiscovery.html
192+
193+
.. _32F746G-DISCO board User Manual:
194+
http://www.st.com/resource/en/user_manual/dm00190424.pdf
195+
196+
.. _STM32F746NGH6 on www.st.com:
197+
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html
198+
199+
.. _STM32F74xxx reference manual:
200+
http://www.st.com/resource/en/reference_manual/dm00124865.pdf
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2018 Yurii Hamann
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <kernel.h>
8+
#include <device.h>
9+
#include <init.h>
10+
#include <pinmux.h>
11+
#include <sys_io.h>
12+
13+
#include <pinmux/stm32/pinmux_stm32.h>
14+
15+
/* pin assignments for STM32F746G-DISCO board */
16+
static const struct pin_config pinconf[] = {
17+
#ifdef CONFIG_UART_STM32_PORT_1
18+
{STM32_PIN_PA9, STM32F7_PINMUX_FUNC_PA9_USART1_TX},
19+
{STM32_PIN_PB7, STM32F7_PINMUX_FUNC_PB7_USART1_RX},
20+
#endif /* CONFIG_UART_STM32_PORT_1 */
21+
#ifdef CONFIG_UART_STM32_PORT_6
22+
{STM32_PIN_PC6, STM32F7_PINMUX_FUNC_PC6_USART6_TX},
23+
{STM32_PIN_PG7, STM32F7_PINMUX_FUNC_PC7_USART6_RX},
24+
#endif /* CONFIG_UART_STM32_PORT_6 */
25+
};
26+
27+
static int pinmux_stm32_init(struct device *port)
28+
{
29+
ARG_UNUSED(port);
30+
31+
stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));
32+
33+
return 0;
34+
}
35+
36+
SYS_INIT(pinmux_stm32_init, PRE_KERNEL_1,
37+
CONFIG_PINMUX_STM32_DEVICE_INITIALIZATION_PRIORITY);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2018 Yurii Hamann
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/stm32f746.dtsi>
9+
10+
/ {
11+
model = "STMicroelectronics STM32F746G DISCOVERY board";
12+
compatible = "st,stm32f746g-disco", "st,stm32f746";
13+
14+
chosen {
15+
zephyr,console = &usart1;
16+
zephyr,sram = &sram0;
17+
zephyr,flash = &flash0;
18+
};
19+
};
20+
21+
&usart1 {
22+
current-speed = <115200>;
23+
pinctrl-names = "default";
24+
status = "ok";
25+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
identifier: stm32f746g_disco
2+
name: STM32F746GDISCOVERY
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gccarmemb

0 commit comments

Comments
 (0)