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
48
votes
2answers
69k 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 ...
21
votes
8answers
110k 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 ...
9
votes
2answers
29k 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 ...
18
votes
2answers
61k 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
2answers
749 views

What could be the reasons for a stepper motor stuttering with an A4988 driver?

I am using an A4988 Stepper Motor Driver, which is controlled with an STM32F767ZI on a Nucleo 144 board. The stepper motor takes 12 V with a maximum of 350 mA. When powered, the motor simply flickers ...
1
vote
2answers
3k views

SPWM vs 6-step PWM vs SVMPWM

While learning 3-Phase scalar control of ACIM using STM32F407 MCU I could not clearly understand the diffrence between the following terms: 1. SPWM 2. 6-step PWM 3. SVMPWM How do they differ from ...
5
votes
4answers
12k 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 ...
5
votes
5answers
13k 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 ...
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 ...
4
votes
2answers
31k 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
5answers
10k 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 ...
2
votes
3answers
6k 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 ...
4
votes
2answers
34k 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 ...
3
votes
4answers
27k 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 ...
0
votes
1answer
252 views

Generate N pulse with a fix frequency STM32f107

I need to know how to generate N pulse with STM32f107 without any external sampling. Could you provide me any good reference? Thanks
43
votes
5answers
48k 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
2answers
35k 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 ...
8
votes
5answers
31k 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 ...
12
votes
4answers
76k 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 ...
3
votes
2answers
4k 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 ...
9
votes
1answer
1k 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 ...
5
votes
2answers
4k views

Configuring the DMA request multiplexer on a STM32H7 MCU

I have recently switched to the newly-produced SM32H7 MCUs and I am currently in the process of migrating some of my old code to them (I want to see how they handle some applications that require a ...
11
votes
1answer
1k 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/...
5
votes
2answers
467 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 ...
4
votes
2answers
897 views

Switching HV DC relay on crashes microcontroller

So I´ve designed a PCB for a Pre-/Discharge Circuit for a 400V DC system which is controlled by a STM32 microcontroller. When powered the program waits for 1s and then starts by switching the (...
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
0answers
115 views

Looking for help improving power control circuit

I am looking for ideas on improving the circuit below. Any constructive criticism is very much appreciated as well. The following is a long explanation how I arrived at this monstrosity, it can be ...
2
votes
1answer
7k views

How to overwrite flash memory on STM32L series

I am trying to write a known pattern (ie 0xFFFFFFFF or 0x00000000) on top of already written flash memory, to invalidate portions of it for a primitive file system. But it doesn't work for me on the ...
2
votes
2answers
1k 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
886 views

ILI9341 with STM32 SPI troubles

I am trying to interface with an SPI ILI9341 screen using an STM32 microcontroller. I know there are a whole lot of things that can go wrong with these interfaces, and I've spent an awful lot of time ...
1
vote
1answer
699 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 ...
0
votes
1answer
4k views

Looking for STM32F4 Vdd 5V

I have to replace Renasas M30853 MCU with STM32F407 MCU in a circuit. The earlier MCU uses power supply Vdd = +5V as well as all the analog and digital circuit that is connected with it. How can I use ...
4
votes
2answers
2k views

STM32 SPI not working as I expect it should based on online reading

I am using an STM32F103C8 to connect to a Hope RF95W transceiver IC for the purpose of learning. I am only trying to read the chip version register, then write a config register that has a 0x00 reset ...
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
8k 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
986 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 ...
2
votes
5answers
2k 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 ...
1
vote
1answer
2k 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
1answer
2k views

NRST pin of unpowered STLINK V2

I am using the STLINK from a Nucleo board in order to flash and debug a STM32F7 MCU on a custom board. Everything works fine except when STLINK is connected to my custom board AND unpowered. Indeed, ...
1
vote
0answers
330 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
2answers
3k views

STM32F10x microcontroller debugging problem

I'm a beginner and I'm using STM32F10x family to learn about electronics.I was using STM32F103 blue pill in the past few months and I can debug it and upload code to it while both boot0 and boot1 are ...
0
votes
1answer
3k 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 ...
0
votes
1answer
85 views

What pins on a nRF51822 do I connect to a STM32 programmer?

I want to be able to program a nRF51822 with this programmer but I'm not sure what pins on the actual chip I should use, and all the guides seemed to be using a different chip
-1
votes
2answers
437 views

How does one send data through UART from MCU to your PC without any connections on TX/RX pins?

I have been reading up on UART, and I see it works by connecting TX<->RX and RX<->TX of receiver and transmitter. The example I couldn't wrap my head around though is your MCU being able to TX ...
16
votes
3answers
11k 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.
34
votes
8answers
36k 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?
17
votes
2answers
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 ...
29
votes
6answers
88k 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
1answer
36k 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
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 ...