• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..21-Aug-2025-

README.md A D21-Aug-20254 KiB6349

README_zh.md A D21-Aug-20253.6 KiB6449

SConscript A D21-Aug-2025209 106

nucleo_g474re_arduino_left.jpg A D21-Aug-2025154.3 KiB

nucleo_g474re_arduino_right.jpg A D21-Aug-2025214.8 KiB

pins_arduino.c A D21-Aug-20252.8 KiB8353

pins_arduino.h A D21-Aug-20251.3 KiB5735

stm32g474-nucleo-pinout.jpg A D21-Aug-2025190.4 KiB

README.md

1# The Arduino Compatible for STM32G474 Nucleo development board
2
3**English** | [中文](README_zh.md)
4
5## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
6
7The STM32G474 Nucleo development board has been fully adapted with the [RTduino software package](https://github.com/RTduino/RTduino), which is an Arduino Ecosystem compatibility layer for RT-Thread. Users can program this BSP according to Arduino programming conventions and use a large number of libraries available in the Arduino community, providing a significant enhancement to the RT-Thread ecosystem. For more information, please refer to the [RTduino software package documentation](https://github.com/RTduino/RTduino).
8
9### 1.1 How to Enable Arduino Ecosystem Compatibility Layer for this BSP
10
11Enter the menuconfig command under Env tool or select RT-Thread Settings under RT-Thread Studio IDE:
12
13```Kconfig
14Hardware Drivers Config --->
15    Onboard Peripheral Drivers --->
16        [*] Compatible with Arduino Ecosystem (RTduino)
17```
18
19## 2 Arduino Pinout
20
21For additional information on pin layout, refer to [pins_arduino.c](pins_arduino.c) and [pins_arduino.h](pins_arduino.h).
22
23
24![stm32g474-nucleo-pinout.jpg](./stm32g474-nucleo-pinout.jpg)
25![nucleo_g474re_arduino_left.jpg](./nucleo_g474re_arduino_left.jpg)
26![nucleo_g474re_arduino_right.jpg](./nucleo_g474re_arduino_right.jpg)
27
28| Arduino Pin Number  | STM32 Pin Number | 5V Tolerance | Remarks |
29| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
30| 0 (D0) | PC5 | Yes |  |
31| 1 (D1) | PC4 | Yes |  |
32| 2 (D2) | PA10 | Yes | Serial2-RX, default controlled by RT-Thread's UART device framework uart1 |
33| 3 (D3) | PB3 | Yes | PWM2-CH2, default controlled by RT-Thread's PWM device framework pwm2 |
34| 4 (D4) | PB5 | Yes |  |
35| 5 (D5) | PB4 | Yes | PWM3-CH1, default controlled by RT-Thread's PWM device framework pwm3 |
36| 6 (D6) | PB10 | Yes | PWM2-CH3, default controlled by RT-Thread's PWM device framework pwm2 |
37| 7 (D7) | PA8 | Yes |  |
38| 8 (D8) | PA9 | Yes | Serial2-TX, default controlled by RT-Thread's UART device framework uart1 |
39| 9 (D9) | PC7 | Yes | PWM8-CH2, default controlled by RT-Thread's PWM device framework pwm8 |
40| 10 (D10) | PB6 | Yes | PWM4-CH1, default controlled by RT-Thread's PWM device framework pwm4 |
41| 11 (D11) | PA7 | Yes | PWM3-CH2, default controlled by RT-Thread's PWM device framework pwm3 |
42| 12 (D12) | PA6 | Yes |  |
43| 13 (D13) | PA5 | Yes | Onboard User LED |
44| 14 (D14) | PB9 | Yes | I2C1-SDA, default controlled by RT-Thread's I2C device framework i2c1 |
45| 15 (D15) | PB8 | Yes | I2C1-SCL, default controlled by RT-Thread's I2C device framework i2c1 |
46| 16 (D16) | PC13 | Yes |  |
47| 17 (A0) | PA0 | Yes | ADC1-CH1, default controlled by RT-Thread's ADC device framework adc1 |
48| 18 (A1) | PA1 | Yes | ADC1-CH2, default controlled by RT-Thread's ADC device framework adc1 |
49| 19 (A2) | PA4 | Yes | ADC2-CH17, default controlled by RT-Thread's ADC device framework adc2 |
50| 20 (A3) | PB0 | Yes | ADC1-CH15, default controlled by RT-Thread's ADC device framework adc1 |
51| 21 (A4) | PC1 | Yes | ADC1-CH7, default controlled by RT-Thread's ADC device framework adc1 |
52| 22 (A5) | PC0 | Yes | ADC1-CH6, default controlled by RT-Thread's ADC device framework adc1 |
53| 23 (A6) | -- |  | On-chip reference voltage ADC, default controlled by RT-Thread's ADC device framework adc1 |
54| 24 (A7) | -- |  | On-chip temperature sensor ADC, default controlled by RT-Thread's ADC device framework adc1 |
55
56> Notice:
57>
58> 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.
59
60> References:
61> 1. [stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf](https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf)
62> 2. [ST-Nucleo-G474RE](https://os.mbed.com/platforms/ST-Nucleo-G474RE)
63

README_zh.md

1# STM32G474 Nucleo开发板的Arduino生态兼容说明
2
3**中文** | [English](README.md)
4
5## 1 RTduino - RT-Thread的Arduino生态兼容层
6
7STM32G474 Nucleo开发板已经完整适配了[RTduino软件包](https://github.com/RTduino/RTduino),即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见[RTduino软件包说明文档](https://github.com/RTduino/RTduino)8
9### 1.1 如何开启针对本BSP的Arduino生态兼容层
10
11Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
12
13```Kconfig
14Hardware Drivers Config --->
15    Onboard Peripheral Drivers --->
16        [*] Compatible with Arduino Ecosystem (RTduino)
17```
18
19## 2 Arduino引脚排布
20
21更多引脚布局相关信息参见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
22
23
24![stm32g474-nucleo-pinout.jpg](./stm32g474-nucleo-pinout.jpg)
25![nucleo_g474re_arduino_left.jpg](./nucleo_g474re_arduino_left.jpg)
26![nucleo_g474re_arduino_right.jpg](./nucleo_g474re_arduino_right.jpg)
27
28
29| Arduino引脚编号  | STM32引脚编号 | 5V容忍 | 备注  |
30| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
31| 0 (D0) | PC5 | 是 |  |
32| 1 (D1) | PC4 | 是 |  |
33| 2 (D2) | PA10 | 是 | Serial2-RX,默认被RT-Thread的UART设备框架uart1接管 |
34| 3 (D3) | PB3 | 是 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
35| 4 (D4) | PB5 | 是 |  |
36| 5 (D5) | PB4 | 是 | PWM3-CH1,默认被RT-Thread的PWM设备框架pwm3接管 |
37| 6 (D6) | PB10 | 是 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 |
38| 7 (D7) | PA8 | 是 |  |
39| 8 (D8) | PA9 | 是 | Serial2-TX,默认被RT-Thread的UART设备框架uart1接管 |
40| 9 (D9) | PC7 | 是 | PWM8-CH2,默认被RT-Thread的PWM设备框架pwm8接管 |
41| 10 (D10) | PB6 | 是 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 |
42| 11 (D11) | PA7 | 是 | PWM3-CH2,默认被RT-Thread的PWM设备框架pwm3接管 |
43| 12 (D12) | PA6 | 是 |  |
44| 13 (D13) | PA5 | 是 | 板载用户LED |
45| 14 (D14) | PB9 | 是 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 |
46| 15 (D15) | PB8 | 是 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 |
47| 16 (D16) | PC13 | 是 |  |
48| 17 (A0) | PA0 | 是 | ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
49| 18 (A1) | PA1 | 是 | ADC1-CH2,默认被RT-Thread的ADC设备框架adc1接管 |
50| 19 (A2) | PA4 | 是 | ADC2-CH17,默认被RT-Thread的ADC设备框架adc2接管 |
51| 20 (A3) | PB0 | 是 | ADC1-CH15,默认被RT-Thread的ADC设备框架adc1接管 |
52| 21 (A4) | PC1 | 是 | ADC1-CH7,默认被RT-Thread的ADC设备框架adc1接管 |
53| 22 (A5) | PC0 | 是 | ADC1-CH6,默认被RT-Thread的ADC设备框架adc1接管 |
54| 23 (A6) | -- |  | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
55| 24 (A7) | -- |  | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
56
57> 注意:
58>
59> 1. 驱动舵机和analogWrite函数要选择不同定时器发生的PWM信号引脚,由于STM32的定时器4个通道需要保持相同的频率,如果采用相同的定时器发生的PWM分别驱动舵机和analogWrite,可能会导致舵机失效。
60
61> 参考资料:
62> 1. [stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf](https://www.st.com/resource/en/user_manual/dm00105823-stm32-nucleo-64-boards-mb1136-stmicroelectronics.pdf)
63> 2. [ST-Nucleo-G474RE](https://os.mbed.com/platforms/ST-Nucleo-G474RE)
64