XNUCLEO-F401RE

From Waveshare Wiki
Jump to: navigation, search

[中文]

XNUCLEO-F401RE
STM32F4 Improved STM32 NUCLEO Board
XNUCLEO-F401RE l.jpg

STM32 Development Board, Supports Arduino, Compatible with NUCLEO-F401RE
XNUCLEO-F401RE Package A
XNUCLEO-F401RE-Package-A l.jpg

STM32 Development Board, Supports Arduino, Compatible with NUCLEO-F401RE, Comes with Various Sensors
XNUCLEO-F401RE Package B
XNUCLEO-F401RE-Package-B l.jpg

XNUCLEO-F401RE Development Kit, Comes with Common Used Peripheral Shields, OLED, RTC, AD/DA, Audio Codec ...
{{{name4}}}

{{{name5}}}

Primary Attribute
Category: Arduino, mbed
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
Website
English: Waveshare website
Chinese: 官方中文站点
Onboard Interfaces
Arduino ICSP ST Morpho SWD
USB USB TO UART
Related Products

Introduction

STM32 Development Board, Supports Arduino, Compatible with NUCLEO-F401RE

More

Development tool installation

CP2102 Virtual COM Port driver installation

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.

STM32 ST-LINK Utility installation

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.

Getting started

Please follow the sequence below to configure the STM32 Xnucleo board and launch the demo software:

Hardware configurations

  • Jumper settings
  • Set JP3 to U5V;
  • Set JP2 to ON;
  • Power supply and power selection
  • For using a USB power supply, connect the Xnucleo board to a PC with a USB cable through the onboard USB connector;
  • For using an external power supply, connect the power supply socket CN2 on the Xnucleo board to a 6~12V power adapter.
  • Connect the ST-LINK/V2 (mini) debugger/programmer to the SWD connector

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.

Observing the actions

The blinking of the USER LED indicator will change from fast to slow or from slow to fast, when clicking the USER key.

Power supply settings

The power supply of the STM32 Xnucleo board is provided either by the host PC through the USB cable, or by an external source:

  • VIN (7V~12V) or +3V3 power pins on CN6;
  • E5V(5V) pin on CN7;
  • CN2 power supply connector (7V~12V).

In case VIN, E5V, +3V3 or CN2 is used to power the Xnucleo board, you should use an external power supply unit.

Power supply input from the USB connector

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)

Xnucleo-User-Manual-1.jpg

CN2, VIN or E5V is used as power source when JP5 is set as shown below

Xnucleo-User-Manual-2.jpg

Using CN2, VIN or E5V as external power supply

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:

  • Set JP3 to U5V;
  • Connect the external power source to CN2, VIN or E5V;
  • Power on the external power supply CN2, VIN: 7V~12V, or E5V: 5V;
  • Check that PWR LED is turned ON;
  • Connect the PC to USB connector or ST-LINK/V2(mini) on Xnucleo.

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.

External power supply output

  • When powered by CN2, VIN or E5V, the +5V (CN6 pin 5 or CN7 pin 18) can be used as output power supply for an Arduino shield or an extension board. In this case, the maximum current of the power source specified in Table 3 needs to be respected.
  • The +3.3 V (CN6 pin 4 or CN7 pin 12 & 16) can be used also as power supply output. The current is limited by the maximum current capability of the regulator U4 (500 mA max).

LED indicators

The LEDs on the STM32 Xnucleo board is used to provide information about the Xnucleo working status.

FLASH LED

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.

PWR LED Power supply indicator

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.

Serial port working status LED indicators

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.

Push button

USER button

The USER button is connected to the I/O PC13(pin 2) of the targeted MCU by setting JP6 to ON;

RESET button

This RESET button is connected to NRST, and is used to reset the targeted MCU.

JP2 (IDD) jumper settings

JP2 ON

STM32 microcontroller is powered (default).

JP2 OFF

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.

USART communication

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.

Connecting the targeted MCU to serial port

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).

  • Connect the RX/PA3 of JP4 to the TXD;
  • Connect the TX/PA2 of JP4 to the RXD.

Communication between the targeted MCU and shield or extension board

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).

  • Connect the RX/PA3 of JP4 to the RX/D0;
  • Connect the TX/PA3 of JP4 to the TX/D1.

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

  • Connect the TX/PC10/PC6 of JP4 to RXD;
  • Connect the RX/PC11/PC of JP4 to TXD.

Here is the jumper setting for connecting to XNUCLEO-F030R8:

  • Connect the TX/PA9 of JP4 to RXD;
  • Connect the RX/PA10 of JP4 to TXD.

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

