Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

34
votes
2answers
50k 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 ...
28
votes
4answers
34k 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 ...
24
votes
8answers
30k 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. ...
18
votes
4answers
5k 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
1answer
27k 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
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 ...
17
votes
2answers
14k 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
3answers
35k 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
4answers
45k 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 ...
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
1answer
11k 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 ...
14
votes
5answers
25k 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)) ? ...
14
votes
2answers
45k 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 ...
13
votes
3answers
9k 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
7k 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
4answers
14k 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
14k 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 (...
10
votes
5answers
6k 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
1answer
20k 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 (...
10
votes
1answer
355 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/...
10
votes
1answer
642 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
1k views

Using the ST-LINK Utility to configure the RTC to current time

What I was doing I am using a STM32 microcontroller and for my project I need to be able to send data at specific times of the day (say, at 11am and 2pm). The microcontroller needs to know what time ...
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
2answers
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
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
6k 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
3answers
49k 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
5k 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
1k 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 ...
9
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.
9
votes
4answers
9k views

STM32 USB VCP bug

I have been working on a project for the past two weeks now and debugging this one issue has taken up this entire week. Wondering if anyone can help, I will try to be as explicit and clear as possible....
9
votes
3answers
44k 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 ...
9
votes
2answers
2k views

5V tolerance on VBUS sensing input

I am designing a device around the STM32L476. My device is primarily battery-powered, but has a USB port that, when plugged, I want to use as an alternative power source (through a 3.3V regulator) to ...
9
votes
2answers
15k views

STM32F4 Cube HAL UART. Is it a bug or am I missing something?

I am using interrupt based UART IO (no DMA). HAL_UART_Transmit_IT function sets EIE bit in ...
8
votes
2answers
2k views

Why can't I successfully send messages over RS232?

So the past week I have been working on getting UART messages sent from a STM32F407 and reading it on my laptop through a ugreen RS232 to USB cable using termite. I have used STMCube to generate ...
8
votes
7answers
58k 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 ...
8
votes
4answers
3k views

Interrupt latency on a STM32F303 MCU

I’m working on a project that involves a STM32 MCU (on the STM32303C-EVAL board to be exact) that has to respond to an external interrupt. I want the reaction to the external interrupt to be as fast ...
8
votes
2answers
441 views

Why are logically related bit fields in MCU registers often in separate locations?

Forgive me if this question has already been answered, but I was unable to find an answer either on this page or in the wider Internet. I'm an experienced developer with decent knowledge regarding ...
8
votes
2answers
22k 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 ...
8
votes
1answer
203 views

SPI on STM32 won't work without pullup resistors and even then performs poorly

I've been trying to get the SPI1 on the STM32F103C8 (Blue Pill board) working correctly for some time now. As I'm just starting to learn ARM, I am simply trying to shift data to a 74HC595 shift ...
8
votes
1answer
956 views

What's mean these microcontroller pin input/output modes?

I bought an stm32f103ret6. When I saw the reference manual, I saw that it has several I/O modes. For input: floating, pull-up, pull-down For output: analog, open-drain, push-pull I have already ...
8
votes
1answer
2k views

Cannot Program a Custom STM32 Board

I've designed a simple STM32 board. Below are the schematic and pcb layout pictures: Schematic: PCB layout: PCB layout with VDD hightlighted: PCB layout with GND highlighted: Only the parts of ...
8
votes
4answers
13k views

ST-LINK is serial communication possible?

I am using STM32F4 discovery board and Atollic TrueStudio for ARM Lite 3 I would like to pass some debugging data to PC using printf and I can't find a way to do it through STLink. Is it even ...
7
votes
3answers
6k views

Do I really need to put stm32 microcontroller into bootloader mode to program it?

I have started learning stm32 microcontroller for a while using a very small development board "stm32f103c8t6" (or blue pill). when I started, I learnt from some tutorials that I have to switch a ...
7
votes
3answers
22k views

How to stock variables in FLASH memory

I am working with a STM32 eval-board from STMicro which includes a ARM Cortex-M4 processor. I need a LUT for cosinus and sinus (read-only variables). I need to manage my RAM memory therefore I want to ...
7
votes
1answer
573 views

What does [WEAK] mean in STM32 startup assembly code?

I was reading the STM32F407 startup file in Keil software to gather some information. I faced this problem: What is the [WEAK] symbol used for? A part of the code ...
7
votes
4answers
3k views

My first STM32 code - please criticize me

I have just wrote my first code on STM32 - blinking LED. It combines a fragments from different sources; please criticize me so I can learn how to write proper code and don't learn stupid habits. <...