Questions tagged [stm32]

The STM32 is the third ARM family by STMicroelectronics. It follows their earlier STR9 family based on the ARM9E core, and STR7 family based on the ARM7TDMI core. The STM32 is based on the ARM Cortex-M family of cores.

Filter by
Sorted by
Tagged with
49 votes
2 answers
71k views

STM32 Understanding GPIO Settings

In STM32 Standard Peripheral library, we need to configure the GPIO. But there are 3 functions which I not sure how to configure them; GPIO_InitStructure.GPIO_Speed GPIO_InitStructure.GPIO_OType ...
user avatar
  • 881
45 votes
5 answers
50k views

CMSIS vs HAL vs Standard Peripherals Library

So I'm switching from PICs to ARM and I bought an STM32F4 discovery board. So far I understand that to program it you can either access all registers directly in memory (obvious way) and also there ...
user avatar
  • 1,301
34 votes
8 answers
37k views

How do I develop for STM32 discovery on Linux? [closed]

I have an STM32 discovery board and would like to be able to program it on Linux. What is the easiest way to do this?
user avatar
31 votes
8 answers
8k views

Why do we need a bootloader separate from our application program in microcontrollers?

Why do we need a separate program in the same flash program memory of a microcontroller, specifically STM32F103, which is called a bootloader? What is special about it to keep it separate from the ...
user avatar
  • 1,391
30 votes
6 answers
94k views

How do I use the printf function on STM32?

I am trying to figure out how to use the printf function to print to the serial port. My current setup is STM32CubeMX generated code and SystemWorkbench32 with the STM32F407 discovery board. I see ...
user avatar
29 votes
2 answers
25k views

What is the difference between an injected and regular STM32 ADC channel?

The STM32F1's reference manual describes "regular" and "injected" ADC channels but is not clear on the difference. What is the difference between the two types and when might you use one or the other?
user avatar
  • 5,516
25 votes
3 answers
5k views

STM32F4 and HAL

So I've been experimenting a while with the STM32F407 (I'm new to ARM) and decided to write a simple app using the HAL libraries since it seems ST has discontinued the Standard Peripherals Libraries. ...
user avatar
  • 1,301
24 votes
3 answers
5k views

UART signal is "rounded"

I am trying to debug a UART driver for the STM32F405. It does not work above a certain baud rate (about 50 kBd). I connected it to a logic analyzer with analog capability, and I saw that the signal is ...
user avatar
24 votes
1 answer
19k views

What is the STM32 event EVENTOUT?

In the manual of my STM32, one of the GPIO Alternate Functions (namely AF15, see page 138) is called EVENTOUT. At no point is the event defined, or a use case given. What is the EVENTOUT alternate ...
user avatar
  • 10.7k
22 votes
10 answers
9k views

STM Microcontroller burns every time

I have some experience working with stm32 but I only ever used them on dev boards. I recently tried to solder stm32 and stm8 on a simple break-out board and program them with my st-linkv2 clone. On ...
user avatar
  • 391
22 votes
2 answers
5k views

Why does ST recommend 100 nF decoupling capacitors for a 72 MHz MCU? (And not 10 nF.)

I've been reading about decoupling capacitors, and I can't seem to understand why ST recommends 100 nF decoupling capacitors on a 72 MHz ARM microcontroller. Usually 100 nF decoupling ...
user avatar
  • 1,160
21 votes
8 answers
118k views

STM32 & ST-LINK - Cannot connect to MCU after successful programming

I have built my own board with STM32F7-45VGT6. I have successfully programmed it with ST-LINK v2 (not the original one though) and now I cannot even connect with MCU. I use ST-Link Utility from ST ...
user avatar
  • 1,537
21 votes
2 answers
37k views

Stm32 Event and interrupts

I started studying interrupts on stm32 specifically the stm32f4 discovery board. i found this example in which you have to press the button to start the interrupt and push it again to stop it. In ...
user avatar
21 votes
0 answers
2k views

Switch from JTAG to SWD with bitbang sequence on STM32F103VB

I am trying to switch from JTAG to SWD without any external devices. Why? Because I would like to use the SWO pin to send a stream of logging information to another device. To accomplish this ...
user avatar
  • 401
18 votes
4 answers
7k views

How does factory reset work?

All embedded devices includes a "Factory reset" option that allows the user to reset his device if something is wrong. I am developing a Firmware on an STM32 board. The firmware includes a boot ...
user avatar
  • 1,213
18 votes
2 answers
62k views

How to use external ST-Link to debug/program STM32F103 MCU?

I'm using STM32F103 MCU for my own project and want to use the ST-Link of STM32F411 Nucleo board for external debugging / programming purposes. I've set the CN2 jumpers OFF and my actual question is ...
user avatar
  • 301
18 votes
3 answers
37k views

How to program STM32 Development Board

I'm a total beginner with programming ARM microcontrollers, but I do have experience with AVR and PIC microcontrollers. A few days back I have purchased a STM32F103VET6 development board from eBay. I'...
user avatar
  • 343
17 votes
2 answers
19k views

STM32F2: Makefile, linker script and start-up file combination without commercial IDE

I have been working with an STM32F2 (specifically, the STM32F217IGH6 on a development board) for about two months. By far my biggest problem had to do with the "setup", which includes makefile, linker ...
user avatar
  • 10.7k
16 votes
11 answers
7k views

Why should interrupts be short in a well configured system?

Why should interrupts be short? I'm currently using STM32 and it has a feature of prioritizing interrupts. Because of that, I don't see any difference between these two options: the main loop and ...
user avatar
  • 551
16 votes
5 answers
40k views

Independent watchdog (IWDG) or Window watchdog (WWDG)?

