1# STM32MP157A-DK1 BSP Introduction
2
3[中文页](README_zh.md) |
4
5## Introduction
6
7This document records the execution instruction of the BSP (board support package) provided by the RT-Thread development team for the STM32MP157A-DK1 development board.
8
9The document is covered in three parts:
10
11- STM32MP157A-DK1 Board Resources Introduction
12
13- Quickly Get Started
14
15- Advanced Features
16
17By reading the Quickly Get Started section developers can quickly get their hands on this BSP and run RT-Thread on the board. More advanced features will be introduced in the Advanced Features section to help developers take advantage of RT-Thread to drive more on-board resources.
18
19## STM32MP157A-DK1 Board Resources Introduction
20
21The STM32MP157A-DK1 is a development board based on a dual Cortex-A7 and Cortex-M4 core. The Cortex-A7 core operates at 800 MHZ and the Cortex-M4 operates at 209MHZ. There is no Flash inside the STM32MP157A.
22
23  ![board](figures/board.png)
24
25The mainly-used **on-board resources** are shown as follows:
26
27- MCU : STM32MP157AACx
28- Common peripherals:
29  - 4 LEDs: LD4(PA14), LD6(PA13), LD7(PH7), LD8(PD11)
30  - 4 Buttons:  WAKE_UP, RESET (NRST), USER1(PA14), USER2 (PA13)
31- Common-used interface: USB, SD card, Ethernet, MIPI, USB HOST, Audio, HDMI, Arduino.
32- Debug interface: Standard JTAG/SWD.
33
34For more details about this board, please refer to the ST official documentation: [STM32MP157A-DK1 Development board introduction](https://www.st.com/content/st_com/zh/products/evaluation-tools/product-evaluation-tools/mcu-mpu-eval-tools/stm32-mcu-mpu-eval-tools/stm32-discovery-kits/stm32mp157a-dk1.html)
35
36## Peripheral Condition
37
38Each peripheral supporting condition for this BSP is as follows:
39
40| On-board Peripheral            | **Support** |     **Remark**     |
41| :----------------------------- | :---------: | :----------------: |
42| USB TO UART                    |     YES     |                    |
43| PWR                            |     YES     |                    |
44| RCC                            |     YES     |                    |
45| SD Card (SDMMC)                |     NO      |                    |
46| ETH                            |     NO      |                    |
47| AUDIO                          |     NO      |                    |
48| **On-chip Peripheral Drivers** | **Support** |     **Remark**     |
49| GPIO                           |     YES     | GPIOA-GPIOK, GPIOZ |
50| UART                           |     YES     |  UART4 (ST-Link)   |
51| EXTI                           |     YES     |                    |
52| SPI                            |     YES     |                    |
53| TIM                            |     YES     |                    |
54| LPTIM                          |     YES     |                    |
55| I2C                            |     YES     |      Software      |
56| ADC                            |     YES     |                    |
57| DAC                            |     YES     |                    |
58| WWDG                           |     YES     |                    |
59
60## Execution Instruction
61
62### Quickly Get Started
63
64This BSP provides IAR projects for developers. Here's an example of the IAR development environment, to introduce how to run the system.
65
66#### Hardware Connection
67
68Use a USB cable to connect the development board to the PC and turn on the power switch.
69
70#### Compile And Download
71
72Double-click the project.eww file, to open the IAR project, compile and download the program to the board.
73
74> By default, the project uses ST_LINK simulator to download the program, when the ST_LINK connects the board, clicking the download button can download the program to the board.
75
76#### Running Results
77
78After the program is successfully downloaded, the system runs automatically. Observe the running results of the LED on the development board, the blue LD8 will flash periodically.
79
80Connect the serial port of the board to PC, communicate with it via a serial terminal tool (115200-8-1-N). Restart the board and the startup information of RT-Thread will be observed:
81
82```c
83 \ | /
84- RT -     Thread Operating System
85 / | \     3.1.1 build Nov 19 2018
86 2006 - 2018 Copyright by rt-thread team
87msh >
88```
89
90### Advanced Features
91
92This BSP only enables GPIO and serial port 4 by default. If need more advanced features, you need to configure the BSP with RT-Thread Env tools, as follows:
93
94- Open the [Env](https://www.rt-thread.io/download.html?download=Env) tool under this BSP;
95- Enter the `menuconfig` command to configure the project, then save and exit;
96- Enter the  `pkgs --update` command to update the packages;
97- Enter the `scons --target=iar` command to regenerate the  project.
98
99## Notes
100
101- Before downloading the program, set the board to the mode of "Engineering Mode".  The BOOT switch sets to BOOT0=0 and BOOT2=1, as shown below:
102
103  ![boot](figures/boot_switch.png)
104
105- If need to reburn the program, please reset the development board.
106
107## Contact Information
108
109accendant:
110
111- [liukang](https://github.com/thread-liu)
112