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
7
votes
1answer
4k views

LED blinks even when I don't press the button

I have written a program in Keil that blinks a LED via External GPIO Interrupt. Here is how I have configured it in STM32CubeMX: At first, I enabled and configured RCC as you can see and configured ...
7
votes
3answers
7k views

Error when compiling start-up file on STM32

I am attempting to provide custom interrupt handlers for my Cortex M3 (reference manual here). ST kindly provides a standard library, which has various startup files all called "startup_stm32f2xx.s". ...
7
votes
2answers
2k views

Unable to read file greater than 2K in FatFS

I am reading a file from the SPI Flash with FATFS file system, on STM32F103 platform running FreeRTOS. I can successfully read File of size less the 2048, but if read a file file of size greater than ...
7
votes
1answer
4k views

STM32F407 + LAN8720A + lwIP + FreeRTOS = No received Ethernet frames

I'm trying to bring up a PCB that uses an STM32F407 and LAN8720A Ethernet PHY, and I can't seem to receive any Ethernet frames — even though I have no problem transmitting frames. Hardware setup I ...
6
votes
2answers
4k views

STM32 RTC freeze when power is off

I am using an STM32F745VGT6 user board with Keil µVision 5. I want to use the internal RTC calendar with the internal clock (LSI). My question is: first power on clock start 02:00:00 then time is ...
6
votes
2answers
5k views

What's the difference between setting SysTick Interrupt in NVIC and using it as an exception?

I'm using an STM32F303 MCU and I've noticed that the SysTick can be set up to cause an exception, which seems to mentioned quite often in various User Guides. This way, it will have a priority level ...
6
votes
1answer
3k views

STM32F4 : Floating point instructions too slow

I'm working on an audio application on the Nucleo F411RE and I've noticed that my processing was too slow, making the application skip some samples. Looking at my disassembly I figured given the ...
6
votes
4answers
359 views

Is there a down side to setting the sampling time of a SAR ADC as long as possible?

In configuring the sampling time for the internal ADC of a micro-controller (STM32F446RE) to sample the output of a current sensor connected to a PWM controlled motor, the sampling is triggered at ...
6
votes
1answer
811 views

Inaccurate timer interrupt STM32

I wrote a simple program to toggle an LED on and off using the TIM1 interrupt on an STM32F0 discovery board. CLK Freq = 48MHz Prescalar = 48000 Auto Reload Register = 1000 Using the following ...
6
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,...
6
votes
2answers
2k views

STM32 GPIO Speed

Why do we need to set speed for GPIO Output pins in STM32? Just for remind : For Input pins, The STM32F4 Reference Manual on page 278 says that: The data present on the I/O pin are sampled into ...
6
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 ...
6
votes
2answers
753 views

How to debug STM32L433 Current leakage

I have a circuit board with STM32L433 that has around 320uA of baseline current draw in STOP 2 mode. Only LSE with a 32kHz crystal is active. The board has separate analog Vdda power which is ...
6
votes
1answer
513 views

EEPROM: Same driver for similar chips, different behaviours

I have two very similar eeproms (M24C01-x and M24C64-x), both driven by the same standard library provided for my STM32F2. For the M24C64-x, all is fine. However, the M24C01-x is interpreting the ...
6
votes
1answer
2k views

Why does usb have start of frame packets?

I'm developing some high-speed USB firmware for the STM32F746VG, and on page 1411 (under section 37.16.3, step 2), it tells me that I should enable start of frame interrupts. I know that usb hosts ...
6
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 ...
6
votes
1answer
2k views

STM32 interrupts and C++ don't go well together [duplicate]

I set up TIM3 to fire an interrupt in my project and it just wouldn't work. I tried everything I could and still couldn't find whats the problem. Then I created a clean project and copy/pasted only ...
6
votes
1answer
128 views

STM32F303: Clock sporadically dies away

The clock of my STM32F303CC (links to datasheet; for reference manual see here) sporadically dies away, resulting in highly decreased code execution speed (see picture below). I already replaced the ...
6
votes
2answers
22k views

STM32 - Problem debugging using openocd and st-link

