Tag Archives: Cortex -M4

Quick Overview of STM32



STM32 is a microcontroller family from ST with a 32-bit ARM Cortex-M0/M3/M4 CPU. This architecture is designed for use in new microcontrollers, replacing the previous ARM7-based controllers as far as possible. ST’s STM32 it in countless ways with variable peripherals and various body sizes and shap


Block diagram STM32F103xC/D/E

STM32 families

So far there are seven STM32 family:

  • STM32F0
    • Cortex M0
    • Microcontroller to start
    • To 48MHz
  • STM32F1
    • Cortex M3
    • To 72MHz
    • Different subfamilies:
      • Connectivity line
      • Performance line
      • USB Access Line
      • Access Line
      • Value line
  • STM32F2
    • Cortex M3
    • To 120MHz
    • As the STM32F1 series, Camera interface, 32-bit timers, crypto engine …
  • STM32F3
    • Cortex M4
    • DSP and FPU
    • To 72MHz
    • Fast 12-bit 5 MSPS and precise 16-bit sigma-delta ADCs
    • Touch Sensing Controller (TSC)
  • STM32F4
    • Cortex M4
    • DSP and FPU
    • To 180MHz
    • Up to 2MB Flash
  • STM32L1
    • Cortex M3
    • Low Power
    • with LCD Drivers
    • To 32MHz
  • STM32W
    • Cortex M3
    • TO 24MHz
    • RF MCU

Here is an overview of selecting a STM32Fxxx


  • Cortex-M0 / Cortex-M3 / Cortex-M4 core
  • 16KB … 2MB flash ROM
  • 4KB … 256KB SRAM
  • 512 one-time programmable bytes (STM32F2 / 4)
  • Housing 36 … 216 pins as QFN, LQFP and BGA
  • Currently, more than 250 STM32 derivatives / options available
  • To 72MHz CPU clock to 120MHz. During STM32F2xx until 168/180 MHz for the STM32F4xx wherein a special hardware prefetch to 120/168 MHz to achieve a speed which corresponds to 0 wait states The CPU clock is derived via a multiplier from the internal RC clock or an external crystal clock.
  • External bus interface (only on 100-pin packages and only STM32F4, STM32F2 and line STM32F1 Performance)
  • LCD driver for 8×40 points (not on STM32F2xx)
  • TFT driver with STM32F429 / STM32F439
  • Voltage range 1.65 … 3.6 V, only one power supply required
  • Temperature range up to 125 ° C
  • Up to 140 Os, many 5V Tolerant
  • Internal, calibrated RC oscillator at 8MHz (16MHz at STM32F2/F4xx)
  • External crystal
  • Real Time Clock with own crystal and a separate power supply
  • Up to 16 Timers , each timer up to 4 IC / OC / PWM outputs. Including 2x Motion Control Timer (at STM32F103xF / G)
  • SysTick Counter
  • Up to 3 12-bit ADC with a total of 24 AD inputs, integrated temperature sensor voltage measurement, voltage reference and Vrefint VBatt (STM32F4xx)
  • Up to 2 12-bit DA-Converter (up to 3 at STM32F3xx)
  • Up to two DMA Controller with up to 12 channels (16 for STM32F2/4xx)
  • Up to 2 x I ² C
  • Up to 5x USART for up to 8 STM32F2/F4xx) with LIN, IrDA and modem control
  • Up to 3x SPI (up to 6 at STM32F4xx)
  • Up to 2 x I ² S
  • Up to 2x CAN
  • Unique Device ID register (96 bits)
  • RNG – Random Number Generator (STM32F2/4xx)
  • Cryptographic Processor (CRYP) (STM32F2/4xx)
  • Hash Processor (HASH) (STM32F2/4xx)
  • Camera Interface (DCMI) (STM32F2/4xx)
  • USB 2.0 Full Speed ​​/ OTG
  • USB 2.0 High Speed ​​OTG PHY chip with extra (STM32F2/4xx)
  • SDIO interface (such as an SD card reader)
  • Ethernet
  • Watchdog with Window Fashion
  • Each peripheral module is switched on separately, thus significantly reduce Power Consumption
  • JTAG and SWD (Serial Wire Debug) interface
  • Up to 6 hardware breakpoints for debugging
  • and more. . .


