The overview, with examples running, is on the board page.
The STM32 Nucleo-F411RE
ST's Nucleo-64 with an STM32F411 at 100 MHz, Uno headers, morpho pins, an ADC, and Serial over the ST-LINK.
What it is
ST's NUCLEO-F411RE (board MB1136): the same STM32F411 die as the Black Pill, in its 64-pin package, on our own Cortex-M4 core. The registers are at their real addresses (the STM32F411 model), and the sketch side is STM32duino's: a sketch written for the NUCLEO_F411RE board in the Arduino IDE reads the same here, pin numbers and all.
The clock is what STM32duino programs on this board: 100 MHz for the CPU, the timers and the fast peripheral bus, 50 MHz for the slow one. A cycle is exactly 10 ns. The clock tree itself is not modeled, so the chip is at 100 MHz from power-on.
The pins
Two kinds of header, as on the real board:
- The Arduino Uno headers inside:
CN6(IOREF,NRST,3V3,5V, twoGND,VIN),CN8(A0toA5),CN5(D8toD15,AVDD,GND) andCN9(D2toD7). - The ST morpho headers
CN7andCN10down the edges, with every pin the board connects that is not already on an Arduino header:PC10,PC11,PC12,PD2,PA13,PA14,PA15,PB7,PC13,PC2toPC6,PC8,PC9,PA11,PA12,PB1,PB2,PB12toPB15,PA2andPA3, and the suppliesVDD,E5V,U5V,AVDD,AGND,VBAT,BOOT0and grounds.
A pad on both headers is one piece of metal, so it is one pin, named for the
Arduino header: the morpho's PA5 is D13. A diagram written with the port
names still wires to the right pin.
Not connected, as the board ships: D0 and D1 (solder bridges SB62 and
SB63 are open, and PA3/PA2 go to the ST-LINK instead), PC14 and PC15
(the 32.768 kHz crystal) and PH0 and PH1 (the ST-LINK's 8 MHz clock). They
are drawn and have no pin behind them.
Pin numbers in a sketch
Numbered exactly as STM32duino's NUCLEO_F411RE variant numbers them:
0to15are the header'sD0toD15, as on an Uno, andD13is a name too.digitalWrite(13, HIGH)lights the green LED.16to51are the morpho pins in the variant's order.A0toA5are the header's analog pins,A6toA15the other ADC pins.- The port names work as well:
PA5is the same pin as13andD13.
analogRead(0) reads A0, not D0: STM32duino reads a number below 16 as an
analog input, and so does this board.
The LED, the button and Serial
LED_BUILTIN is PA5, which is D13. LD2, the green LED, goes from that pin
to ground through 510 ohms, so HIGH lights it, as on an Uno and unlike the
Black Pill.
USER_BTN is PC13, the blue B1 button, which pulls the pin to ground when it
is pressed. The board has its own 4.7 k pull-up (R30) on PC13, so INPUT
is enough and the pin reads LOW while it is held. While the simulation
runs, the buttons drawn on the board take clicks: hold the blue B1 and
PC13 reads LOW until you let go, and hold the black B2 RESET to hold
the chip in reset, which starts the sketch again from the top when you let go.
A pushbutton wired from PC13 or NRST to GND does the same.
Serial is USART2 on PA2 and PA3, which the board wires to the ST-LINK's
USB virtual COM port: that is what the serial monitor shows. STM32duino calls
it Serial2 and makes it Serial, and starts no Serial1, so Serial1 does
not compile here either. Serial prints nothing until Serial.begin().
What is modeled
- The Cortex-M4 core (ARMv7-M with Thumb-2), SysTick and the NVIC.
- GPIO on ports A to D, with the real
MODER,OTYPER,PUPDRandBSRR. - ADC1: twelve bits, with STM32duino's ten-bit
analogReadby default andanalogReadResolutionup to twelve; 0 to 3.3 V onA0toA5and the other ADC pins. Pins with nothing on them read noise, as on the bench. - PWM at 1 kHz from TIM1, TIM2, TIM3 and TIM4 on every pin STM32duino routes
analogWriteto:D3,D5,D6,D9,D10andD11(the tilde pins on an Uno), andD2,D4,D7,D8,D12toD15,A0,A1,A3and several morpho pins as well. Pins on one timer channel share it, as on the chip:A0,D13andPA15are all TIM2's channel 1. tone()on TIM10, the variant's tone timer;micros()on TIM5.attachInterrupton every pin, through SYSCFG and EXTI.WireonD14(SDA) andD15(SCL) andSPIonD10toD13, the variant's pins, driven in software.
What is not
- I2C, SPI, DMA and USB hardware, the RTC and the watchdogs.
WireandSPIwork, in software on the pins above. - The FPU. Floats are computed in software, so they come out the same and take more cycles than on the chip.
- The clock tree, the 32.768 kHz crystal and the ST-LINK itself: there is no mass-storage drive or debugger to talk to.
- Vendor binaries: the runtime here is ours, not the STM32Cube HAL or the STM32duino core's own code.
Stock Arduino libraries
The same as on the Black Pill: Servo.h, Wire.h, SPI.h, EEPROM.h,
LiquidCrystal_I2C.h, Adafruit_GFX.h with Adafruit_SSD1306.h and DHT.h
compile as they stand. Wire.begin() puts the bus on D14 (SDA, PB9) and
D15 (SCL, PB8). EEPROM.h keeps its bytes in RAM, gone at a reset.
The examples
Blink, Button, Serial, Fade and Analog read.
On a real Nucleo
In the Arduino IDE, install "STM32 MCU based boards" by STMicroelectronics,
pick Nucleo-64, then Tools, Board part number, Nucleo F411RE, and upload with
Tools, Upload method, Mass Storage. PlatformIO's board is nucleo_f411re.
Elsewhere
- The board page: /boards/nucleo-f411re
- The register map: the STM32F411 model
- The other STM32F411 board: the Black Pill