Skip to content

Commit 5b2a7f5

Browse files
committed
add stm32f746-st-nucleo
1 parent b73ad3c commit 5b2a7f5

38 files changed

+14704
-0
lines changed

bsp/stm32/stm32f746-st-nucleo/.config

Lines changed: 721 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
mainmenu "RT-Thread Configuration"
2+
3+
config BSP_DIR
4+
string
5+
option env="BSP_ROOT"
6+
default "."
7+
8+
config RTT_DIR
9+
string
10+
option env="RTT_ROOT"
11+
default "../../.."
12+
13+
config PKGS_DIR
14+
string
15+
option env="PKGS_ROOT"
16+
default "packages"
17+
18+
source "$RTT_DIR/Kconfig"
19+
source "$PKGS_DIR/Kconfig"
20+
source "../libraries/Kconfig"
21+
source "board/Kconfig"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# STM32F746-Nucleo BSP Introduction
2+
3+
[中文](README_zh.md)
4+
5+
## MCU: STM32F746ZG @216MHz, 1MB FLASH, 320KB RAM
6+
7+
he STM32 Nucleo-144 board provides an affordable and flexible way for users to try out new concepts and build prototypes by choosing from the various combinations of performance and power consumption features, provided by the STM32 microcontroller. For the compatible boards, the internal or external SMPS significantly reduces power consumption in Run mode.
8+
9+
![board](figures/en.high-perf_nucleo-144_mbed.jpg)
10+
11+
The ST Zio connector, which extends the ARDUINO® Uno V3 connectivity, and the ST morpho headers provide an easy means of expanding the functionality of the Nucleo open development platform with a wide choice of specialized shields.
12+
13+
14+
15+
The STM32 Nucleo-144 board does not require any separate probe as it integrates the ST-LINK debugger/programmer.
16+
17+
18+
19+
The STM32 Nucleo-144 board comes with the STM32 comprehensive free software libraries and examples available with the STM32Cube MCU Package.
20+
21+
#### KEY FEATURES
22+
23+
- Common features
24+
- STM32 microcontroller in LQFP144 package
25+
- 3 user LEDs
26+
- 2 user and reset push-buttons
27+
- 32.768 kHz crystal oscillator
28+
- Board connectors:SWDST Zio expansion connector including ARDUINO® Uno V3ST morpho expansion connector
29+
- Flexible power-supply options: ST-LINK, USB VBUS or external sources
30+
- On-board ST-LINK debugger/programmer with USB re-enumeration capability: mass storage, Virtual COM port, and debug port
31+
- Comprehensive free software libraries and examples available with the STM32Cube MCU Package
32+
- Support of a wide choice of Integrated Development Environments (IDEs) including IAR™, Keil®, and STM32CubeIDE
33+
- Board-specific features
34+
- External or internal SMPS to generate Vcore logic supply
35+
- Ethernet compliant with IEEE-802.3-2002
36+
- USB OTG full speed or device only
37+
- Board connectors:USB with Micro-AB or USB Type-C™Ethernet RJ45
38+
- Arm® Mbed Enabled™ compliant
39+
40+
41+
42+
## Maintained By
43+
44+
[BruceOu](https://github.com/Ouxiaolong/) <[email protected]>
45+
46+
47+
48+
## Translated By
49+
50+
>
51+
> https://github.com/Ouxiaolong/
52+
53+
54+
55+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# STM32F746 NUCLEO-F746ZG开发板 BSP 说明
2+
## 简介
3+
4+
本文档为 NUCLEO-F746ZG 开发板的 BSP (板级支持包) 说明。
5+
6+
主要内容如下:
7+
8+
- 开发板资源介绍
9+
- BSP 快速上手
10+
- 进阶使用方法
11+
12+
通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。
13+
14+
## 开发板介绍
15+
16+
NUCLEO-F746ZG是st推出的一款基于 ARM Cortex-M7 内核的开发板,最高主频为 216Mhz,该开发板具有丰富的板载资源,可以充分发挥 STM32F746 的芯片性能。
17+
18+
开发板外观如下图所示:
19+
20+
![board](figures/en.high-perf_nucleo-144_mbed.jpg)
21+
22+
该开发板常用 **板载资源** 如下:
23+
24+
- MCU:STM32f746,主频 216MHz,1MB FLASH ,320KB RAM ,16K CACHE
25+
26+
- 常用外设
27+
- LED :3个,LED1 (绿色,PB0),LED2(蓝色,PB7),LED3(红色,PB14)
28+
- 按键:2个,B1(用户按键,PC13),B2(复位引脚)
29+
- 常用接口:USB 转串口3、以太网接口
30+
- 调试接口:ST-LINK
31+
32+
开发板更多详细信息请参考ST [NUCLEO-F746zg开发板介绍](https://www.st.com/en/evaluation-tools/nucleo-f746zg.html)
33+
34+
## 外设支持
35+
36+
本 BSP 目前对外设的支持情况如下:
37+
38+
| **板载外设** | **支持情况** | **备注** |
39+
| :-----------------| :----------: | :-------------------------------------|
40+
| USB 转串口3 | 支持 | |
41+
| 以太网 | 支持 | PHY 选项 LAN8720A(兼容 LAN8742A) |
42+
| **片上外设** | **支持情况** | **备注** |
43+
| GPIO | 支持 | PA0, PA1... PK15 ---> PIN: 0, 1...144 |
44+
| UART | 支持 | UART3 |
45+
| **扩展模块** | **支持情况** | **备注** |
46+
| 暂无 | 暂不支持 | 暂不支持 |
47+
48+
## 使用说明
49+
50+
使用说明分为如下两个章节:
51+
52+
- 快速上手
53+
54+
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
55+
56+
- 进阶使用
57+
58+
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
59+
60+
61+
### 快速上手
62+
63+
本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
64+
65+
#### 硬件连接
66+
67+
使用数据线连接开发板到 PC,打开电源开关。
68+
69+
#### 编译下载
70+
71+
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
72+
73+
> 工程默认配置使用 ST-LINK 仿真器下载程序,在通过 ST-LINK 连接开发板的基础上,点击下载按钮即可下载程序到开发板
74+
75+
#### 运行结果
76+
77+
下载程序成功之后,系统会自动运行,LED 闪烁。
78+
79+
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
80+
81+
```bash
82+
\ | /
83+
- RT - Thread Operating System
84+
/ | \ 4.0.0 build Jan 9 2021
85+
2006 - 2021 Copyright by rt-thread team
86+
msh >
87+
```
88+
### 进阶使用
89+
90+
此 BSP 默认只开启了 GPIO 和 串口3 的功能,如果需使用 Ethernet 等更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
91+
92+
1. 在 bsp 下打开 env 工具。
93+
94+
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
95+
96+
3. 输入`pkgs --update`命令更新软件包。
97+
98+
4. 输入`scons --target=mdk4/mdk5/iar` 命令重新生成工程。
99+
100+
本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)
101+
102+
## 注意事项
103+
104+
暂无
105+
106+
## 联系人信息
107+
108+
维护人:
109+
110+
- [BruceOu](https://github.com/Ouxiaolong/), 邮箱:<[email protected]>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# for module compiling
2+
import os
3+
Import('RTT_ROOT')
4+
from building import *
5+
6+
cwd = GetCurrentDir()
7+
objs = []
8+
list = os.listdir(cwd)
9+
10+
for d in list:
11+
path = os.path.join(cwd, d)
12+
if os.path.isfile(os.path.join(path, 'SConscript')):
13+
objs = objs + SConscript(os.path.join(d, 'SConscript'))
14+
15+
Return('objs')
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import os
2+
import sys
3+
import rtconfig
4+
5+
if os.getenv('RTT_ROOT'):
6+
RTT_ROOT = os.getenv('RTT_ROOT')
7+
else:
8+
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
9+
10+
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11+
try:
12+
from building import *
13+
except:
14+
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
15+
print(RTT_ROOT)
16+
exit(-1)
17+
18+
TARGET = 'rt-thread.' + rtconfig.TARGET_EXT
19+
20+
DefaultEnvironment(tools=[])
21+
env = Environment(tools = ['mingw'],
22+
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
23+
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
24+
AR = rtconfig.AR, ARFLAGS = '-rc',
25+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
26+
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
27+
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
28+
29+
if rtconfig.PLATFORM == 'iar':
30+
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
31+
env.Replace(ARFLAGS = [''])
32+
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
33+
34+
Export('RTT_ROOT')
35+
Export('rtconfig')
36+
37+
SDK_ROOT = os.path.abspath('./')
38+
39+
if os.path.exists(SDK_ROOT + '/libraries'):
40+
libraries_path_prefix = SDK_ROOT + '/libraries'
41+
else:
42+
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
43+
44+
SDK_LIB = libraries_path_prefix
45+
Export('SDK_LIB')
46+
47+
# prepare building environment
48+
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
49+
50+
stm32_library = 'STM32F7xx_HAL'
51+
rtconfig.BSP_LIBRARY_TYPE = stm32_library
52+
53+
# include libraries
54+
objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript')))
55+
56+
# include drivers
57+
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript')))
58+
59+
# make a building
60+
DoBuilding(TARGET, objs)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import rtconfig
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
CPPPATH = [cwd, str(Dir('#'))]
6+
src = Split("""
7+
main.c
8+
""")
9+
10+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
11+
12+
Return('group')
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2006-2021, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2021-06-14 BruceOu first version
9+
*/
10+
11+
#include <rtthread.h>
12+
#include <rtdevice.h>
13+
#include <board.h>
14+
15+
/* defined the LED1 pin: PB0 */
16+
#define LED1_PIN GET_PIN(B, 0)
17+
18+
int main(void)
19+
{
20+
int count = 1;
21+
/* set LED1 pin mode to output */
22+
rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
23+
24+
while (count++)
25+
{
26+
rt_pin_write(LED1_PIN, PIN_HIGH);
27+
rt_thread_mdelay(500);
28+
rt_pin_write(LED1_PIN, PIN_LOW);
29+
rt_thread_mdelay(500);
30+
}
31+
32+
return RT_EOK;
33+
}

0 commit comments

Comments
 (0)