Google Chat: zj734465502@gmail.com
+86-0755-88291180
WhatsApp:13246739196
STM32 Development Board, Supports Arduino, Compatible with NUCLEO-F411RE
STM32 Xnucleo includes an onboard USB TO UART interface based on CP2102 (“serial port” hereafter) for code debugging. Before using this interface, you should install a CP2102 driver firstly.
Run the installer: CP2102 Driver
When the installation finished, connect the XNucleo board to a PC via the USB TO UART interface. And you will find the CP210x USB to UART Bridge Controller in the Device Manager, if the driver is installed successfully.
Run the installer: STM32 ST-LINK Utility (For more detailed information about installation and usage of STM32 ST-LINK Utility, please refer to the document provided by ST: STM32-ST-LINK-Utility\Readme\STLINK Utility.pdf. You can also download the latest installer from the ST website).
When the installation finished, connect the ST-LINK/V2(mini) module to a PC. You will find the STMicroelectronics STLink dongle in the Device Manager, if the driver is installed successfully.
Please follow the sequence below to configure the STM32 Xnucleo board and launch the demo software:
Notices: It is recommended to plug in the USB power supply or the external power supply before connecting the ST-LINK/V2(mini) module to the SWD interface. Otherwise, the ST-LINK/V2(mini) initialization may be failure.
The blinking of the USER LED indicator will change from fast to slow or from slow to fast, when clicking the USER key.
The power supply of the STM32 Xnucleo board is provided either by the host PC through the USB cable, or by an external source:
In case VIN, E5V, +3V3 or CN2 is used to power the Xnucleo board, you should use an external power supply unit.
All parts of the STM32 Xnucleo board and Shield can be powered from the ST-LINK/V2 (mini) USB connector by the host PC.
In case the ST-LINK/V2 (mini) USB connector is used to power the Xnucleo board, the host PC will provide 150mA current at maximum as 3.3V voltage is outputted from the ST-LINK/V2 (mini) USB connector to the Xnucleo board. And 300mA current at maximum may be provided when 5V voltage is outputted to the Xnucleo board. In case of the board requiring the current more than 300mA, it should be mandatory to use an external power supply as explained in the next chapter.
Each part of STM32 Xnucleo including the extension board can be powered by USB(U5V). However, if the maximum current consumption of the board exceeds 300mA, the USB may be damaged. When the board is power supplied by USB(U5V), a jumper must be connected between pin 1 and pin 2 of JP5 as shown in Table 2.
Table 2: Power-related jumper
Jumper | Description |
JP5 | U5V (ST-LINK VBUS) is used as power source when JP5 is set as shown below (Default setting) |
CN2, VIN or E5V is used as power source when JP5 is set as shown below |
CN2, VIN or E5V can be used as external power supply in case the current consumption of Xnucleo and its extension boards exceeds the allowed current on USB. In this condition, it is mandatory to power supply the board using the external power source firstly, then connect the USB cable and ST-LINK/V2 (mini) to the PC to ensure that the Xnucleo board can work properly.
Table 3: External power source parameters
Name | Pins | Voltage range | Max. current | Limitations |
CN2 | CN2 | 6V~12V | 800mA | The inputted current is in connection with the inputted voltage: For CN2/VIN = 7V, the inputted current is 800mA. For 6V < CN2/VIN <= 9V, the inputted current is 450mA. For 9V<CN2/VIN(< or =)12V, the inputted current is 250mA |
VIN | CN6 pin 8 or CN7 pin 24 | |||
E5V | CN7 pin 6 | 4.75V~5.25V | 500mA | ------ |
Notices: The following power sequence procedure must be respected when using an external power source:
If this order is not respected, the board may be supplied by VBUS or ST-LINK/V2(mini) firstly, and the following risks may be encountered:
If more than 300 mA current is needed by the board, the PC may be damaged or the current supply can be limited by the PC. As a consequence the board cannot work correctly.
The LEDs on the STM32 Xnucleo board is used to provide information about the Xnucleo working status.
Table 4: The relationship between LED and the pins of MCU
FLASH LED | MCU PIN |
LED1 | D13(PA5/PB13) |
LED2 | PC9 |
LED3 | PC8 |
LED4 | PC5 |
It is easy to use each LED by setting JP7. For XNUCLEO-F302R8, the pin PB13 is connected to the MCU pin D13. And for other XNUCLEO devices, the pin PA5 is connected to the MCU pin D13. When the I/O is HIGH value, the FLASH LED is on. And when the I/O is LOW, the FLASH LED is off.
The PWR LED default color is red. It indicates the power supply status of the STM32 Xnucleo board. The red LED indicates that the MCU part is powered by +5V.
TX indicator is in green, and RX indicator in blue. The blinking TX indicator means the MCU of STM32 Xnucleo board is sending message to the targeted PC. The blinking RX indicator means the MCU of STM32 Xnucleo board is receiving message from the targeted PC.
The USER button is connected to the I/O PC13(pin 2) of the targeted MCU by setting JP6 to ON;
This RESET button is connected to NRST, and is used to reset the targeted MCU.
STM32 microcontroller is powered (default).
When this jumper is removed, STM32 microcontroller is not powered. But you can connect an ammeter on the JP6 to measure the STM32 microcontroller current.
The USART2 interface available on PA2 and PA3 of the STM32 microcontroller can be connected to Virtual COM Port, STMicroelectronics Morpho connector or to Arduino connector.
Please set the JP4 as follows, to connect the targeted MCU to serial port (For more information, please refer to Table 6 and Table 7).
If the communication between the targeted MCU and shield or extension board is required, you should set the JP4 and the RX/D0 and TX/D1 on CN9 as follow (For more information, please refer to Table 6).
In such case it possible to connect another USART (if another USART is available on the targeted MCU) to the targeted MCU through Virtual COM Port using flying wires as follow
Here is the jumper setting for connecting to XNUCLEO-F030R8:
Notices: You should select a proper USART by referring to Table 5 and make corresponding hardware configurations, according to your actual demand. The USARTs (USART1 and USART3) listed in this table are unavailable under mbed, since only USART2(PA2, PA3) is defined for mbed. Therefore, when the USART-related APIs (such as printf) are required under mbed, you should select USART2(PA2, PA3) to connect to Virtual COM Port or CN9 on the pins RX/D0 and TX/D1.
Table 5: USART-related pins and jumpers
Model\pin | PC6,PC7 | PC10,PC11 | PA9,PA10 | SB70,SB71 | SB72,SB73 |
XNUCLEO -F030R8 | None | None | USART1 | None | |
XNUCLEO -F103RB | None | USART3 | USART1 (NC) | ON | OFF |
XNUCLEO -F302R8 | None | USART3 | USART1 (NC) | ON | OFF |
XNUCLEO -F401RE | USART6 | None | USART1 (NC) | OFF | ON |
Table 6: Connections of JP4 pins
A | B | C | D |
ARDUINO PORT | MCU PIN | CP2102 PIN | MCU PIN |
RX/D0 | RX/PA3 | TXD | RX/PC11/PC7 |
TX/D1 | TX/PA2 | RXD | TX/PC10/PC6 |
Table 7: Connections of NUCLEO-F030R8 JP4
A | B | C | D |
ARDUINO PORT | MCU PIN | CP2102 PIN | MCU PIN |
RX/D0 | RX/PA3 | TXD | RX/PA10 |
TX/D1 | TX/PA2 | RXD | TX/PA9 |
If ADC or I2C communication is required, you can connect the ADC interface or the I2C interface to the Arduino connector or the ST Morpho connector by setting the JP5.
Here are the relative settings to JP5:
Table 8: Connections of JP5 pins
A | B | C |
MCU PIN | ARDUINO PORT | MCU PIN |
SCL/PB8 | A5 | PC0/ADC |
SDA/PB9 | A4 | PC1/ADC |
The pins D11, D12 and D13 of Arduino connector are SPI interfaces. For XNUCLEO-F302R8, the pins PB13, PB14 and PB15 are connected to the pins D13, D12 and D11, respectively. And for other XNUCLEO devices, the pins PA5, PA6 and PA7 are connected to the pins D13, D12, and D11, respectively.
Except the XNUCLEO-F030R8, all the other XNUCLEO devices have reserved a USB connector which can be enabled by setting JP1 to ON.
Table 9: solder bridges
Bridge | State | Description |
SB74 | ON | IOREF is connected to 3.3V |
OFF | IOREF unconnected | |
SB75 | ON | IOREF is connected to 5V |
OFF | IOREF unconnected | |
SB45 (VBAT/VLCD) | ON | VBAT or VLCD on STM32 MCU is connected to VDD. |
OFF | VBAT or VLCD on STM32 MCU is not connected to VDD. | |
SB57 (VREF+) | ON | VREF+ on STM32 MCU is connected to VDD. |
OFF | VREF+ on STM32 MCU is not connected to VDD and can be provided from pin 7 of CN10 |
Notes: All the other solder bridges present on the STM32 Xnucleo board are used to configure several IOs and power supply pins for compatibility of features and leads with STM32 MCU supported.
The following figures show the signals connected by default to Arduino connectors (CN5, CN6, CN8, CN9) and to ST Morpho connector (CN7 and CN10), for each STM32 Xnucleo board.
Figure 1: XNUCLEO-F030R8
Figure 2: XNUCLEO-F103RB
Figure 3: XNUCLEO-F302RC
Figure 4: XNUCLEO-F401RE
Figure 5: XNUCLEO-F411RE
Xnucleo series is fully compatible with Nucleo series and can run the Nucleo Demos directly. Therefore, you can develop your STM32 Xnucleo applications based on the applications of STM32 Nucleo. Table 10 gives the relationship between Xnucleo series and Nucleo series.
Table 10: Relationships between Xnucleo series and Nucleo series
Xnucleo | Nucleo |
XNUCLEO-F030R8 | NUCLEO-F030R8 |
XNUCLEO-F103RB | NUCLEO-F103RB |
XNUCLEO-F302R8 | NUCLEO-F302R8 |
XNUCLEO-F401RE | NUCLEO-F401RE |
XNUCLEO-F411RE | NUCLEO-F411RE |
The operations presented in this document are based on XNUCLEO-F103RB. For different Xnucleo devices, there may be some differences in configuring the development environment. So users should operate according to the actual conditions.
In this section, we only present the ways to compile and download program, since it does not have room to address every factor of mbed. For more detailed information about the usage of mbed, please refer to the documents provided by mbed organization.
Here we take XNUCLEO-F103RB as an example. Start the mbed software, and open a program, such as Nucleo_printf. Then, click the button Compile for program compiling. If the program has no error, Compile Output will show “Success!” after the compiling is finished. And the file Nucleo_printf_NUCLEO_F103RB.bin will be generated. This file can be found in the specified save path (This save path is modifiable).
Table 11: Serial port configuration
Baud rate | 115200 |
Data bit | 8 |
Stop bit | 1 |
Parity | None |
Hello World! This program runs since 1 second. This program runs since 2 seconds. This program runs since 3 seconds. This program runs since 4 seconds. This program runs since 5 seconds.
At this time, the USER LED is blinking in the frequency of 0.5Hz. And the TX LED keeps blinking to indicate that STM32 Xnucleo is sending message to the PC.
Circuit debugging are unavailable in mbed. However, mbed has “Import Program” and “Export Program” functions. You can export the programs in mbed as Keil programs to perform debugging.
The mbed library file can also be exported, which includes the HAL library of STM32 MCU. Under the Keli environment, mbed libraries can be applied or modified directly, and can be transplanted into other applications.
The relative operations are as follow:
In the mbed, open the program you want to export. Then, right click the program name in the Program Workspace, and select Nucleo_printf->Export Program, as Figure 5 shows.
Figure 5: Exporting as Keil program
In the Export Toolchain pull-down menu of the pop-up window, select Keil μVision. Then, the programs in mbed can be exported as Keil programs and performed Keil debugging. For more detailed information, please refer to the Keil-related technical documents.
Besides Nucleo Demos, the Demos for different periphery modules provided by Waveshare are supported by Xnucleo series as well. The corresponding devices to the periphery module Demos include but not limited to: Temperature-Humidity Sensor, Rotation Sensor, Color Sensor, UV Sensor, Water Sensor, Moisture Sensor, Vibrating Sensor, Tilt Sensor, Laser Sensor, Gas Sensor, Sound Sensor, Flame Sensor, Hall Sensor, Metal Sensor, Infrared Reflective Sensor, OLED display module and so on. And these Demos for different periphery modules are integrated into a big Demo (“periphery module Demo” hereafter) for convenience.
Table 12: Connection between the XNUCLEO and sensors
Sensor | Pin | XNUCLEO-F030R8 | XNUCLEO-F103RB | XNUCLEO-F302R8 | XNUCLEO-F401RE | XNUCLEO-F411RE |
Temperature-Humidity Sensor | DOUT | PB3/D3 | PB3/D3 | PB3/D3 | PB3/D3 | PB3/D3 |
Rotation Sensor | SIA | PB4/D5 | PB4/D5 | PB4/D5 | PB4/D5 | PB4/D5 |
SIB | PB5/D4 | PB5/D4 | PB5/D4 | PB5/D4 | PB5/D4 | |
SW | PB10/D6 | PB10/D6 | PB10/D6 | PB10/D6 | PB10/D6 | |
Color Sensor | LED | 3.3V | 3.3V | 3.3V | 3.3V | 3.3V |
OUT | PC7/D9 | PA1/A1 | PA1/A1 | PA1/A1 | PA1/A1 | |
S3 | PA9/D8 | PA9/D8 | PA9/D8 | PA9/D8 | PA9/D8 | |
S2 | PA8/D7 | PA8/D7 | PA8/D7 | PA8/D7 | PA8/D7 | |
S1 | NC | NC | NC | NC | NC | |
S0 | NC | NC | NC | NC | NC | |
UV Sensor Water Sensor Moisture Sensor Tilt Sensor Laser Sensor Gas Sensor Sound Sensor Flame Sensor Hall Sensor Metal Sensor Infrared Reflective Sensor | AOUT | PA4/A2 | PA4/A2 | PA4/A2 | PA4/A2 | PA4/A2 |
DOUT | PA10/D2 | PA10/D2 | PA10/D2 | PA10/D2 | PA10/D2 | |
0.96inch OLED | DIN | PA7/D11 | PA7/D11 | PB15/D11 | PA7/D11 | PA7/D11 |
CLK | PA5/D13 | PA5/D13 | PB13/D13 | PA5/D13 | PA5/D13 | |
CS | PB8/A5 | PB8/A5 | PB8/A5 | PB8/A5 | PB8/A5 | |
D/C | PB9/A4 | PB9/A4 | PB9/A4 | PB9/A4 | PB9/A4 | |
RES | PB0/A3 | PB0/A3 | PB0/A3 | PB0/A3 | PB0/A3 |
Notices:
When the Demo is running, the LED1 on the XNUCLEO board will blink at the rate of every 2 seconds.
For the periphery module Demo, there are two modes for displaying the returned information from the module: OLED and Screen Print (relative information is sent to the PC via the serial port every 500 ms). Here is an example:
Figure 6: OLED displays relative sensor parameters
At the same time, relative data will be outputted:
/*----------------------*/ T: 23 C H: 34 D: 3868 A: 3.116 S: OFF Rot: 227 SW: 52 R: 20 G: 6 B: 105 RTC: 12:1:4 KEY: 10 /*----------------------*/
Table 13: The meanings of relative symbols
Symbol | Meanings | Remarks |
T | Temperature | Unit: Degrees Celsius |
H | Humility | Air humility percentage (%) |
D | AD value | Voltage value in the format of 12 BIT. It can be converted to actual value by linear transformation. |
A | DA value | Voltage value |
S | State | There are two states: ON and OFF |
Rot | Rotation count for rotation encoder | For clockwise rotation, the counter value is incremented by 1; for anticlockwise rotation, the counter value is decremented by 1. The count can be a minimum of 0 and maximum 255. |
SW | Button press count for rotation encoder | It supports single click, double click, long press and continued shot |
R | Red value | Users can get the actual color on the basis of the RGB value. For more information, please refer to Color Sensor User Manual |
G | Green value | Users can get the actual color on the basis of the RGB value. For more information, please refer to Color Sensor User Manual |
B | Blue value | Users can get the actual color on the basis of the RGB value. For more information, please refer to Color Sensor User Manual |
RTC | Real time clock | The outputted time information from RTC. |
KEY | USER button press count for Xnucleo | Its usage is the same as the SW of the rotation encoder. |