[RTduino][stm32f410-nucleo] add English readme
This commit is contained in:
parent
120595d371
commit
baac8760a5
@ -4,7 +4,7 @@
|
||||
|
||||
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
|
||||
|
||||
STM32F401 Nucleo board has support [RTduino](https://github.com/RTduino/RTduino). Users can use Arduino APIs, third party libraries and programming method to program on Blue Pill board.
|
||||
STM32F401 Nucleo board has support [RTduino](https://github.com/RTduino/RTduino). Users can use Arduino APIs, third party libraries and programming method to program on the board.
|
||||
|
||||
### 1.1 How to Enable RTduino
|
||||
|
||||
|
@ -22,33 +22,33 @@ Hardware Drivers Config --->
|
||||
|
||||
该BSP遵照Arduino UNO板的引脚排列方式,详见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
|
||||
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| ----------- | --------- | ---- | --------------------------------------------- |
|
||||
| 0 (D0) | PA3 | 是 | Serial-Rx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 1 (D1) | PA2 | 是 | Serial-Tx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 2 (D2) | PA10 | 是 | |
|
||||
| 3 (D3) | PB3 | 是 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 4 (D4) | PB5 | 是 | |
|
||||
| 5 (D5) | PB4 | 是 | PWM3-CH1,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 6 (D6) | PB10 | 是 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 7 (D7) | PA8 | 是 | |
|
||||
| 8 (D8) | PA9 | 是 | |
|
||||
| 9 (D9) | PC7 | 是 | PWM3-CH2,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 10 (D10) | PB6 | 是 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 |
|
||||
| 11 (D11) | PA7 | 是 | PWM1-CH1N,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 12 (D12) | PA6 | 是 | |
|
||||
| 13 (D13, ) | PA5 | 是 | 板载用户LED |
|
||||
| 14 (D14) | PB9 | 是 | I2C-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 15 (D15) | PB8 | 是 | I2C-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 16 (D16) | PC13 | 是 | 用户按键(左侧蓝色) |
|
||||
| A0 | PA0 | 是 | ADC1-CH0,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A1 | PA1 | 是 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A2 | PA4 | 是 | ADC1-CH4,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A3 | PB0 | 是 | ADC1-CH8,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A4 | PC1 | 是 | ADC1-CH11,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A5 | PC0 | 是 | ADC1-CH10,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A6 | -- | | 芯片内部参考电压 ADC1-CH17,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A7 | -- | | 芯片内部温度 ADC1-CH16,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| --------------------- | --------- | ---- | --------------------------------------------- |
|
||||
| 0 (D0) | PA3 | 是 | Serial-Rx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 1 (D1) | PA2 | 是 | Serial-Tx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 2 (D2) | PA10 | 是 | |
|
||||
| 3 (D3) | PB3 | 是 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 4 (D4) | PB5 | 是 | |
|
||||
| 5 (D5) | PB4 | 是 | PWM3-CH1,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 6 (D6) | PB10 | 是 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 7 (D7) | PA8 | 是 | |
|
||||
| 8 (D8) | PA9 | 是 | |
|
||||
| 9 (D9) | PC7 | 是 | PWM3-CH2,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 10 (D10) | PB6 | 是 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 |
|
||||
| 11 (D11) | PA7 | 是 | PWM1-CH1N,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 12 (D12) | PA6 | 是 | |
|
||||
| 13 (D13, LED_BUILTIN) | PA5 | 是 | 板载用户LED |
|
||||
| 14 (D14) | PB9 | 是 | I2C-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 15 (D15) | PB8 | 是 | I2C-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 16 (D16) | PC13 | 是 | 用户按键(左侧蓝色) |
|
||||
| A0 | PA0 | 是 | ADC1-CH0,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A1 | PA1 | 是 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A2 | PA4 | 是 | ADC1-CH4,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A3 | PB0 | 是 | ADC1-CH8,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A4 | PC1 | 是 | ADC1-CH11,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A5 | PC0 | 是 | ADC1-CH10,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A6 | -- | | 芯片内部参考电压 ADC1-CH17,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A7 | -- | | 芯片内部温度 ADC1-CH16,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
|
||||
> 注意:
|
||||
>
|
||||
|
@ -0,0 +1,73 @@
|
||||
# The Arduino Compatible for STM32F410 Nucleo Board
|
||||
|
||||
**English** | [中文](README_zh.md)
|
||||
|
||||
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
|
||||
|
||||
STM32F410 Nucleo board has support [RTduino](https://github.com/RTduino/RTduino). Users can use Arduino APIs, third party libraries and programming method to program on the board.
|
||||
|
||||
### 1.1 How to Enable RTduino
|
||||
|
||||
Please go to the [RTduino repository](https://github.com/RTduino/RTduino) to see the details.
|
||||
|
||||
```Kconfig
|
||||
Hardware Drivers Config --->
|
||||
Onboard Peripheral Drivers --->
|
||||
[*] Compatible with Arduino Ecosystem (RTduino)
|
||||
```
|
||||
|
||||
# 2 Arduino Pinout
|
||||
|
||||
![nucleo-f410-pinout](nucleo-f410-pinout.png)
|
||||
|
||||
This board complies with Arduino UNO pins layout. For more details, please take a look at: [pins_arduino.c](pins_arduino.c) and [pins_arduino.h](pins_arduino.h).
|
||||
|
||||
| Arduino Pin | STM32 Pin | 5V Tolerate | Note |
|
||||
| --------------------- | --------- | ----------- | --------------------------------------------------------------------------------------------- |
|
||||
| 0 (D0) | PA3 | Yes | Serial-Rx. Token over by RT-Thread UART device by default |
|
||||
| 1 (D1) | PA2 | Yes | Serial-Tx. Token over by RT-Thread UART device by default |
|
||||
| 2 (D2) | PA10 | Yes | PWM1-CH3. Token over by RT-Thread PWM device by default |
|
||||
| 3 (D3) | PB3 | Yes | |
|
||||
| 4 (D4) | PB5 | Yes | |
|
||||
| 5 (D5) | PB4 | Yes | |
|
||||
| 6 (D6) | PB10 | Yes | |
|
||||
| 7 (D7) | PA8 | Yes | |
|
||||
| 8 (D8) | PA9 | Yes | PWM1-CH2. Token over by RT-Thread PWM device by default |
|
||||
| 9 (D9) | PC7 | Yes | |
|
||||
| 10 (D10) | PB6 | Yes | |
|
||||
| 11 (D11) | PA7 | Yes | PWM1-CH1N. Token over by RT-Thread PWM device by default |
|
||||
| 12 (D12) | PA6 | Yes | |
|
||||
| 13 (D13, LED_BUILTIN) | PA5 | Yes | USER LED |
|
||||
| 14 (D14) | PB9 | Yes | I2C-SDA. Token over by RT-Thread I2C device by default |
|
||||
| 15 (D15) | PB8 | Yes | I2C-SCL. Token over by RT-Thread I2C device by default |
|
||||
| 16 (D16) | PC13 | Yes | USER Button |
|
||||
| A0 | PA0 | Yes | ADC1-CH0. Token over by RT-Thread ADC device by default |
|
||||
| A1 | PA1 | Yes | ADC1-CH1. Token over by RT-Thread ADC device by default |
|
||||
| A2 | PA4 | Yes | ADC1-CH4. Token over by RT-Thread ADC device by default |
|
||||
| A3 | PB0 | Yes | ADC1-CH8. Token over by RT-Thread ADC device by default |
|
||||
| A4 | PC1 | Yes | ADC1-CH11. Token over by RT-Thread ADC device by default |
|
||||
| A5 | PC0 | Yes | ADC1-CH10. Token over by RT-Thread ADC device by default |
|
||||
| A6 | -- | | On-chip internal voltage sensor. ADC1-CH17. Token over by RT-Thread ADC device by default |
|
||||
| A7 | -- | | On-chip internal temperature sensor. ADC1-CH16. Token over by RT-Thread ADC device by default |
|
||||
|
||||
> Notice:
|
||||
>
|
||||
> 1. Don't use a same hardware timer to drive PWM (analogRead) and servos at same time, because hardware timers can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
|
||||
|
||||
> References
|
||||
>
|
||||
> 1. [STM32 Nucleo-64 user manual](https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf)
|
||||
|
||||
## 3 Communication
|
||||
|
||||
### 3.1 I2C Bus
|
||||
|
||||
I2C bus is `SCL/D15` and `SDA/D14` pins. Users can directly include the `#include <Wire.h>`, which is the Arduino official I2C header file, to use the I2C bus.
|
||||
|
||||
### 3.2 SPI Bus
|
||||
|
||||
This board doesn't support Arduino SPI header file and functions.
|
||||
|
||||
### 3.3 Serial
|
||||
|
||||
This board supports to use `Serial.` method to operate `uart2` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
|
@ -18,47 +18,47 @@ Hardware Drivers Config --->
|
||||
|
||||
## 2 Arduino引脚排布
|
||||
|
||||
![nucleo-f401-pinout](nucleo-f410-pinout.png)
|
||||
![nucleo-f410-pinout](nucleo-f410-pinout.png)
|
||||
|
||||
该BSP遵照Arduino UNO板的引脚排列方式,详见 [pins_arduino.c](https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.c) 和 [pins_arduino.h](https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h)。
|
||||
该BSP遵照Arduino UNO板的引脚排列方式,详见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
|
||||
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| --------------- | ------------- | ------ | ------------------------------------------------------------ |
|
||||
| 0 (D0) | PA3 | 是 | Serial-Rx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 1 (D1) | PA2 | 是 | Serial-Tx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 2 (D2) | PA10 | 是 | PWM1-CH3,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 3 (D3) | PB3 | 是 | |
|
||||
| 4 (D4) | PB5 | 是 | |
|
||||
| 5 (D5) | PB4 | 是 | |
|
||||
| 6 (D6) | PB10 | 是 | |
|
||||
| 7 (D7) | PA8 | 是 | |
|
||||
| 8 (D8) | PA9 | 是 | PWM1-CH2,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 9 (D9) | PC7 | 是 | |
|
||||
| 10 (D10) | PB6 | 是 | |
|
||||
| 11 (D11) | PA7 | 是 | PWM1-CH1N,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 12 (D12) | PA6 | 是 | |
|
||||
| 13 (D13, ) | PA5 | 是 | 板载用户LED |
|
||||
| 14 (D14) | PB9 | 是 | I2C-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 15 (D15) | PB8 | 是 | I2C-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 16 (D16) | PC13 | 是 | 用户按键(左侧蓝色) |
|
||||
| A0 | PA0 | 是 | ADC1-CH0,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A1 | PA1 | 是 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A2 | PA4 | 是 | ADC1-CH4,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A3 | PB0 | 是 | ADC1-CH8,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A4 | PC1 | 是 | ADC1-CH11,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A5 | PC0 | 是 | ADC1-CH10,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A6 | -- | | 芯片内部参考电压 ADC1-CH17,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A7 | -- | | 芯片内部温度 ADC1-CH16,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| --------------------- | --------- | ---- | --------------------------------------------- |
|
||||
| 0 (D0) | PA3 | 是 | Serial-Rx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 1 (D1) | PA2 | 是 | Serial-Tx,默认被RT-Thread的UART设备框架uart2接管 |
|
||||
| 2 (D2) | PA10 | 是 | PWM1-CH3,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 3 (D3) | PB3 | 是 | |
|
||||
| 4 (D4) | PB5 | 是 | |
|
||||
| 5 (D5) | PB4 | 是 | |
|
||||
| 6 (D6) | PB10 | 是 | |
|
||||
| 7 (D7) | PA8 | 是 | |
|
||||
| 8 (D8) | PA9 | 是 | PWM1-CH2,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 9 (D9) | PC7 | 是 | |
|
||||
| 10 (D10) | PB6 | 是 | |
|
||||
| 11 (D11) | PA7 | 是 | PWM1-CH1N,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 12 (D12) | PA6 | 是 | |
|
||||
| 13 (D13, LED_BUILTIN) | PA5 | 是 | 板载用户LED |
|
||||
| 14 (D14) | PB9 | 是 | I2C-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 15 (D15) | PB8 | 是 | I2C-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管 |
|
||||
| 16 (D16) | PC13 | 是 | 用户按键(左侧蓝色) |
|
||||
| A0 | PA0 | 是 | ADC1-CH0,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A1 | PA1 | 是 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A2 | PA4 | 是 | ADC1-CH4,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A3 | PB0 | 是 | ADC1-CH8,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A4 | PC1 | 是 | ADC1-CH11,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A5 | PC0 | 是 | ADC1-CH10,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A6 | -- | | 芯片内部参考电压 ADC1-CH17,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| A7 | -- | | 芯片内部温度 ADC1-CH16,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
|
||||
> 注意:
|
||||
>
|
||||
>
|
||||
> 1. 驱动舵机和analogWrite函数要选择不同定时器发生的PWM信号引脚,由于STM32的定时器4个通道需要保持相同的频率,如果采用相同的定时器发生的PWM分别驱动舵机和analogWrite,可能会导致舵机失效。
|
||||
> 2. USART2是Nucleo板的默认串口,理论应对接到了Arduino引脚编号的D0和D1,但是其实际用于串口通信,因此不允许当做普通IO来使用和操作。如果需要将D0、D1与STM32 USART2的引脚相连,需要手动焊接锡桥SB62、SB63。
|
||||
> 3. Nucleo板的Arduino接口中AVDD(即AREF)默认是与VDD相连的,如果需要扩展板提供外部参考电压,需要将SB57锡桥挑开。
|
||||
> 4. D11引脚是PWM反相位引脚(互补输出引脚),但是这里不用考虑到占空比互补问题(CHx-20%,CHxN-80%),直接正常使用即可。
|
||||
|
||||
> 参考资料
|
||||
>
|
||||
>
|
||||
> 1. [STM32 Nucleo-64板用户手册](https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf)
|
||||
|
||||
## 3 通信
|
||||
|
Loading…
x
Reference in New Issue
Block a user