Questions tagged [stm32]

The STM32 is a family of microcontrollers from ST Microelectronics, based on the Cortex M0, M0+, M3, M4, or M7 ARM core (depending on the product line).

The STM32 is a product line from ST Microelectronics using 32-bit Cortex-M microcontrollers and/or Cortex-A microprocessors. There are a variety of microcontrollers with different power consumption and performance characteristics. Some microcontrollers also offer DSP and floating point functionality.

In addition to the line of microcontrollers, ST also offers a number of different evaluation boards and development boards. These boards contain a microcontroller on a PCB with additional support electronics and various sample sensors. The STM32CubeIDE Integrated Development Environment supports software development for these products.

Two such product lines are the Discovery kits such as the STM32F0DISCOVERY and STM32F3DISCOVERY boards and the Nucleo product line of prototyping boards.

As of Q1/2023, the family consists of:

MPU

  • STM32MP1 - Cortex A7 & Cortex M4 big.LITTLE

Low Power

  • STM32L0 - Low-Power Cortex-M0+
  • STM32L1 - Low-Power Cortex-M3
  • STM32L4 / L4+ - Low-Power Cortex-M4
  • STM32L5 - Low-Power Cortex-M33
  • STM32U5 - Ultra Low-Power Cortex-M33

High Performance

  • STM32F2 - High-Performance Cortex-M3
  • STM32F4 - High-Performance Cortex-M4
  • STM32F7 - High-Performance Cortex-M7
  • STM32H5 - High-Performance Cortex-M33 (up to 1 GHz)
  • STM32H7 - High-Performance Cortex-M7 (up to 550 MHz)

Main Stream

  • STM32F0 - Mainstream Cortex-M0
  • STM32F1 - Mainstream Cortex-M3
  • STM32F3 - Mainstream Cortex-M4
  • STM32G0 - Mainstream Cortex-M0+ (upgrading STM32F0)
  • STM32G4 - Mainstream Cortex-M4 (upgrading STM32F3)

Wireless MCUs

  • STM32WB - M4/M0 with BLE, Zigbee
  • STM32WL - M4/M0 with LoRaWAN
5104 questions
16
votes
5 answers

How does the in-application programming for ARM (Cortex M3) work?

I'm working on a custom Cortex-M3-based device and I need to implement in-application programming (IAP) mechanism so that it will be possible to update the device firmware without JTAG (we'll use TFTP or HTTP instead). While the IAP-related code…
Roman Dmitrienko
  • 3,375
  • 3
  • 37
  • 48
16
votes
1 answer

STM32 internal clocks

I am confused with the clock system on my STM32F7 device (Cortex-M7 microcontroller from STMicroelectronics). The reference manual does not clarify the differences between these clocks sufficiently: SYSCLK HCLK FCLK The reference manual reads in…
K.Mulier
  • 8,069
  • 15
  • 79
  • 141
16
votes
6 answers

How to set STM32 to generate standard CRC32

I am trying to generate CRC with STM32L4 hardware modul. I would like to validate fatfs files so basically I have byte arrays. I am using this CRC generator. Unfortunately I cannot figure out how to set STM32L4 to generate the same result. I need…
David Molnar
  • 419
  • 1
  • 6
  • 14
15
votes
3 answers

ARM Cortex-M compiler differences

I'm about to develop some firmwares for Cortex-M cores on STM32 processors using C for my projects, and searching on the web I've found a lot of different compilers: Keil, IAR, Linaro, Yagarto and GNU Tools for ARM Embedded Processors. I was…
Fabio Angeletti
  • 311
  • 3
  • 12
15
votes
3 answers

When is .ARM.exidx is used

I am working on Contiki 2.7 with the mbxxx target. While building my code the linker complained about an overlap of .ARM.exidx and .data sections. After some tinkering around with the linker script contiki-2.7/cpu/stm32w108/gnu-stm32w108.ld I fixed…
user2668988
  • 267
  • 1
  • 2
  • 12
14
votes
1 answer

Why do STM32 gcc linker scripts automatically discard all input sections from these standard libraries: libc.a, libm.a, libgcc.a?

From the bottom of any auto-generated STM32CubeMx-generated linker script: /* Remove information from the standard libraries */ /DISCARD/ : { libc.a ( * ) libm.a ( * ) libgcc.a ( * ) } From the GNU Binutils ld (linker script) manual, 3.6.7…
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
14
votes
4 answers

How to configure VS Code to build and debug STM32 projects using cubeMX - Windows 10

I am new to the realm of STM32 programming and have been trying to find a suitable IDE for quite a while now. I know of all the other IDE's like Keil and IAR but the cost of buying them just to learn is far to steep for me at this point in time. I…
clixxclixx
  • 147
  • 1
  • 1
  • 7
14
votes
1 answer

What is the use of __IO & static keywords in C?

I was checking out some code written for STM32F microcontroller and I found these keywords used before initializing a variable. I would like to know what is the significance of using this "__IO" & "static" keywords? The line of code was given like…
Naasif
  • 495
  • 2
  • 6
  • 13
14
votes
1 answer

Allocating memory in Flash for user data (STM32F4 HAL)

I'm trying to use the internal flash of an STM32F405 to store a bunch of user settable bytes that remain after rebooting. I'm using: uint8_t userConfig[64] __attribute__((at(0x0800C000))); to allocate memory for the data I want to store. When the…
HammerFet
  • 841
  • 3
  • 10
  • 16
13
votes
6 answers

How do I debug unexpected resets in a STM32 device?

I'm doing some development in C with a STM32F107 chip and, at some point, the device began to reset when I call a specific function. I don't have a debugger and my debugging is just plain text over a serial port. I've used some other…
ivarec
  • 2,542
  • 2
  • 34
  • 57
13
votes
3 answers

STM32CubeIDE can only flash once, no SWD debugging

For a couple of years I have been using the mbed online compiler to create .bin files, and then flash them at the command line like this, using a ST-LINK/V2 USB dongle, and everything works flawlessly: st-flash write 01_blink.NUCLEO_F103RB.bin…
iforce2d
  • 8,194
  • 3
  • 29
  • 40
13
votes
4 answers

About STM32 HAL quality and performance

I'm about to start a new project on a classical STM32L4 based product. I have a good experience in ARM developpement but not in STM32 specifically. I am wondering what is the quality and performance of the STM32 HAL and low level drivers provided by…
Guillaume Petitjean
  • 2,408
  • 1
  • 21
  • 47
13
votes
5 answers

FreeRTOS: osDelay vs HAL_delay

While creating FreeRTOS application project with STM32CubeMx, there are two ways you can use to introduce delay, namely osDelay and HAL_Delay. What's the difference among them and which one should be preferred? osDelay…
ARK4579
  • 663
  • 2
  • 6
  • 16
13
votes
3 answers

Structs with enums are different in C and C++, why?

The task is to send data by I2C from Arduino to STM32. So I got Struct and Enums defined in Arduino using C++: enum PhaseCommands { PHASE_COMMAND_TIMESYNC = 0x01, PHASE_COMMAND_SETPOWER = 0x02, PHASE_COMMAND_CALIBRATE = 0x03 }; enum…
Bulkin
  • 1,020
  • 12
  • 27
13
votes
2 answers

STM32 Read-out protection via OpenOCD

The STM32 family of microcontrollers features a read-out protection feature so proprietary code can't be read out via the debug interface (JTAG or SWD). Using OpenOCD, how can I enable/disable the read-out protection via a SWD/JTAG interface? How…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120