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
12
votes
4 answers

Is there a way on VS Code to import Makefile projects?

As the title said, can I populate automatically c_cpp_properties.json from an existing Makefile? Edit: For others trying to import makefiles, I have found a set of scripts that perform exactly what I wanted to achieve, the management of STM32…
Andrea Nisticò
  • 466
  • 2
  • 4
  • 11
12
votes
2 answers

How to use LL (low level) drivers in CubeMX STM32?

I'm creating a blank project for a STM32F103 microcontroller using STM32CubeMX. Using HAL drivers (the default), I got a blinky example working pretty quickly, but I'd like to try out LL (low level) drivers instead of HAL. When I go to Project >…
Alex I
  • 19,689
  • 9
  • 86
  • 158
12
votes
4 answers

First project for STM32 with HAL in C++

I would like to create a project for STM32 with HAL in C++. Unfortunately, CubeMX supports only projects in C. However, HAL support C++. I have created a project in CubeMX and I was trying to import it to any of the IDEs above but without any…
unitatem
  • 131
  • 1
  • 1
  • 9
12
votes
3 answers

Disabling the STM32 IWDG during debugging

I have a ChibiOS 3.x program on a STM32F4 microcontroller where I use the IWDG watchdog to reset the MCU on errors like this: int main() { iwdgInit(); iwdgStart(&IWDGD, &wd_cfg); while(true) { // ... do stuff } } If I now…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
12
votes
1 answer

Error: selected processor does not support ARM mode `wfi'

I'm getting the following errors while trying to compile an ARM embedded C program (I'm using YAGARTO as my cross compiler). I'm trying to work out what this error means and what are the steps to correct it. From the research I've done so far, the…
andre
  • 7,018
  • 4
  • 43
  • 75
11
votes
2 answers

Does anybody know any very basic stm32 tutorials?

Recently I've started on a project which requires a Cortex M3 processor. I have some previous experience with 8bit AVR microcontrollers, so I was hoping for a not to big transition. So I've bought a STM32L-Discovery kit (since low power is an…
luc
  • 111
  • 1
  • 1
  • 3
11
votes
3 answers

How can I change the start address on flash?

I'm using STM32F746ZG and FreeRTOS. The start address of flash is 0x08000000. But I want to change it to 0x08040000. I've searched this issue through google but I didn't find the solution. I changed the linker script like the…
Hans
  • 398
  • 2
  • 4
  • 14
11
votes
2 answers

Why does copying a structure by a direct assignment fail?

I am running into an Hard Fault Exception while copying some data on a micro-controller from one struct to another. I tried different implementations which should do all the same. See my code lines: memcpy(&msg.data, data, 8); memcpy(&msg.data,…
eDeviser
  • 1,605
  • 2
  • 17
  • 44
11
votes
2 answers

STM32F3 Discovery - Implement GPIO-Interrupt

I want to implement a GPIO-Interrupt, but I dont know how, I also found no real sample or explaination for it. I already know how to write to Pins, but not much more, please consider that I dont really have any knowlegde about c or programming…
Meister96Fels
  • 508
  • 1
  • 8
  • 26
11
votes
2 answers

reason 7 - target needs reset -- unreliable debugging setup

I am having trouble getting a reliable debugging setup. I have seen other threads in some forums across the net with a similar title, but the circumstances seem different. Setup: Linux (Xubuntu) 64bit Eclipse CDT, Neon 4.6.0 "GDB Hardware…
user1847129
  • 1,010
  • 2
  • 9
  • 21
11
votes
6 answers

Error in initializing ST-Link Device - Failed to connect to device

I am currently using the ST-Link debugger to program my STM32F3 Discovery Board. The IDE that I am using is Atollic TrueStudio 5.5.2. Now I am facing a very weird problem which is I keep on getting the message Error in initializing ST-Link Device.…
Leonard1995
  • 141
  • 1
  • 2
  • 10
11
votes
8 answers

Arduino millis() in stm32

I am trying to port some Arduino library to stm32. In Arduino, millis() returns the number of milliseconds since boot. Is there an equivalent function in stm32? I am using stm32f0 MCU.
user6064424
11
votes
1 answer

STM32 USB OTG HOST Library hangs trying to create file with FatFs

I am trying to create a file with FatFs on USB flash, but my f_open call trying to read boot sector for first time file system mount hangs on this function. DRESULT disk_read ( BYTE drv, /* Physical drive number (0) */ …
Mykola
  • 3,343
  • 6
  • 23
  • 39
11
votes
3 answers

STM32CubeMX USB CDC VCP?

I've found large number of examples, but nothing on how to do it "properly" from STM32MXCube. How do I create skeleton code from STM32CubeMX for USB CDC virtual COM port communications (if possible STM32F4 Discovery)?
user505160
  • 1,176
  • 8
  • 25
  • 44
11
votes
3 answers

Generating nanosecond delay in C on STM32

I am using STM32F2 controller and I am interfacing with an ST7036 LCD display via 8 bit parallel interface. The datasheet says there should be a 20 nano second delay between address hold and setup time. How do I generate a 20 nanosecond delay in C?
pranathi
  • 383
  • 4
  • 6
  • 16