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
6
votes
1 answer

Unwanted allocation in RAM if const is not used,despite placement at Flash absolute address

I'm using GCC. I create a SECTION in Flash by .ld linker file, I placed there some data (704 bytes) with directive __attribute__((section... Data appears to be in flash, but the same space is allocated in RAM if I don't use the const keyword while…
6
votes
3 answers

Qemu: fatal: Lockup: cant escalate 3 to Hardfault (Current Priority -1) error -Core Dumped

I am trying to emulate STM32F407XX controller with cortex M4 processor on QEMU. I wrote the .ld file as below: ENTRY(_Reset) MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K …
Chandrika Joshi
  • 1,211
  • 11
  • 24
6
votes
1 answer

How to write to STM32 Flash

I want to write to flash Sector 11 of STM32F407VGT from my user code to store some data. I have used the stm32f4xx_hal_flash.c library. I first erase the sector using this code: void Flash_Init(void) { FLASH_EraseInitTypeDef…
b7031719
  • 120
  • 1
  • 2
  • 8
6
votes
1 answer

Core Coupled Memory (CCM), Interrupts and STM32F3xx

I'm currently playing around with the STM32F303xx family of chips. They feature the core coupled memory (CCMRAM) which allows execution of code unlike the CCM found on the F4 series. I have put the critical routines (e.g ISR's) into the CCM and was…
L.K.
  • 63
  • 1
  • 4
6
votes
1 answer

Can't get STM32F103RB usart1 to communicate with hc-05

I am unable to connect USART_1 with bluetooth hc-05. The Microcontroller is STM32F103RB. Here's the code (I am not using any library) #define APB2_FREQ 72000000 void USART1_Send(char* data) { unsigned int length = 0; while(data[length]…
Muzahir Hussain
  • 1,009
  • 2
  • 16
  • 35
6
votes
1 answer

How are the HAL lock and unlock functions used and why?

I'm trying to understand code which is written by another programmer. It used I²C communication to write data on the EEPROM of an STM32 microcontroller. Generally I understood how his code works, but I can't understand why he used the HAL_LOCK and…
user8872869
6
votes
1 answer

What does this statement mean in C: "(void)ptr;"

It may not be clear from the title. I came across the following code in an embedded STM32 project. I don't understand the line inside the function. static void txend1(UARTDriver *uartp) { (void)uartp; // what does this do? Is it a…
TowerFan
  • 210
  • 1
  • 10
6
votes
1 answer

STM32 Freezing periphirals when pausing the debugger

Debugger can stop execution of code in Cortex when it reaches a breakpoint or user pauses the execurion of code. But does debugger freeze other periphirals like DMA, UART and TIMERS when cortex stops execuring the code in pause state?
Nixmd
  • 775
  • 5
  • 11
  • 20
6
votes
2 answers

STM32 ADC Continuous Conv Mode does not automatically start conversion

I am trying to configure ADC over a STM32F411RE in simple Continuous Conv Mode. I used CubeMX to generate the code based on HAL drivers and this is some parts of the generated code which intialize ADC: /* ADC1 init function */ void…
Nixmd
  • 775
  • 5
  • 11
  • 20
6
votes
1 answer

STM32 HAL timer interrupt isn't triggered

I'm trying to periodically send and Serial string from my STM32F746ZG device, using an interrupt. Most of the code is auto generated by stm32cubemx. I have hardware breakpoints (jlink) set at each interrupt but I only enter the period elapse…
Jelle Spijker
  • 183
  • 1
  • 1
  • 8
6
votes
1 answer

STM32 gcc (arm-none-eabi-gcc) links printf even though it is not used

I can't seem to figure out why some printf library functions get linked into my code from libc_nano.a even though I never use any printf. It steals at least 2K of valuable flash memory space. I can see the sections _printf_i, _vfprintf_r,…
hgabe
  • 141
  • 2
  • 9
6
votes
2 answers

stm32l0: Failed to execute MI command. Error erasing flash with vFlashErase packet

I'm using a Nucleo STM32L031 with AC6 STM32 workbench (eclipse). I write my application and go to debug mode, everthing was working well until I add another function in my application. I notice that when I remove/comment the "new_function", the…
BL_
  • 821
  • 1
  • 17
  • 23
6
votes
2 answers

How to flash STM32 via Serial Port

I have an STM32F102 microcontroller and I want to program it via the Serial Port. While there is a flasher available for windows, I want to do it on a Linux Machine. I tried doing it with this script I have set BOOT0 = 1 and BOOT1 = 0, restarted the…
RishabhHardas
  • 495
  • 1
  • 5
  • 25
6
votes
3 answers

Why can't write internal flash of same address twice

I'm trying to write to internal flash of STM32F1xxC (2KB per page), I can write to flash after a page erase, which converts every byte of that page to 0xFF. It's very strange that I can not write the same address of flash twice, it is only possible…
Arman Safikhani
  • 875
  • 10
  • 25
6
votes
1 answer

STM32F407 memory layout

I am trying to use Percepio trace lib for FreeRTOS in Snapshot recorder mode. After compilation and running it on my discovery board I need to somehow dump entire RAM to file. I've started ST-LINK utility but I am puzzled on how to dump entire…
user505160
  • 1,176
  • 8
  • 25
  • 44