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
5
votes
3 answers

STM32F4 I2C with DMA not working

I'm using one STM32F4 and I want to communicate with my LSM303 accelerometer. For that I'm using I2C, and just using I2C works fine but when I try to use DMA with it, it stops working. When I use HAL_I2C_Master_Transmit_DMA it works and I got the…
Victor Douet
  • 161
  • 1
  • 10
5
votes
4 answers

stm32l4 RTC HAL not working

I'm having a strange behavior with the RTC on a stm32L476 with FreeRTOS. It only reads the first time in RUN mode, RTC is working, because from run to run it saves the value of the internal register and is going up. Also if I do DEBUG when I put…
taquionbcn
  • 543
  • 1
  • 8
  • 25
5
votes
1 answer

External Interrupt triggered after setting pin

I'm trying to get the external interrupt running on a Nucleo-F030R8 and hit a wall. Everything is configured and runs just fine in step mode but when I'm connecting my board to another testboard with a simple jumper wire and run the same code, an…
5
votes
1 answer

Bootloader on STM32F303: built in from factory or externally programmed?

I have some background on ATMEL and ATMEL bootloaders and we are moving to ARM for a new project. In particular we will be using the STM32F303RET6. This essentially is a a Cortex M4 with a higher number of Analog input pins. I have been going…
Pedro Ramilo
  • 189
  • 2
  • 13
5
votes
3 answers

Best way to add delay/do nothing for n cpu cycles

I need to add a delay into my code of n CPU cycles (~30). My current solution is the one below, which works but isn't very elegant. Also, the delay has to be known at compile time. I can work with this, but it would be ideal if I could change the…
gugelhüpf
  • 85
  • 2
  • 10
5
votes
1 answer

What is missing to make stm32 ADC DMA work? Transfer Compete does not occur

I am using a stm32f3 discovery board and the HAL from CubeMX. I am trying to use 2 ADC channels at ADC4. I configured DMA in circular mode. Befor the main loop in main, I call: HAL_ADC_Start_DMA(&hadc4, DMA_adc4_buffer, 16); I implemented the…
maze
  • 789
  • 1
  • 7
  • 31
5
votes
2 answers

How to get time intervals on STM32?

I want to measure how long does a single function take on STM32. The only thing I could find is SysTick_Handler. However, that is an periodic interrupt, but what I need is get time interval like: long t1 = mcu_clock(); sleep(20); long t2 =…
Kevin Dong
  • 5,001
  • 9
  • 29
  • 62
5
votes
1 answer

STM32 LWIP PPPos implementation

On my STM32F7 I have to connect a 3G modem using serial port. I can communicate with the modem using AT commands. I would like to use PPPos (PPP over serial) library from LWIP to enter in PPP mode. So I take a long look at the official…
lgm42
  • 591
  • 1
  • 6
  • 29
5
votes
1 answer

Change priority level level of running interrupt handler?

I am trying to implement the following pseudocode on a cortex-m3 controller, (STM32L151 in particular) void SysTick_Handler() { do_high_priority_periodic_tasks(); // not to be interrupted lower_interrupt_priority(); …
5
votes
1 answer

FATAL error ST-Link No MCU device found

I'am using IAR Workbench and I am having hard time to flash my STM32F407VG I got: FATAL error ST-Link No MCU device found. The USB cable connecting the laptop and the MCU is new so I don't think it's the problem. ST-Link en.stsw-link009 is…
Mouin
  • 1,025
  • 4
  • 19
  • 33
5
votes
1 answer

STM32 dual CDC (VCP) class

I am using CubeMx in order to generate startup code for the USB virtual com port device. It works fine. But I need to implement 2 virtual com ports on 1 USB interface. I can't seem to find any source of information how to do it. Is it possible?
Łukasz Przeniosło
  • 2,725
  • 5
  • 38
  • 74
5
votes
1 answer

STM Nucleo I2C not sending all data

Edit: The solution was to turn down the I2C clock in the initialization block. Although the STM could handle it, the data sheet for the LCD stated it could handle only up to 10kHz. For the DMA there is an IRQ that must be enabled and setup in the…
5
votes
3 answers

STM32 SPI hardware and strict aliasing warnings

I've seen that the subject has been discussed in many other questions, but I can't quite find the answer for my particular case. I am working with a STM32F0 microcontroller. The top of the SPI reception/transmit FIFO are accessible by a memory…
5
votes
1 answer

How do I use the STM32CUBEF4 HAL library to read out the sensor data with i2c?

I want to use the latest HAL library instead of Standard Peripheral Library. And i want to readout the BMA250E G-sensor's chip_id, but it doesn't work. Value of aRxBuffer always keep at 0x00. But it should be 0xf9! What's wrong in my…
elecbuggy
  • 63
  • 1
  • 1
  • 5
5
votes
1 answer

STM32 CubeMX custom code generation

I'm use STM32CubeMX and trying to generate my custom code (UM1718 page 141) with tables of used periferals. It is easy to have constant tables in flash with periferals handles and instances grouped by intended use. For example this header…
imbearr
  • 999
  • 7
  • 22