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
46
votes
2answers
60k 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 ...
36
votes
5answers
41k 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 ...
29
votes
8answers
5k 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 ...
29
votes
8answers
33k 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?
24
votes
3answers
4k 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. ...
23
votes
3answers
4k 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 ...
22
votes
10answers
8k 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 ...
22
votes
2answers
18k 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?
21
votes
6answers
64k 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 ...
19
votes
1answer
14k 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 ...
18
votes
4answers
6k 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 ...
18
votes
2answers
4k 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 ...
18
votes
2answers
31k 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 ...
17
votes
2answers
54k 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 ...
17
votes
3answers
36k 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'...
16
votes
2answers
18k 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 ...
15
votes
11answers
4k 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 ...
15
votes
5answers
31k 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)) ? ...
15
votes
3answers
9k 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.
15
votes
3answers
10k 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 ...
14
votes
0answers
659 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 ...
13
votes
7answers
78k 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 ...
13
votes
1answer
27k 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 (...
12
votes
5answers
10k 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 ...
12
votes
4answers
9k 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 ...
11
votes
4answers
3k 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 ...
11
votes
4answers
16k views

Endian problem on STM32

I'm using arm gcc (CooCox) to program an STM32F4discovery, and I've been wrestling w/ an endian problem I'm sampling with a 24 bit ADC via SPI. Since three bytes are coming in, MSB first I had the ...
11
votes
7answers
15k views

I2C slave address not acknowledged (sometimes)

I'm trying to communicate with a remotely connected FRAM (FM24C04 from Ramtron) by using I2C. This memory is embedded on a board that can be inserted and removed at any time to/from the system (...
11
votes
1answer
560 views

Understanding STM32 datasheet regarding decoupling capacitors

I'm trying to understand what ST recommends for decoupling caps for STM32F030CC. The diagram in the datasheet shows "2x100 nF" caps on the Vdd/Vss pairs. Does this mean 2 parallel 100nF caps per Vdd/...
11
votes
2answers
31k 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 ...
10
votes
3answers
6k views

Software interrupt vs function

After about 3 years of working with MCUs still I don't know what's the use of Software interrupts? I have done several jobs with STM32 and I have never used the software interrupts. Indeed this is a ...
10
votes
4answers
1k views

Bare-metal start-up code for Cortex M3 .bss region initialization

I have developed inspired from here a bare metal start-up code for arm cortex M3. However, I encounter the following problem: suppose I declare an uninitialized global variable, say of type unsigned ...
10
votes
2answers
2k views

Quad SPI PCB layout

I am trying to make a good layout for the Quad SPI NOR flash memory MT25QL256ABA1EW9-0SIT with the STM32 MCU. My problem is that I find the memory chip pinout quite inconvenient. I have managed to ...
10
votes
1answer
17k 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 ...
10
votes
1answer
10k views

What's the usage of the three boot mode of STM32f103?

If you see in refrence manual of STM32f103, you can see three boot mode for it. well, What's the usage of the three boot mode? please say to me by example for each mode.
10
votes
1answer
895 views

Detect which momentary switch caused a STM32 cpu to wakeup

Edit: This question is wrong. The stm325105 has only one wakeup pin. But other ST-parts has more than one wakeup pin, so the given answer is valid for those. I have a stm32f105 that has two momentary ...
10
votes
4answers
20k views

STM32: Timer interrupt works immediately

This is code for timer in my project on STM32F429: ...
10
votes
4answers
60k 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 ...

1
2 3 4 5
59