I am trying to follow this guide "Installing a toolchain for Cortex-M3/STM32 on GNU/Linux" (available: https://www.olimex.com/Products/ARM/ST/STM32-H103/) with the STM32-H103 development board from ...
6
votes
3answers
10k views

Which ARM MCU family is better for beginners? [closed]

Which ARM MCU family is better for beginners? I mean which family: Is straightforward and easier to learn Has more/better learning and development resources available Has bigger and better ...
6
votes
1answer
17k views

ARM STM32 simulator like proteous and some good book to start with?

I want to get my hand dirty with ARM programming. I have 8051/PIC16F/PIC18F programing experience. I searched about ARM and find STM32 series cheap. But before buying i want to get handy with it via ...
6
votes
1answer
6k views

STM32 SRAM to DMA GPIO pins

I wish to transfer a large array of data to 8 output pins that are all on the same port. E.g. a 500 element 8bit array where each bit of each element represents the pin status. So 500 independent ...
6
votes
1answer
20k views

STM32F103 SPI Master example?

I want to use SPI master configuration and send some data just to capture it with Logic Analyzer. It seems that I cannot trigger on clock and capture anything. Using code from standard peripheral ...
6
votes
1answer
8k views

USB interface with STM32

I'm experimenting with native USB in STM32. I've not found any "step by step", or a little more well structured tutorial, how to implement CDC or mass storage for example. I've found some examples, ...
6
votes
4answers
2k views

Best practice for implemeting bare metal or lightweight OS flash file system?

I am looking at flash devices that are available for rewriteable data storage, and it's clear that they need either some sort of translation layer for an overlying file system (such as FAT) or a ...
6
votes
2answers
2k views

Overwrote STM32F4 ST-Link pins

I overwrote by mistake ST-Link programming pins PA13 and PA14. Now I cannot reprogram my chip. How could I fix the problem? Datasheet
6
votes
1answer
2k views

How to put “printf” on console Debug QEMU on Eclipse STM32F4

I create a blinky project to test a qemu simulator, but my printf`s not showing in the debug console. I create a project like official tutorial GNU MCU Eclipse. ...
6
votes
1answer
2k views

STM32 Semihosting - SIGTRAP received when printf called

Have followed this guide here (http://www.wolinlabs.com/blog/stm32f4.semihosting.html) to get semihosting on the STM32F103 working. Basically my goal is to get printf working over JTAG (ST-Link/v2). ...
6
votes
1answer
728 views

why trace_printf(“%f”,x); triggers a HARD FAULT on a stm32 MCU?

I'm using a stm32 F413ZH microncontroller with HAL libraries (mainly written to be used with c but can also be used with c++) in eclipse, actually I managed to completely configure eclipse including ...
6
votes
1answer
1k views

What is relation between ARM libraries

What is relation between CMSIS libs released by ARM.com, libraries provided by manufacture and GCC ARM libraries ? What is the exact purpose of each? Which of them Should I use?
6
votes
2answers
370 views

Detecting DMA overflow in arbitrary waveform generation

I'm generating a complex series of pulses on an STM32F103, essentially as described in the ST app note AN4776 General-purpose timer cookbook, section 5.3. As a quick summary, that means I'm using the ...
6
votes
1answer
4k views

USB CDC-ACM Class Driver on STM32F4 [closed]

Simply my project is to connect a Huawi USB modem to my STM32F407 Discovery board, and start using AT commands to send text SMS. so here is what I've and what I want :) I've OTG USB capability on my ...
5
votes
3answers
1k views

Why isn't there any EEPROM in STM32F4 MCUs? [closed]

Why isn't there any EEPROM in the STM32F4 series MCUs? Mostly I have Microchip MCUs and they have EEPROM available in them, but I just found out that it is not available in the STM32F4 MCUs... And it ...
5
votes
3answers
4k views

How to cut interrupt code to minimum?

I have some interrupt let's say from UART to make a real example: ...
5
votes
2answers
19k views

Using a GPIO pin as a power source

I have an STM32F2 (reference manual here) which is connected to a GPS receiver through 5 pins. One of these pins is a power supply pin for the GPS. All pins on the micro-controller are GPIO pins that ...
5
votes
2answers
802 views

How to correctly configure deepsleep for STM32L0xx

I'm trying to configure my Nucleo Board with a STM32L073RZ in deepsleep mode to get the lowest power consumption. To do that I use the mbed librairies with the deepsleep() function (This function use ...
5
votes
2answers
1k views

STM32F103: Can a timer can interfere with uart?

I have a simple program, which receives data from UART interface and drives a WS2812b led strip. So, I'm using USART3 to receive data (in IRQ mode) and T3C2 (timer 3, channel 2) to drive LEDs. Here ...
5
votes
2answers
7k views

Possible to power STM32 Nucleo boards with USB battery pack?

I have a wireless-transmitter module connected to a Nucleo board. The sensor draws power (~200 mA) from the Nucleo board's 3.3V out pin. Case A (successful): When I connect/power the Nucleo board ...
5
votes
2answers
580 views

DP83848 + STM32 & Failed EMC (massive spikes of 25MHz crystal harmonics)

So we've failed EMC two times now because of spikes of 25 MHz harmonics from 175 MHz to 300 MHz, especially 175 MHz, 225 MHz and 275 MHz with peaks easily 30-40 dBuV above noise floor measured with ...
5
votes
2answers
493 views

STM32F0 - run user program from SPI flash memory

I'm building an application based on the STM32F030F4P6 microcontroller. During the development of the firmware, I realized that the flash memory of the microcontroller is too small. Can I run my ...
5
votes
2answers
13k views

STM32 DMA: continuous peripheral to memory (array) transfer

I am trying to use a DMA in circular mode to transfer data from an ADC to an array that will hold the data. I need to concurrently use the incoming data (in this case, I am using AT commands to send ...
5
votes
2answers
673 views

Lightweight (subset) of standard C library (ANSI C library)

I'm porting standard C library for bare metal "OS" (ARM Cortex-M4, ARM GCC). I want to have functions like strlen, sprintf, (and memory allocator, maybe), etc. I've ported PDCLib and Newlib. Newlib ...
5
votes
1answer
18k views

How to get USART and USB-Serial working on the STM32F4Discovery Board?

I'm programming a STM32F407VG chip on the STM32F4Discovery board using CooCox CoIDE. I've stitched together a program based on some examples and tutorials I found online to get USART1 through pins ...