那么对Nucleo L053R8而言
我们首先需要知道的是板载LED连接到哪个GPIO
在ST的文档中我们找到这样一段话:
LEDs
The tricolor LED (green, orange, red) LD1 (COM) provides information about ST-LINK communication status. LD1 default color is red. LD1 turns to green to indicate that communication is in progress between the PC and the ST-LINK/V2-1, with the following setup:
?Slow blinking Red/Off: at power-on before USB initialization
?Fast blinking Red/Off: after the first correct communication between the PC and STLINK/
V2-1 (enumeration)
?Red LED On: when the initialization between the PC and ST-LINK/V2-1 is complete
?Green LED On: after a successful target communication initialization
?Blinking Red/Green: during communication with target
?Green On: communication finished and successful.
?Orange On: Communication failure
User LD2: the green LED is a user LED connected to Arduino signal D13 corresponding to MCU I/O PA5 (pin 21) or PB13 (pin 34) depending on the STM32 target. Please refer to Table 10 to Table 21.
?When the I/O is HIGH value, the LED is on.
?When the I/O is LOW, the LED is off.
LD3 PWR: the red LED indicates that the MCU part is powered and +5V power is available.
有这个图可以看出,这个LED连接至D13, PA5