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.

7
votes
2answers
17k views

How to Use an External ST-Link/V2 with the STM32F4 Discovery Board

I have a STM32F4 Discovery board and a ST-Link/V2 programmer. I want to use my own ST-Link (not the embedded one) for programming and debugging the board. How should I connect the external ST-Link ...
5
votes
4answers
8k views

External power to STM32F4 Discovery board

I've recently finished programming the STM32F429ZI DISC1 board. I'm fairly new to this and now want to move away from connecting it to the PC via USB and power it up via a power supply. At present I ...
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 ...
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 ...
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 ...
3
votes
2answers
17k views

Problems connecting ST-Link V2 and STM32F4 discovery board

I'm unable to connect to my STM32F4Discovery board using an ST-Link/v2. I've removed jumpers from CN3, connected the cables correctly but the utility tool won't detect anything... Using the ST-Link/...
2
votes
3answers
3k views

Implementing a low cost battery backup circuit for internal RTC in STM32F030R8

Extension of this question. Datasheet: http://www.st.com/resource/en/datasheet/stm32f030f4.pdf The micro-controller in question has an internal RTC module but no VBAT pin. As such, the only way RTC ...
2
votes
5answers
5k views

STM32 HAL_CAN_Transmit always returns TIMEOUT (HAL_CAN_STATE_TIMEOUT)

Setup I am using an STM32F103C8T6 (aka Blue Pill). With the STM32Cube I set CAN_RX to PB8 and CAN_TX9 to PB9 (these are defaults/nonchangeable). Circuit simulate this circuit – Schematic ...
4
votes
2answers
15k views

Reading internal temperature sensor STM32

I'm trying to read internal temperature sensor. Each time, the value from ADC conversion is 296 which results in negative temperature. Should I add something to the code below, enable some peripheral ...
2
votes
4answers
18k views

How to use timers in STM32 board and HAL library in order to measure speed of motor?

I need to measure the speed of a rotating motor fitted to an encoder disc with 20 slots. The LM393 based sensor is kept at the right place, so that encoder disc rotates in between the sensing part. I ...
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 ...
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 ...
5
votes
5answers
24k views

Set STM32 GPIO clock and data pins as fast as possible

I have an STM32 that toggles nine GPIO pins repeatedly (one clock pin and eight data pins to load an FPGA image using SelectMap). I am doing this using the standard library function ...
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 ...
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 ...
4
votes
2answers
364 views

Why aren't pins on microcontroller grouped together, close to each other?

Simple question, the curiosity is killing me. Why do microcontrollers (and other IC also, like RAMs) have pins not grouped together? Like in STM32, for example you have portA and it has 8 bits on ...
3
votes
2answers
2k views

Understanding the the setup of a Timer on an STM32F10x

I'm trying to understand how to correctly setup the timer on an STM32F10x. The board is running with an external crystal of 16 MHz, and I'm using the PLL: ...
2
votes
2answers
673 views

Timer1 remap cause debug crash on STM32F103

I build a Keil project for my STM32F103 MCU with STM32CubeMx. My goal is use the TIM1 channel 2 for control a Buzzer. I want to generate a PWM at 4KHz through TIM1 channel 2. I configured, with ...
1
vote
1answer
244 views

STM32F4 USART Receiver Pin Configuring

I am trying to configure STM32F4 USART peripheral. I thought that USART Receiver pin(RX) must be programmed as Alternate function to USART works correctly and then the data is present on the I/O pin ...
4
votes
1answer
2k views

USB termination on STM32F437xx

I'm about to layout the USB connection on our boards and wondering whether the termination resistors and pull-up on D+ are necessary when using the STM32F437xx. The datasheet tells: ...
3
votes
1answer
6k views

Driving a LED with an open drain digital output

I need to drive an LED from an STM32F217ZG. So I was thinking about a classic circuit with a BJT. But then I saw that GPIO outputs of the microcontroller are configurable as open drain. Would this ...
2
votes
1answer
384 views

I2C bus occupied

I have a problem with an I2C communication and want you to ask whether there is a better solution than mine. I am programming an STM32F103 at the moment. There is one sensor (MPU6050) which is ...
1
vote
1answer
1k views

Using STM32 to transfer a file via bluetooth

So far I have been doing projects with Arduino, RPi, ATtiny etc. But now I have project in mind where these things doesnt seem to suit. I need your help. OK, now on the project: I have a file on my ...
1
vote
0answers
175 views

STM32F4 OC Clock Jitter

I am using STM32CubeMX to configure an STM32F4 to output a clock signal using Timer 3, Channel 4 on PC9. I have read in the datasheet PLL section that jitter shouldn't be more than 15ps RMS but I am ...
0
votes
5answers
317 views

Output impedance of STM32H743 MCU?

