Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
41
votes
2answers
54k 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 ...
29
votes
5answers
37k 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 ...
28
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 ...
26
votes
8answers
31k 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?
23
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. ...
22
votes
10answers
7k 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 ...
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
6answers
51k 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 ...
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
16k 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?
17
votes
1answer
29k 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
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
17k 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 ...
16
votes
2answers
49k 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 ...
16
votes
1answer
12k 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 ...
15
votes
5answers
28k 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)) ? ...
13
votes
3answers
8k 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.
13
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: 1) What are the recommended default settings for pins of the microcontrollers in ...
12
votes
4answers
8k 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
2k 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
7answers
66k 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 ...
11
votes
1answer
23k 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 (...
11
votes
4answers
15k 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
408 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
0answers
409 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 ...
10
votes
5answers
7k 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 ...
10
votes
3answers
5k 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
948 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
1answer
9k 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
736 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
3answers
6k views

What happens on the STM32 when two pins are configured to have the same alternate function?

Reading through the STM32F051 manual, it looks like it's possible to configure the same alternate function on two pins; for example, you could have multiple USART1_TX pins at the same time. Or for ...
10
votes
3answers
5k views

Eclipse + GNU ARM + STM32 - HAL or SPL

I am going to start with ARM development (after 2 years of AVRs) and have picked up the STM DISCOVERY board with the stm32f4 microprocessor on it. I have decided to go with eclipse + ARM gcc since I ...
10
votes
1answer
20k views

How to start with STM32F103C8T6 board?

I have been using an 8-bit AVR MCUs to build line-follower robots with students for a few years now. Now I would like to step up to an ARM Cortex-M3 because I'd like to add some more CPU-intensive ...
10
votes
3answers
7k views

Choosing a SDRAM pcb layout

I'm working on a project with the quite new STM32F429 in LQFP208 package. I need to solder the first couple of prototype by myself for low budget reason. I choose this package so I could check myself ...
9
votes
6answers
11k 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 ...
9
votes
3answers
54k 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 ...
9
votes
4answers
6k views

What are the differences between rand() function and RNG (Random number generator) peripheral?

I'm wonder for RNG (Random number generator) peripheral in STM32F4XXXX MCUs. look in this Reference Manual (page 748). On the other hand, we have the rand() function in stdlib library that do the same ...
9
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 ...