README.md
1# NXP MIMXRT1060-EVK BSP Introduction
2
3**英文** | [中文](README_zh.md)
4
5This document records the instruction of the BSP (board support package) that provided by the RT-Thread development team for the MIMXRT1060-EVK development board.
6
7The document is covered in three parts:
8
9- Resources Introduction
10- Quickly Get Started
11- Advanced Features
12
13By 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.
14
15## 1 Resources Introduction
16
17[](https://github.com/RT-Thread/rt-thread/blob/master/bsp/imxrt/imxrt1060-nxp-evk/figures/MIMXRT1060EVKB.jpg)
18
19Features:
20
21- MCU: MIMXRT1062DVL6A, 600MHz, 4096KB FLASH, 1024KB RAM
22- External RAM: IS42S16160J-6BLI, 32MB
23- External FLASH: S26KS512SDPBHI02, 64MB
24- Common-used Peripherals:
25 - LED: One, D18(Green)
26 - Button: One
27- Common-used Interfaces: USB 、SD Card、Ethernet、LCD, etc
28- Debugging interface, standard JTAG/SWD
29
30### 1.1 For more details about these boards, please refer to [NXP Official Website](https://www.nxp.com/part/MIMXRT1060-EVK#/)
31
32
33
34
35
36### 1.2 Peripherals Condition
37
38Each peripheral supporting condition for this BSP is as follows:
39
40| **On-board Peripherals** | **Support** | **Remark** |
41| ------------------------ | ----------- | ------------------------------------- |
42| USB | √ | |
43| SPI Flash | √ | |
44| Ethernet | √ | |
45| **On-chip Peripherals** | **Support** | **Remark** |
46| GPIO | √ | PA0, PA1... PK15 ---> PIN: 0, 1...176 |
47| UART | √ | UART1 |
48| SPI | | Coming Soon |
49| I2C | | Coming Soon |
50| SDIO | | Coming Soon |
51| RTC | | Coming Soon |
52| PWM | | Coming Soon |
53| USB Device | | Coming Soon |
54| USB Host | | Coming Soon |
55| IWG | | Coming Soon |
56| **Expansion Module** | **Support** | **Remark** |
57| LVGL | √ | |
58
59### 1.3 Quickly Get Started
60
61This BSP provides MDK4, MDK5, and IAR projects for developers and it supports the GCC development environment. Here's an example of the MDK5 development environment, to introduce how to run the system.
62
63Then, the necessary libraries should be pulled; otherwise, the compilation will fail.
64
65```bash
66 pkgs --update
67```
68
69### 1.4 Hardware Connection
70
71Use a cable to connect the development board to the PC and turn on the power switch.
72
73### 1.5 Compile and Download
74
75Double-click the `project.uvprojx` file to open the MDK5 project, compile and download the program to the development board.
76
77> The project defaults to use the CMSIS-DAP emulator to download the program, and as we're connecting the development board via USB, click the Download button can directly download the program to the development board
78
79### 1.6 Running Results
80
81After the program is successfully downloaded, the system runs automatically. Observe the running results of the LED on the development board, the LED will light in 1Hz.
82
83Connect the corresponding serial port of the development board to the PC, and when the corresponding serial port ( 115200-8-1-N) is opened in the terminal tool, the output information of RT-Thread can be seen when the device is reset:
84
85```
86 \ | /
87- RT - Thread Operating System
88 / | \ 4.1.0 build Mar 10 2022 18:07:41
89 2006 - 2022 Copyright by RT-Thread team
90msh >
91```
92
93### 1.7 **Advanced Features**
94
95This BSP only enables GPIO and UART1 by default. If you need more advanced features such as SD Card, Flash, or you need to configure the BSP with RT-Thread homegrown [ENV tool](https://www.rt-thread.io/download.html?download=Env), as follows:
96
971. Open the ENV tool under the specific BSP folder;
982. Enter `menuconfig` command to configure the project, then save and exit;
993. Enter `pkgs --update` command to update the package;
1004. Enter `scons --target=mdk4/mdk5/iar` command to regenerate the project.
101
102More details about NXP MIMXRT1060-EVK , check out [Here](https://github.com/RT-Thread/rt-thread/blob/master/bsp/imxrt/docs/IMXRT%E7%B3%BB%E5%88%97BSP%E5%A4%96%E8%AE%BE%E9%A9%B1%E5%8A%A8%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B.md).
103
104## 2 MIMXRT1060-EVK User Manual
105
106This manual records the execution instruction of the MIMXRT1060-EVK on RT-Thread homebuilt IDE RT-Thread Studio.
107
108### 2.1 Preparation
109
110- Clone the RT-Thread repository from GitHub to your local. [Link](https://github.com/RT-Thread/rt-thread)
111- Download and install RT-Thread Studio. [Link](https://www.rt-thread.io/studio.html)
112- Prepare the [RW007](https://github.com/RT-Thread-packages/rw007/blob/master/README.md) module.
113
114### 2.2 Quickly Get Started
115
116#### 2.2.1 menuconfig to configure the project
117
118Open the directory where the MIMXRT1060-EVK BSP is located and use the menuconfig command in the [ENV tool](https://www.rt-thread.io/download.html?download=Env) to configure the project
119
120
121
122#### 2.2.2 Cancel the configuration that is not needed, as follows:
123
124Set the Onboard Peripheral Drivers option:
125
126
127
128Set the On-chip Peripheral Drivers option:
129
130
131
132### 2.3 Go to File, and click the Import
133
134
135
136### 2.4 Import RT-Thread BSP to workspace
137
138
139
140### 2.5 Fill out the project info
141
142
143
144### 2.6 Compile project
145
146
147
148Till now, the project is compiled, and the preparation is completed.
149
150## 3 Use RT-Studio to Configure BSP Driver
151
152Each BSP of RT-Thread already has several drivers by default, such as on-chip peripheral driver and on-board peripheral driver, and the drivers can be enabled by opening the corresponding configuration and setting the parameters according to the use environment on RT-Studio IDE. Since the pin has the multiplexing function, it may not have both the available on-chip peripheral driver and on-board peripheral driver at the same time, so it is necessary to check the schematic while enabling the corresponding peripheral drivers.
153
154RT-Thread has a lot of up-for-grab software packages, by using RT-Studio IDE, the software packages can be easily added to the project.
155
156
157
158## 4 Connect to Internet: Use the RW007 module
159
160The RW007 is a high-speed WIFI module that uses SPI to communicate with the host. Check the [User Manual](https://github.com/RT-Thread-packages/rw007/blob/master/README.md).
161
162The SPI interface provided by the MIMXRT1060-EVK onboard Arduino interface has duplicate pins with the pins used by the SDIO interface of the SD card, so the on-board SPI interface is not connected by default. We'll be needing you to connect it, check out the location marked DNP in the schematic diagram below (this step is necessary when using the SPI interface). You can use the SPI interface led by the onboard Arduino interface, in this case, the on-board SD card slot is not available.
163
164
165
166Solder works must be done before next step:
167
168
169### 4.1 Configure the onboard SPI peripherals
170
171RW007 supports SPI interface for communication, MIMXRT1060-EVK supports SPI driver, defaults to using polling mode to communicate with RW007 (currently it does not support interrupt and DMA mode to communicate with RW007), the following shows how to use RT-Studio to configure SPI:
172
173
174
175### 4.2 Configure the RW007 package using RT-Studio
176
177Click the RT-Thread Settings option on the left, there is a configuration menu will be shown on the right, enter RW007 in the search bar, and select `rw007:SPI WIFI rw007 driver`, the corresponding configuration parameters are as follows:
178
179
180
181### 4.3 Plug the RW007 module into the onboard Arduino interface
182
183
184
185### 4.4 Modify the RW007 example
186RW007 has been ported into IMXRT1062 platform, the port file is at: `board/ports/rw007_port.c`, Once we select RW007 package, it will join into our project automatically, there is no need to modify any code for simply turn on this module.
187
188### 4.5 After the modification is completed, compile the project and burn the firmware
189
190
191
192`rw007 sn` and `rw007 ver` are successfully output, and RW007 driver is successfully connected.
193
194### 4.6 WIFI connection test
195
196Enter the `wifi scan` command into the shell to search for WIFI.
197
198
199
200Enter `wifi` and press `tab` to list wifi-related commands:
201
202
203
204Use the ping command to test if the WIFI connection is available:
205
206
207
208At this point, the basic environment of the MIMXRT1060-EVK is successfully set up!