How do I find the output impedance of the STM32H743 (and potentially other similar devices)? I've looked through the datasheet (DS12110 Rev 5) and the reference manual (RM0433 Rev 5) however haven't ...
0
votes
1answer
1k views

STM32: Manchester coding bit banging implementation problem

I want to use Manchester Coding for my DALI Master-slave project. I am using two boards for this project, one is STM32E407 and the other is STM32F3Discovery. As an initial step, I want to test for ...
13
votes
3answers
7k 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.
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?
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 ...
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 ...
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 ...
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 ...
2
votes
5answers
6k views

I2C busy flag strange behaviour

I've been using STMCUBE combined with Keil for some time now. For most part I like the HAL library and the documentation for STM32f1xx drivers is quite good. I'm doing a project where I am using ...
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 ...
5
votes
1answer
3k views

What's the concept of these three options for configuring the memory of STM32?

I have read the STM32F10x Reference manual but a section about "Reading the Flash memory" is not clear to me, yet. I mean this part(page 59): I have several question: What's the Latency? in fact I ...
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
7answers
53k views

Getting PWM to work on STM32F4 using ST's HAL libraries

I'm trying to switch to the ST HAL libraries and can't seem to get the PWM to work. Compiles fine, just doesn't start. In my main() I call the Timer initialization function: ...
5
votes
1answer
2k views

STM32F3 Discovery + GNU ARM plugin + OpenOCD - cannot load the binary onto the board

I'm using the GNU ARM plugin for Eclipse with Open OCD as a debugger. This is on Windows 10 x64. The problem I'm facing is the following error when trying to debug or run the sample program: Error ...
5
votes
3answers
9k views

Supercap charging circuit for RTC backup on STM32

I'm asking for a reliable/simple/cheap circuit for the VBAT section of a STM32 design, powered at VDD=3.3V, that will safeguard the built-in RTC (based on 32768 Hz Xtall) for like 10 days. Based on ...
4
votes
1answer
13k views

Why use STM32 HSE?

Why do we use an external oscillator for STM32??? Why not just use the microchip oscillator? I am using STM32F2xx it clocks at 120Mhz But, an external oscillator of 12Mhz is latch into the microchip,...
3
votes
3answers
13k views

High resolution system timer in STM32

I have some software running on an STM32F103 (I'd also like to be able to use the F4) where I'd like to be able to 'timestamp' events (such as interrupts on external pins) to the nearest microsecond (...
2
votes
1answer
9k views

TLP280-4 Optocoupler on 12/24V inputs

There is a STM32 device which has to detect several signals from other devices. The voltage of these signals can be 12V or 24V. Also these signals can be positive (i.e. 12/24V) or negative (connected ...
1
vote
1answer
3k views

STM32 prototype unable to connect to PC using ST-Link/V2 SWD

Circuit Diagram Background & What I have tried. I have wired wrapped this setup myself using a fresh STM32F411RC MCU from digikey (on a proto-advantage LQFP-64 to DIP-64 breakout board). I've ...
7
votes
3answers
2k views

How to program multiple STM32Fs on same PCB

I work in a management roll and only have a very limited electronics knowledge (enough to make simple arduino projects etc). We are working on a product at the moment which has 3 STM32F303s and 2 ...
5
votes
1answer
17k views

STM32 Interrupt Priority (preemption) Problems

I have another problem (High resolution system timer in STM32) which I have tracked down (mostly) to this issue, and have created a test case here for the simplest STM32 processor I could find (on the ...
3
votes
1answer
14k views

Storing settings/data on microcontrollers non-volatile memory (STM32F103)

I want to be able to store values in a non-volatile memory so that the microcontroller can load these settings at start up. These settings might change at run-time and it is important for the systems ...
3
votes
1answer
12k views

STM32 Rotary Encoder with Hardware Interrupts

I'm trying to get a rotary encoder working on my STM32. I have channel A & B being pulled up to 3V and debounced with 1uF capacitors. The board has channel A & B connected to PA11 & PA10 ...
2
votes
2answers
2k views

STM32 custom board

I want to make a custom board from STM32F4. Suppose I follow schematics with the minimum required components, like crystal, reset switch, voltage regulator, JTAG connection, etc. and assemble them on ...
2
votes
3answers
774 views

Is this power switching circuit ok? Switching between VIN and USB

I am using a STM32F105FBT6 to create a CANbus analyser. I plan to have a simple PC application that displays the CAN messages and lets the user put messages onto the Bus. I also what to be able to ...
2
votes
3answers
2k views

CAN Initialization Timeout Error in STM32F4

I am using an STM32F446ZET6U Nucleo Board (programmed with CubeMx and Keil uVision 5) and I try to use some of the ST's examples in order to learn about its peripherals. I am stuck with the CAN ...