Structure of the documentation:

As an example of the documentation is representative of STM32F103RC called. The side of ST includes all the necessary information due to this processor.

These documents describe the controller from ST:

In the Datasheet the special properties of a certain model are described and listed the exact data and pinouts. The peripheral modules are only listed, not described in detail. In the reference, the entire controller with peripheral modules is described in detail, valid for one STM32 family. Details of the processor core itself and not associated with the specific STM32 Cortex-M3 core modules such as the interrupt controller and the SysTick timer is found not there, but in the Cortex-M3 Manual. Who does not use the ST firmware library, which also requires the Flash Programming Reference for the operating mode of the Flash ROM, i.e., the frequency-dependent configuration of wait states. There are also optional documentation of ARM that the Cortex-M3 core / core Cortex-M4 describe. Here is the opcode you use it in assembler wants to program. In addition, should the Errata sheets are observed. Also recommended the Appnote “was STM32F10xxx hardware development: getting started “.

STM32 Standard Peripheral Library

ST offers an extensive family of controllers for each peripheral library. All functions are easy to use around the periphery encapsulated in simple structures and function calls. So you do not take care of the peripheral register. This library and its documentation require a basic understanding of the function of each peripheral module, mediate as the reference oA and various Appnotes. The Library also contains several examples for almost any peripheral. For the USB interface, there is an extra library, as well as for Ethernet.



Advantages over ARM7:

  • Interrupt controller is now part of the processor (as Core Peripheral), the Vector Table is now a real vector table, no jump list as ARM7. By automatisms between core and NVIC (auto save registers r0, r3, lr, sp, pc) if interrupt entry much faster execution time is achieved with interrupts. The interrupt code no longer needs to take care of the security of the above registers and eliminates a special configuration of the handler in the compiler. Before the end of an ISR (i.e., return to the User Code) further interrupts pending, they will be executed without a full pop-push sequence of register is required. Described beautiful it is here in the Insider’s Guide under 2.4.5 / page 20
  • Thumb-2 instruction set, significantly faster than Thumb-1 and equally compact
  • Fewer pins for debugging required by SWD
  • Debug make more hardware breakpoints easier
  • Software is easier because the switch between ARM and Thumb mode fashion disappears

LPC1700 and LPC1300 advantages over:

  • More flexible forms of housing with more peripheral in small enclosures
  • FW Lib for STM32 all equal, all AppNotes / demos refer to this a FW Lib what the development of your application much faster.
  • More accurate and more flexible ADC, especially to LPC1300
  • More flexible options in the periphery >> less a price advantage.


Disadvantage compared to LPC1700:

  • STM32F1xx: only 72 MHz instead of 100 MHz (LPC1759: 120 MHz) frequency; STM32F2xx has not this disadvantage (also 120MHz, with 168MHz STM32F4xx) (But NXP has already announced 150MHz)
  • The LPC1700 has a lot more mechanisms to reduce the impact of wait states of the Flash ROM on the code and data accesses, and that means more performance at the same clock speed. When STM32F2 eliminates this drawback, probably due to the ART accelerators.
  • LPC1xxx all have 32-bit timer. In the STM32 have only STM32F2xx (2 pieces)
  • I2S unit of ST does not have a FIFO mode must 2x16bits 24/32Bit and half words are transmitted. Where in general the new ARM processors available DMA channels means (based on its own BUS channels and memory accesses) FIFO at any size.

Advantages over other “small” such as PIC, Atmel, etc.

  • almost the same price for hobby applications
  • 32 bits directly into assembler calculable
  • better peripheral
  • … and another 1000 points …

Disadvantage for hobbyists

  • Not directly “Steckbrettauglich” because no available DIL package. The ebay shop dipmicro leads very cheap Adapter series for implementing from LQFP48 to DIP48. QFP64 in 0.5mm lead pitch 0.8mm and not as AVR
  • Many peripherals, all clocks must be set correctly, if necessary, adjust the startup code, etc.