## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
### 1.1 如何开启针对本BSP的Arduino生态兼容层
STM32F072 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.
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
### 1.1 How to Enable RTduino
Please go to the [RTduino repository](https://github.com/RTduino/RTduino) to see the details.
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).
> 1. Don't use a same hardware timer to drive PWM (analogRead) and servos at same time, because hardware timer can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
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总线
### 3.2 SPI Bus
目前本BSP不支持使用Arduino的SPI功能。
This board doesn't support Arduino SPI header file and functions.
This board supports to use `Serial.` method to operate `uart2` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
# The Arduino Compatible for STM32F103 Blue Pill Board
**English** | [中文](README_zh.md)
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
STM32 Blue Pill 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.
STM32 Blue Pill 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
...
...
@@ -18,9 +18,11 @@ Hardware Drivers Config --->
## 2 Arduino Pinout
For more information, please see [pins_arduino.c](pins_arduino.c) and [pins_arduino.h](pins_arduino.h).
| 8 (D8, LED_BUILTIN) | PC13 | No | Build-in LED |
| 8 (D8, LED_BUILTIN) | PC13 | No | USER LED |
| 9 (D9) | PC14 | No | |
| 10 (D10) | PC15 | No | |
| 11 (D11) | PA0 | No | |
...
...
@@ -40,12 +42,12 @@ Hardware Drivers Config --->
| 15 (D15) | PB8 | Yes | I2C-SCL. Token over by RT-Thread I2C device by default |
| 16 (D16) | PA12 | Yes | USB-DP. Token over by [TinyUSB](https://github.com/RT-Thread-packages/tinyusb) software package by default. |
| 17 (D17) | PA11 | Yes | USB-DM. Token over by [TinyUSB](https://github.com/RT-Thread-packages/tinyusb) software package by default. |
| 18 (D18) | PA10 | Yes | Serial-Rx. Token over by RT-Thread UART device by default |
| 19 (D19) | PA9 | Yes | Serial-Tx. Token over by RT-Thread UART device by default |
| 20 (D20) | PA2 | No | Serial2-Tx. Token over by RT-Thread UART device by default |
| 21 (D21) | PA3 | No | Serial2-Rx. Token over by RT-Thread UART device by default |
| 22 (D22) | PB10 | Yes | Serial3-Tx. Token over by RT-Thread UART device by default |
| 23 (D23) | PB11 | Yes | Serial3-Rx. Token over by RT-Thread UART device by default |
| 18 (D18) | PA10 | Yes | Serial-Rx. Token over by RT-Thread UART device by default |
| 19 (D19) | PA9 | Yes | Serial-Tx. Token over by RT-Thread UART device by default |
| 20 (D20) | PA2 | No | Serial2-Tx. Token over by RT-Thread UART device by default |
| 21 (D21) | PA3 | No | Serial2-Rx. Token over by RT-Thread UART device by default |
| 22 (D22) | PB10 | Yes | Serial3-Tx. Token over by RT-Thread UART device by default |
| 23 (D23) | PB11 | Yes | Serial3-Rx. Token over by RT-Thread UART device by default |
| 24 (D24) | PB15 | Yes | SPI-MOSI. Token over by RT-Thread SPI device by default |
| 25 (D25) | PB14 | Yes | SPI-MISO. Token over by RT-Thread SPI device by default |
| 26 (D26) | PB13 | Yes | SPI-SCK. Token over by RT-Thread SPI device by default |
...
...
@@ -57,10 +59,9 @@ Hardware Drivers Config --->
| 32 (A5) | -- | | ADC of chip internal reference voltage. Token over by RT-Thread ADC device by default |
| 33 (A6) | -- | | ADC of chip internal temperature. Token over by RT-Thread ADC device by default |
> Note:
> Notice:
>
> 1. If you drive the servo and call the analogWrite function at the same time, you need to select the PWM signal pins generated by different timers. Since the 4 channels of the STM32 timer need to maintain the same frequency, if the PWM generated by the same timer is used to drive the servo and analogWrite respectively , it may cause the servo to fail.
> 2. More information about Arduino pinout, please see [pins_arduino.c](pins_arduino.c) and [pins_arduino.h](pins_arduino.h)
> 1. Don't use a same hardware timer to drive PWM (analogRead) and servos at same time, because hardware timer can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
## 3 Communication
...
...
@@ -72,10 +73,17 @@ I2C bus is `D14` and `D15` pins. Users can directly include the `#include <Wire.
SPI bus is `D24`, `D25` and `D26` pins. Users can directly include the `#include <SPI.h>`, which is the Arduino official SPI header file, to use the SPI bus. In addition, chip select pin (SS) also is used, which is `D7` by default.
### 3.3 USB
### 3.3 Serial
This board supports to use `Serial.` method to operate `uart1` device; use `Serial2.` method to use `uart2` device; use `Serial3.` method to use `uart3` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
This board supports USB virtual COM by default. See [example](https://github.com/RTduino/RTduino/tree/master/examples/USBSerial).
### 3.4 USB Virtual Serial
### 3.4 Serial
This board supports USB virtual serial. See [example](https://github.com/RTduino/RTduino/tree/master/examples/USBSerial). You may enable it if is needed.
This board supports to use `Serail.` method to use `uart1` device; use `Serial2.` method to use `uart2` device; use `Serial3.` method to use `uart3` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
### 1.1 如何开启针对本BSP的Arduino生态兼容层
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.
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
### 1.1 How to Enable RTduino
Please go to the [RTduino repository](https://github.com/RTduino/RTduino) to see the details.
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).
> 1. Don't use a same hardware timer to drive PWM (analogRead) and servos at same time, because hardware timer can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
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总线
### 3.2 SPI Bus
目前本BSP不支持使用Arduino的SPI功能。
This board doesn't support Arduino SPI header file and functions.
This board supports to use `Serial.` method to operate `uart2` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
### 1.1 如何开启针对本BSP的Arduino生态兼容层
STM32F412 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.
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
### 1.1 How to Enable RTduino
Please go to the [RTduino repository](https://github.com/RTduino/RTduino) to see the details.
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).
> 1. Don't use a same hardware timer to drive PWM (analogRead) and servos at same time, because hardware timer can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
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总线
### 3.2 SPI Bus
目前本BSP不支持使用Arduino的SPI功能。
This board doesn't support Arduino SPI header file and functions.
This board supports to use `Serial.` method to operate `uart3` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
### 1.1 如何开启针对本BSP的Arduino生态兼容层
STM32F469 Discovery 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.
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
### 1.1 How to Enable RTduino
Please go to the [RTduino repository](https://github.com/RTduino/RTduino) to see the details.
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).
| 0 (D0) | PG9 | Yes | Serial-Rx. Token over by RT-Thread UART device by default |
| 1 (D1) | PG14 | Yes | Serial-Tx. Token over by RT-Thread UART device by default |
| 2 (D2) | PG13 | Yes | |
| 3 (D3) | PA1 | Yes | PWM2-CH2. Token over by RT-Thread PWM device by default |
| 4 (D4) | PG12 | Yes | |
| 5 (D5) | PA2 | Yes | PWM2-CH3. Token over by RT-Thread PWM device by default |
| 6 (D6) | PA6 | Yes | PWM3-CH1. Token over by RT-Thread PWM device by default |
| 7 (D7) | PG11 | Yes | |
| 8 (D8) | PG10 | Yes | |
| 9 (D9) | PA7 | Yes | PWM3-CH2. Token over by RT-Thread PWM device by default |
| 10 (D10) | PH6 | Yes | PWM12-CH1. Token over by RT-Thread PWM device by default |
| 11 (D11) | PB15 | Yes | PWM12-CH2. Token over by RT-Thread PWM device by default |
| 12 (D12) | PB14 | Yes | |
| 13 (D13, ) | PD3 | Yes | USER LED1 |
| 14 (D14) | PB9 | Yes | I2C1-SDA. Token over by RT-Thread I2C device by default |
| 15 (D15) | PB8 | Yes | I2C1-SCL. Token over by RT-Thread I2C device by default |
| 16 (D16) | PA0 | Yes | USER Button |
| 17(D17) | PG6 | Yes | USER LED2 |
| 18(D18) | PD4 | Yes | USER LED3 |
| 19(D19) | PD5 | Yes | USER LED4 |
| 20(D20) | PK3 | Yes | USER LED5 |
| A0 | PB1 | Yes | ADC1-CH9. Token over by RT-Thread ADC device by default |
| A1 | PC2 | Yes | ADC1-CH12. Token over by RT-Thread ADC device by default |
| A2 | PC3 | Yes | ADC1-CH13. Token over by RT-Thread ADC device by default |
| A3 | PC4 | Yes | ADC1-CH14. Token over by RT-Thread ADC device by default |
| A4 | PC5 | Yes | ADC1-CH15. Token over by RT-Thread ADC device by default |
| A5 | PA4 | Yes | ADC1-CH4. 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 timer can only generate a same frequency for 4 PWM channels. Otherwise, it could cause a failure when drive servos.
> References
>
> 1. [STM32F469 Discovery ST Website](https://www.st.com/en/evaluation-tools/32f469idiscovery.html#documentation)
## 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 `uart3` device. See [example](https://github.com/RTduino/RTduino/blob/master/examples/Basic/helloworld.cpp).
### 3.4 USB Virtual Serial
This board supports USB virtual serial. See [example](https://github.com/RTduino/RTduino/tree/master/examples/USBSerial). You may enable it if is needed.