• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..21-Aug-2025-

.ci/attachconfig/21-Aug-2025-

applications/21-Aug-2025-

board/21-Aug-2025-

figures/21-Aug-2025-

.config A D21-Aug-202547.8 KiB1,4581,348

.gitignore A D21-Aug-2025365 4342

Kconfig A D21-Aug-2025451 2719

README.md A D21-Aug-20254.7 KiB12574

README_EN.md A D21-Aug-20255.5 KiB12874

SConscript A D21-Aug-2025388 1914

SConstruct A D21-Aug-20252.4 KiB7557

project.ewd A D21-Aug-202599.6 KiB2,8352,834

project.ewp A D21-Aug-202566.9 KiB2,4092,408

project.eww A D21-Aug-2025161 117

project.uvoptx A D21-Aug-20256.3 KiB198190

project.uvprojx A D21-Aug-202549.3 KiB1,3651,364

rtconfig.h A D21-Aug-20258.5 KiB42486

rtconfig.py A D21-Aug-20256.5 KiB220172

template.ewp A D21-Aug-202571 KiB2,0322,031

template.eww A D21-Aug-2025162 117

template.uvoptx A D21-Aug-20256.3 KiB198190

template.uvprojx A D21-Aug-202514.1 KiB397391

README.md

1# STM32F407 星火一号开发板 BSP 说明
2
3## 简介
4
5本文档为 RT-Thread 开发团队为 STM32F407 星火1号开发板提供的 BSP (板级支持包) 说明。
6
7主要内容如下:
8
9- 开发板资源介绍
10- BSP 快速上手
11- 进阶使用方法
12
13通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。
14
15## 开发板介绍
16
17星火号 STM32F407 是RT-THREAD推出的一款基于 ARM Cortex-M4 内核的开发板,最高主频为 168Mhz,该开发板具有丰富的板载资源,可以充分发挥 STM32F407 的芯片性能。
18
19开发板外观如下图所示:
20
21![board](figures/board.png)
22
23该开发板常用 **板载资源** 如下:
24
25- MCU:STM32F407ZGT6,主频 168MHz,1024KB FLASH ,192KB RAM
26- 外部 FLASH:W25Q128(SPI,16MB)
27- 常用外设
28  - LED:2个,LED_R(红色,PF12),LED_B(绿色,PF11)
29  - 按键,4个,KEY_UP(兼具唤醒功能,PIN:PC5),KEY_DOWN(PIN:PC1),KEY_LEFT(PIN:PC0),KEY_RIGHT(PIN:PC4)
30- 常用接口:USB 转串口、SD 卡接口、USB SLAVE、USB HOST
31- 调试接口,标准ST-LINK
32
33开发板更多详细信息请参考官方文档 [STM32 星火一号开发板介绍](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/hw-board/spark-1/spark-1)34
35## 外设支持
36
37本 BSP 目前对外设的支持情况如下:
38
39| **板载外设** | **支持情况** |               **备注**                |
40| :------------ | :----------: | :-----------------------------------: |
41| USB 转串口(COM1) |     支持     |                                    |
42| COM2         |   支持  | 和以太网、PWM 冲突,如需使用该外设,请使用 CubeMX 重新配置 UART2 管脚 |
43| COM3         |  支持   |                                           |
44| **片上外设** | **支持情况** |               **备注**                |
45| UART         |     支持     |              UART1/2/3              |
46| SPI          |     支持     |               SPI1/2/3                |
47| ADC          |     支持     |                                       |
48| RTC          |     支持     | 支持外部晶振和内部低速时钟 |
49| WDT          |     支持     |                                       |
50
51
52
53## 使用说明
54
55使用说明分为如下两个章节:
56
57- 快速上手
58
59    本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
60
61- 进阶使用
62
63    本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
64
65
66### 快速上手
67
68本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
69
70**请注意!!!**
71
72在执行编译工作前请先打开ENV执行以下指令(该指令用于拉取必要的HAL库及CMSIS库,否则无法通过编译):
73
74```bash
75pkgs --update
76```
77
78#### 硬件连接
79
80使用数据线连接开发板到 PC,打开电源开关。
81
82#### 编译下载
83
84双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
85
86> 工程默认配置使用 JLink 下载程序,在通过 JLink 连接开发板的基础上,点击下载按钮即可下载程序到开发板
87
88#### 运行结果
89
90下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LED 常亮、绿色 LED 会周期性闪烁。
91
92连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
93
94```bash
95
96 \ | /
97- RT -     Thread Operating System
98 / | \     5.0.1 build Jul  4 2023 07:49:10
99 2006 - 2022 Copyright by RT-Thread team
100msh >
101```
102### 进阶使用
103
104此 BSP 默认只开启了 GPIO 和 串口1 的功能,如果需使用 SD 卡、Flash 等更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
105
1061. 在 bsp 下打开 env 工具。
107
1082. 输入`menuconfig`命令配置工程,配置好之后保存退出。
109
1103. 输入`pkgs --update`命令更新软件包。
111
1124. 输入`scons --target=mdk5/iar` 命令重新生成工程。
113
114本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。
115
116## 注意事项
117
118暂无
119
120## 联系人信息
121
122维护人:
123
124- [Supperthomas](https://github.com/supperthomas)
125

README_EN.md

1# STM32F407 RT-Thread Spark Board BSP Introduction
2
3## Overview
4
5This document is a description of the BSP (Board Support Package) provided by the RT-Thread development team for the STM32F407 RT-Thread Spark Board.
6
7The main contents are as follows:
8
9- Introduction of Development Board Resources
10- BSP Quick Start
11- Advanced Usage
12
13By reading Quick Start Section, developers can quickly get started with the BSP and run RT-Thread on the board. In the Advanced Usage Section, more advanced features will be introduced to help developers utilize RT-Thread to drive more on-board resources.
14
15## Spark-1 Introduction
16
17The STM32F407 is a development board based on the ARM Cortex-M4 core from RT-THREAD, with a maximum main frequency of 168Mhz. The board has a wealth of on-board resources, which can fully utilize the performance of the STM32F407 chip.
18
19The appearance of the board is shown in the figure below:
20
21![board](figures/board.png)
22
23The development board commonly used **on-board resources** as follows:
24
25- MCU: STM32F407ZGT6, 168MHz, 1024KB FLASH, 192KB RAM.
26- External FLASH: W25Q128 (SPI, 16MB)
27- Common Peripherals
28  - LEDs: 2, LED_R (red, PF12), LED_B (green, PF11)
29  - Keys, 4, KEY_UP (both wake-up function, PIN: PC5), KEY_DOWN (PIN: PC1), KEY_LEFT (PIN: PC0), KEY_RIGHT (PIN: PC4)
30- Common interfaces: USB to serial port, SD card interface, USB SLAVE, USB HOST
31- Debugging interface, standard ST-LINK
32
33For more details about the board, please refer to the official document [Introduction to STM32 Spark-1 Development Board](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/hw-board/spark-1/spark-1).
34
35
36## Peripheral Support
37
38The BSP currently supports the following peripherals:
39| **Onboard peripherals** | **Support** |               **note**               |
40| :------------ | :----------: | :-----------------------------------: |
41| USB to Serial(COM1) |     Support     |                                    |
42| COM2         |  Support  | Conflicts with Ethernet and PWM. Use CubeMX to reconfigure the UART2 pin if you want to use this peripheral. |
43| COM3         |  Support  |                                           |
44| **On-chip peripherals**              | **Supoort** |               **Note**               |
45| UART         |     Support     |              UART1/2/3              |
46| SPI          |     Support     |               SPI1/2/3                |
47| ADC          |     Support     |                                       |
48| RTC   | Support | Support external crystal and internal low-speed clock |
49| WDT          |     Support     |                                       |
50
51## Instructions for Use
52
53The instructions for use are divided into two sections as follows:
54
55- Quick Start
56
57  This section is intended for newcomers to RT-Thread. Follow the simple steps to get the RT-Thread operating system running on the board and see the results.
58
59- Advanced Usage
60
61  This section is for developers who want to use more of the board's resources with the RT-Thread operating system. By using the ENV tool to configure the BSP, you can enable more on-board resources and realize more advanced functions.
62
63### Quick Start
64
65This BSP provides developers with MDK5 and IAR projects and supports GCC development environment. The following is an example of how to get the system up and running using the MDK5 development environment.
66
67**Attention please!!!**
68
69Before the compilation work, please open ENV and execute the following command (this command is used to pull the necessary HAL library and CMSIS library, otherwise it cannot be compiled):
70
71```bash
72pkgs --update
73```
74
75#### Hardware Connection
76
77Connect the board to the PC with a cable and turn on the power switch.
78
79#### Compile and Download
80
81Double click the project.uvprojx file to open the MDK5 project, compile and download the program to the development board.
82
83> The default configuration of the project is to use JLink to download the program. On the basis of connecting the development board via JLink, click the Download button to download the program to the development board.
84
85#### Running Result
86
87After successfully downloading the program, the system will run automatically. Observe the running effect of the LED on the development board, where the red LED is always on, the green LED will blink periodically.
88
89Connect the corresponding serial port of the development board to PC, open the corresponding serial port (115200-8-1-N) in the terminal tool, and reset the device, you can see the output information of RT-Thread.
90
91
92
93```bash
94
95 \ | /
96- RT -     Thread Operating System
97 / | \     5.0.1 build Jul  4 2023 07:49:10
98 2006 - 2022 Copyright by RT-Thread team
99msh >
100```
101
102### Advanced Usage
103
104This BSP only enables GPIO and Serial1 by default. If you want to use more advanced functions such as SD card, Flash, etc., you need to configure the BSP by using ENV utility, the steps are as below:
105
1061. Open the env utility under bsp.
107
1082. Input `menuconfig` command to configure the project, save and exit after configuration.
109
1103. Enter the `pkgs --update` command to update the package.
111
1124. Enter the `scons --target=mdk5/iar` command to regenerate the project.
113
114For a more detailed description of this chapter, please refer to [STM32 Series BSP Peripheral Driver Tutorial](... /docs/STM32 Series BSP Peripheral Driver Tutorial.md).
115
116## Notes
117
118Not available at this time
119
120## Connection
121
122Maintainer:
123
124- [Supperthomas](https://github.com/supperthomas)
125
126
127
128