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
8
votes
2 answers

What is the maximum speed of the STM32 USB CDC?

I'm using an STM32L151 to communicate with a PC using USB CDC. I used the STM32 HAL libraries to create my project. I found that the USB sends data in 1 ms intervals, and each time 64 bytes are being sent. So, is the maximum speed of the USB CDC 64…
Mohammad
  • 79
  • 1
  • 2
  • 3
8
votes
1 answer

STM32 RTC Timeout during initialization

I am trying to initialize the RTC on a STM32F469I-DISCO board. Since I am still learning, I tried to play with the HAL API that allow me to achieve some projects till the day I'll get enough understanding of this microcontroller to play with…
vionyst
  • 487
  • 2
  • 6
  • 14
8
votes
4 answers

How to work with WinUSB?

This is a follow-up to my previous question, Need to write driver for USB peripheral device? Background I'm working on designing a USB peripheral using an STM32 microcontroller (bare metal / no OS). The device will occasionally be connected to a…
cp.engr
  • 2,291
  • 4
  • 28
  • 42
8
votes
5 answers

Makefile linking: undefined reference to _exit

I have been trying to create a neatly-organized makefile project template utilizing the ARM mbed library. I have already solved a few of the problems (see this post) related to header file paths. However, now I am having problems with the linker. My…
Caleb Reister
  • 263
  • 1
  • 2
  • 9
8
votes
1 answer

EEPROM emulation on stm32 using HAL drivers

I am trying to emulate EEPROM on stm32f0. There is an application note provided by STM. In the sample main.c, int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit()…
user6064424
8
votes
7 answers

How can I start and stop a timer on STM32?

I have a big problem. I don't know how I can stop a timer with a button and restart the timer with another button. This is the code that I have for it so far: This code is the interrupt handler for the button that starts the timer. I thought that…
Sandeerius
  • 377
  • 2
  • 7
  • 15
8
votes
4 answers

How can I use hardware NSS (SPI) on STM32F4?

I tried to use the hardware NSS signal with the HAL library, but I can't find any function to make the NSS pin have a low or high level. I also tried to find the answer in the HAL documentation, but there isn't any information there either. All…
mkom
  • 103
  • 1
  • 1
  • 8
8
votes
1 answer

STM32 DMA transfer error

I use STM32F407VTG6 controller and try to receive data from SPI using DMA. Then I want to process data on DMA Complete Transfer Interrupt. But when Complete Transfer Interrupt is occurred I see that TEIF (transfer error interrupt flag) is set. After…
Goshik
  • 83
  • 1
  • 1
  • 5
8
votes
2 answers

Why do I have to enable peripheral clocks one at a time?

In a minimal STM32 application I've written that writes characters to USART1, the USART doesn't seem to work when I try to enable all the clocks I need at once: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA |…
user149341
8
votes
2 answers

Clock configuration of RTC in Stm32L in LSI/LSE/HSE only?

I am implementing Real Time Clock on STM32L152RB Discovery board using IAR compiler. I have implemented the Clock configuration on HSI and using PLL I have multiplied it by 4. Code --> /* Enable HSI Clock */ RCC_HSICmd(ENABLE); /*!< Wait till HSI…
Ishmeet
  • 1,540
  • 4
  • 17
  • 34
8
votes
4 answers

Processor Instruction Cycle Execution Time

My guess is that the __no_operation() intrinsic (ARM) instruction should take 1/(168 MHz) to execute, provided that each NOP executes in one clock cycle, which I would like to verify via documentation. Is there a standard location for…
bunkerdive
  • 2,031
  • 1
  • 25
  • 28
7
votes
2 answers

Advice on linker script creation and verification

Long story short. I wish to learn how to create a good linker script so that should I change platforms/architectures/vendors, I'm not stuck at ground zero again with not knowing what to do. I'm not concerned with the difficulty of the task, so much…
Crewe
  • 303
  • 2
  • 8
7
votes
4 answers

How to change the UART baud rate after running on STM32 board?

I'm using STM32F746ZG and use five UARTs. All UARTs are working fine. Can someone tell me the procedure to change the baud rate on the USART once it has already been initialized? I'm using USART6 and initialized with 9600 baud rate. After booting,…
Hans
  • 398
  • 2
  • 4
  • 14
7
votes
7 answers

Detecting open PC COM port from USB Virtual Com Port device

I am using an STM32F105 microcontroller with the STM32_USB-FS-Device_Lib_V3.2.1 USB library and have adapted the VCP example for our purposes (integration with RTOS and serial API). The problem is that if the USB cable is attached, but the port is…
Clifford
  • 88,407
  • 13
  • 85
  • 165
7
votes
1 answer

What are valid values of `HAL_NVIC_SetPriority()` when using STM32 and FreeRTOS?

After a rather difficult process of learning some things about interrupt priority, I am still a bit stuck trying to understand what values I am allowed to call for HAL_NVIC_SetPriority() on the SysTick_IRQn (which is the ISR calling the FreeRTOS…
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265