STM 32

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

The STM32 family of microcontrollers from STMicroelectronics is

based on the ARM Cortex-M 32-bit processor core.

The STM32 series are some of the most popular microcontrollers used
in a wide variety of products. They also have an excellent support base
from multiple microcontroller development forums.

STM32 microcontrollers offer a large number of serial and parallel


communication peripherals which can be interfaced with all kinds of
electronic components including sensors, displays, cameras, motors,
etc. All STM32 variants come with internal Flash memory and RAM.

The range of performance available with the STM32 is quite expansive.


Some of the most basic variants include the STM32F0 and STM32F1
sub-series that start with a clock frequency of only 24 MHz, and are
available in packages with as few as 16 pins.
At the other performance extreme, the STM32H7 operates at up to
400 MHz, and is available in packages with as many as 240 pins.
The more advanced models are available with Floating Point Units
(FPU) for applications with serious numerical processing requirements.
These more advanced models blur the line between a microcontroller
and a microprocessor.

Finally, the STM32L sub-series is designed specifically for low-power


portable applications running from a small battery.

Development Tools
Development tools are required to develop the code, program the
microcontroller and test/debug the code. The development tools
include:

 Compiler

 Debugger

 In-Circuit Serial Programmer (ICSP)

There are several software development tools available for code


development on STM32 microcontrollers. The software tools are
available as Integrated Development Environments (IDE) which
combines all of the necessary tools into an integrated environment.
Two common development packages include:
 Keil MDK ARM (uVison5 IDE) – The MDK ARM IDE is a very
stable development environment which can be downloaded for free. It
allows development of code up to a program size of 32 KB. For
developing larger programs a licensed version needs to be
purchased here.
 CoIDE – A free tool chain which is based on a trimmed down
version of the Eclipse IDE integrated along with an embedded ARM
version of the free GCC compiler.
There are also several other IDEs that are available for use with
STM32 microcontrollers. However, this article focuses on developing
and flashing a program using the very popular Keil MDK ARM uVision5
IDE.
Apart from the software tools, an In-Circuit Serial Programmer (ICSP) is
required to program and test the code on the actual microcontroller.
The ICSP is required to interface the microcontroller to the PC
software tools via a USB port.
The ARM Cortex-M microcontrollers support two programming
protocols: JTAG (named by the electronics industry association the
Joint Test Action Group) and Serial Wire Debug (SWD).
There are several ICSP programmers available that support these
protocols, including:
 Keil U-Link 2
 Segger J-Link
 ST-Link

Developing the first application


It’s always easiest to start with a readily available basic code
framework. Then, add the code that is required for the specific
application and model of microcontroller.
Fortunately, STMicroelectronics provides a very useful graphical tool
called STM32CubeMx that helps in creating a basic application project
for any STM32 microcontroller of your choice. It also can be used to
configure the peripherals on the multiplexed pins of the
microcontroller.
The STM32CubeMX tool can be downloaded from here. The
STM32Cube comes with an extensive set of drivers for all types of
peripherals and support for an optional FreeRTOS (a free Real-Time
Operating System) pre-integrated with the code.

You might also like