stm32f411re

Created 2022-10-30 Updated 2023-04-16

RAM: 128k

FLASH: 512k

CLOCK: 100MHz, but default seems to be 16MHz

DMA

libopencm32 example dma mem-to-mem for stm32f1

I2C

SCL and SDA lines should be set to open-drain.

DMA

I2C bare metal, by Hackaday

LL drivers I2C DMA

SPI

Bit-banging SPI master TX

CMSIS SPI master TX

Perform peripheral setup. Then:

The timings above assume a transfer rate of 1.56MB/s. The whole transmission takes about 5.4us.

SPI bare metal, by Hackaday

SSD1306

On blackpill, my SSD1306 seemed to require a delay of 4ms before initialisation of SSD1306, otherwise it would require toggling of the NRST button. This problem occurred on both the Cube and libopencm3, so I don't think it's a coding error per se.

/home/pi/repos/rpi/stm32f411re/libopencm3/15-ssd1306

WEAK OVERRIDE

/home/pi/repos/rpi/stm32f411re/libopencm3/11-ledmat-i2c

TIMERS and Delay

Capabilities:

PSC for all timers (1,2,3,4,5,9.10) are 16-bits

Microsocend delay using timer

Uses TIM3 as an example, and toggles a pin every 1ms. No interrupts are used because we don't need them in this example.

Delay Microsecond Millisecond Utility | DWT Delay & Timer Delay

HAL

main(): HAL_TIM_Base_Start_IT(&htim2);

LL

In CubeMX you will want to enable ARR preload, unless it is a one-shot.

main():

IRQ:

Change frequency:

EXITS

Bare metal programming guide

STM32 World Wiki