RT-Thread lights up
Presumably for students who have just started to learn single-chip microcomputers, the first step is mostly to light up an LED light, which is regarded as the "Hello world" of embedded learning, so we start formal learning by lighting the LED light.
1. Introduction of STM32L475 board
The commonly used onboard resources of the development board are as follows:
- MCU: STM32L475, main frequency 80MHz, 512KB FLASH, 128KB SRAM
- External FLASH: W25Q128 (SPI, 128Mbit)
- Common peripherals
- RGB LED: 1, (R connects to PE7, G connects to PE8, B connects to PE9)
- Keys: 4, WK_UP (with wake-up function, PC13), KEY0 (PD8), KEY1 (PD9), KEY2 (PD10)
- Commonly used interfaces: WIRELESS module interface, TF card interface, USB serial port, USB OTG interface, earphone interface
- Debug interface, onboard ST-LINK download.
This board has rich resources and high integration, which is convenient for beginners to learn. (Non-advertisement)
Not much to say, let's start!
Two, coding
How to obtain IoT Board SDK: from Github or from Gitee . The directory structure of the SDK is as follows:
name | illustrate |
---|---|
docs | Documentation |
drivers | Development board driver file |
examples | sample program |
libraries | Library file |
rt-thread | rt-thread source code |
tools | Tool Catalog |
Environment preparation:
- Keil MDK development environment (MDK-ARM 5.24, 5.14 and above versions are acceptable)
- Use the ST-LINK on the board to connect to the PC.
- Compile the program in MDK5 and download it to the development board.
Press the reset button to restart the development board and observe the actual effect of RBG-LED on the development board. After normal operation, the red LED will flash periodically, as shown in the figure below:
RGB red light flashes periodically