I'm still searching to find an answer for this question: Why while the stm32 MCUs have a perfect watchdog (I mean Window watchdog (WWDG)), there is a simple watchdog (Independent watchdog (IWDG)) ? ...
user avatar
  • 4,540
16 votes
3 answers
12k views

Minimal code required to startup a STM32F4?

Which is the most efficient way/minimal code required to startup a STM32F4? The startup files that come from ST seem to have a lot of unnecessary code.
user avatar
  • 1,301
16 votes
3 answers
11k views

Recommendation for default settings for unused pins on an STM32 (ARM Cortex M3) - pull up/pull down?

We are currently using various variants of the STM32 microcontroller family. I would like to know the following: What are the recommended default settings for pins of the microcontrollers in general ...
user avatar
  • 1,237
15 votes
5 answers
17k views

Considerations when using internal pull-up/down resistors

I am working with STM32 micro-controllers. These micro-controllers have the option to set the input pin as pull up or pull down: Earlier I used to give external pull up or pull down resistor wherever ...
user avatar
  • 7,562
15 votes
3 answers
73k views

STM32: Performing a software reset

I am trying to perform a software reset of my STM32F2. (Reference manual available here.) The relevant page of the reference manual (page 80) gives little information. Basically, the ...
user avatar
  • 10.7k
15 votes
1 answer
1k views

Why is the MCU clock out waveform sinusoidal and not square pulse

I got a new oscilloscope :) (proud amateur moment) I am trying to visualize the internal clock of a STM32G431RBT6 MCU. So I built an example program given by the vendor which provides the MCU clock ...
user avatar
  • 151
15 votes
1 answer
38k views

Addressing registers with I2C STM32F0 HAL libraries

I'm very new to using STM's CUBE and HAL_libraries. I'm using an STM32F0 microcontroller with 32 pins. The schematic for I2C is correct. So I need a little help here. I have a capacitive sensor (...
user avatar
  • 153
14 votes
3 answers
1k views

High side mosfet 12V switch from isolated 3V3 GPIO

I want to switch power of 12V laser sensor from 3V3 STM32H753VI GPIO. I will power on or off for long time (It's not PWM here) I am not comfortable with Mosfet and Optocoupler so I need help to be ...
user avatar
  • 466
14 votes
6 answers
30k views

STM32: Timer interrupt works immediately

This is code for timer in my project on STM32F429: ...
user avatar
  • 329
13 votes
2 answers
3k views

Why does modulo operation consume more power?

I mainly use Cortex-M4F or Cortex-M0/0+ devices such as: STM32L4, G4 STM32L0, G0 I sometimes see blogs like this one saying "Avoid Modulo" for lower power consumption. Comparing these two ...
user avatar
13 votes
3 answers
12k views

How do I find out at compile time how much of an STM32's Flash memory and dynamic memory (SRAM) is used up?

I have the answer for Flash memory, but the RAM question still eludes me. Arduino has this super nice feature which displays flash and RAM usage right at compile time. Ex. in the image below you can ...
user avatar
13 votes
1 answer
26k views

STM32 "USB Device" vs. "USB OTG HS" - what is the difference?

I recently downloaded the stm32 app for MCU search and found out that for example STM32F429 has "NO" in "USB Device" peripheral, while it says "YES" in "USB OTG FS" and "USB OTG HS". Which is quite ...
user avatar
13 votes
2 answers
14k views

Using CCM (Core Coupled Memory) in STM32F4xx

STM32F4xx microcontrollers have 128KB of SRAM + 64KB of CCM SRAM. CMM SRAM is hardwired to data bus so it is impossible to use it with DMA. What is the reason to add additional SRAM as CCM? Does it ...
user avatar
13 votes
4 answers
80k views

STM32 ADC conversion using HAL

I am trying to learn how to use "new" HAL library from stm32. When I try to do simple ADC conversion it works just one time, but then it stops converting. I suppose End of conversion flag does not get ...
user avatar
12 votes
4 answers
12k views

When should one use an external crystal for this MCU given that the internal oscillator is much faster?

I am looking at this MCU and was wondering if it makes sense to use an external crystal. Extracted from the datasheet pg1, *Clock management – 4 to 32 MHz crystal oscillator – 32 kHz oscillator for ...
user avatar
  • 1,137
12 votes
3 answers
40k views

Clearing USART (UART) interrupt flags in an STM32?

I am using an STM32F105 to communicate with a Linx GPS chip using a UART. If I don't use interrupts (if I just poll the RX flag) then it works just fine. But I'm getting unexpected results when ...
user avatar
  • 16.4k
12 votes
2 answers
36k views

What free IDE does everyone use for the stm32? [closed]

I'm currently using Atmel SAM series. The choice was easy: IDE is Atmel Studio which is very good, free and I used it for developing AVR before. The debugger I have is the Atmel ICE which I also used ...
user avatar
  • 1,822
12 votes
3 answers
10k views

STM32F407 + LAN8720A + lwIP + FreeRTOS = No received Ethernet frames

I'm trying to bring up a PCB that uses an STM32F407 and LAN8720A Ethernet PHY, and I can't seem to receive any Ethernet frames — even though I have no problem transmitting frames. Hardware setup I ...
user avatar
  • 2,789
11 votes
6 answers
18k views

Why not always use DMA in favor of interrupts with UART on STM32? [closed]

I spend last month a lot of time getting UART (for MIDI) to work with an STM (STM32F103C8T6) using interrupts, without very much success. However, this evening using DMA it worked quite fast. Since ...
user avatar
11 votes
4 answers
4k views

Getting fast performance from a STM32 MCU

I am working with the STM32F303VC discovery kit and I am slightly puzzled by its performance. To get acquainted with the system, I've written a very simple program simply to test out the bit-banging ...
user avatar
  • 581

1
2 3 4 5
77