ADC or I2C communication

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:

  • The pins A4 and A5 of JP5 should be connected to the Arduino connector on the pins A4 and A5 (the pin 5 and the pin 6 of CN8) or the ST Morpho connector on the pins 36 and 38 of CN7 respectively;
  • The pins SDA/PB9 and SCL/PB8 of JP5 corresponding to the I2C interface of STM32 MCU;
  • The pins PC1/ADC and PC0/ADC of JP5 corresponding to the ADC interface of STM32 MCU.

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

SPI connector

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.

USB connector

Except the XNUCLEO-F030R8, all the other XNUCLEO devices have reserved a USB connector which can be enabled by setting JP1 to ON.

Solder bridges

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.

10 Extension connector

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

Xnucleo-User-Manual-3.jpg

Figure 2: XNUCLEO-F103RB

Xnucleo-User-Manual-4.jpg

Figure 3: XNUCLEO-F302RC

Xnucleo-User-Manual-5.jpg

Figure 4: XNUCLEO-F401RE

Xnucleo-User-Manual-6.jpg

Figure 5: XNUCLEO-F411RE

Xnucleo-User-Manual-7.jpg

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.

How to compile and download program under mbed

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.

Program compiling

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).

Program downloading

  • Run the STM32 ST-LINK Utility, and select file->Open file. Then, open the file Nucleo_printf_NUCLEO_F103RB.bin.
  • Connect the USB TO UART interface on the board to your PC with a USB cable, and then connect ST-LINK/V2(mini) module to download the .bin file. Then, set the JP5 to U5V. For the JP4 setting, please refer to Section 2.5 USART communication. The serial port should be configured according to Table 11.

Table 11: Serial port configuration

Baud rate 115200
Data bit 8
Stop bit 1
Parity None
  • When the program downloading finished, COM port will receive the following information:
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.

How to export the Keil program from mbed

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

Xnucleo-User-Manual-8.jpg

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.

Connection between the Xnucleo board and Peripherals

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:

  • The pins VCC and GND of the sensors listed above should be connected to the pins VCC and GND of IO Expansion Shied. For more detailed information, please refer to IO Expansion Shied User Manual.
  • Some of the sensors may only lead out the pin AOUT or the pin DOUT. In this case, the additional reserved pin(s) of IO Expansion Shied can be left unconnected. One IO Expansion Shied can only connect one sensor at a time.

Demo explanations

When the Demo is running, the LED1 on the XNUCLEO board will blink at the rate of every 2 seconds.

Data display mode

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

Xnucleo-User-Manual-9.jpg

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
/*----------------------*/

The meanings of the returned data

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.

Related Modules

Resources

FAQ

Question:
How to connect with a XNUCLEO development board for testing?
Answer:

Before the testing, please make preparations as follow:

  1. A power supply;
  2. A programmer or emulator, such as ST-Link V2 (mini);
  3. A Micro USB cable;
  4. Setting the JP3.

Steps:

1. Connect to the power supply. There are two ways for power supply, and either of them is available:

  • USB: This USB interface can be used for either USB communication testing or power supply.
  • USB TO UART:This interface is a USB to serial interface (Virtual Serial Port) for serial communication debugging. It can also be used for power supply.
  • DC socket for DC power supply unit (6~12V).

2. Setting the JP3. When using the USB or the USB TO UART interface for power supply, the JP3 should select U5V; when using the DC power supply unit (6~12V) as power supplier, the JP3 should select E5V;

3. Connect the ST-Link V2 (mini)to the SWD interface on the XNUCLEO board for program downloading or emulation.

4. For serial communication debugging, connect your PC to the USB TO UART interface on the XNUCLEO board.

Connect your PC to the board via the USB TO UART interface for serial debugging. In this case, the XNUCLEO board is power supplied by the PC USB.
Connect your PC to the board via the USB interface for USB communication testing. In this case, the XNUCLEO board is power supplied by the PC USB.
Connect your PC to the board via the USB and the USB TO UART interfaces for USB communication testing and serial debugging. In this case, the XNUCLEO board is power supplied by the PC USB.
Connect a DC power supply unit to the board. In this case, the XNUCLEO board is power supplied by the external power source.
Connect a DC power supply unit to the board and connect your PC to the board via the USB TO UART interface for serial debugging. In this case, the XNUCLEO board is power supplied by the external power source.
Connect a DC power supply unit to the board. And connect your PC to the board via the USB and the USB TO UART interfaces for USB communication testing and serial debugging. In this case, the XNUCLEO board is power supplied by the external power source.


Support

Mail.png Contact your seller (fast response and most recommended)

or send emails to service@waveshare.com (not fast enough but please be patient) for help.

Our working time: 09:00-18:00 (UTC+8 Monday to Saturday)