Questions tagged [stm32cubemx]

Anything related to the STM32CubeMX. It is a program to ease developers' life by reducing development efforts, time and cost. STM32Cube covers the STM32 portfolio.

STM32Cube includes the STM32CubeMX which is a graphical software configuration tool that allows generating C initialization code using graphical wizards.

STM32CubeMX

214 questions
33
votes
7 answers

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 in stdio.h that the printf prototype is defined…
user505160
  • 1,010
  • 5
  • 16
  • 26
13
votes
6 answers

Why not always use DMA in favor of interrupts with UART on STM32?

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 as far as I read DMA is faster and relieves the…
Michel Keijzers
  • 13,867
  • 18
  • 69
  • 139
9
votes
1 answer

STM32 interrupts and C++ don't go well together

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 the code that sets up TIM3 and interrupts and it…
John
  • 1,361
  • 2
  • 12
  • 23
9
votes
8 answers

STM32: Busy flag is set after I2C initialization

For the reference: the same problem is described there, but the author's solution doesn't work for me - I2C busy flag strange behaviour I used STM32CubeMX to generate project template with I2C peripherals initialization. Unfortunately it works…
Alexey Malev
  • 653
  • 3
  • 9
  • 20
8
votes
3 answers

STM32 - How does analog configuration of MCU pins affect the power usage?

When I was creating a new project using the STM32CubeMX, I saw a check box stating that setting all free pins as anlog will decrease the power consumption. I couldn't figure out how it works. How can configuring the free pins as analog decrease the…
Caglayan DOKME
  • 227
  • 3
  • 11
8
votes
1 answer

Cube IDE : Error: unknown type name 'HAL_StatusTypeDef'

I am taking code from a stm32f0 series and trying to convert it to a stm32l4 series dev kit. I have already changed the necessary addresses and include files that I needed to migrate, but I keep on getting the following errors in the…
user150963
  • 347
  • 1
  • 3
  • 12
8
votes
7 answers

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: /* TIM3 init function */ void MX_TIM3_Init(void) { …
oboist B
  • 83
  • 1
  • 1
  • 7
8
votes
4 answers

Toolchains for STM32CubeMX IDE: what to choose from?

I just installed the STM32CubeMX (original ST Microelectronics's ARM IDE if I understand right). Once installed I tried to open a new project for a DISCOVERY kit I have (STM32F0DISCOVERY). Howether after I proceed to Open project I faced with a…
Roman Matveev
  • 2,942
  • 7
  • 32
  • 75
7
votes
2 answers

FreeRTOS on STM32 - What API should be used: CMSIS-RTOS API (v1 or v2) or FreeRTOS API?

According to ST's user manual UM1722 "Developing wireless applications on STM32Cube with RTOS" there are two APIs available: Generic CMSIS-RTOS API (v1 or v2) FreeRTOS API The CMSIS-RTOS API located in the CMSIS_RTOS_V2 folder generated by CubeMX…
Fedor Chervyakov
  • 71
  • 1
  • 1
  • 3
7
votes
1 answer

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 PA0 for external interrupt and PB1 as output. For…
Roh
  • 4,598
  • 6
  • 41
  • 86
5
votes
5 answers

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 STM32f103rb Nucleo card combined with an MPU6050…
Nelle
  • 51
  • 1
  • 1
  • 3
4
votes
4 answers

Did I kill my STM?

I have (had?) an STM32F429ZI. I was working with the ADC on PC0 and due to a hardware malfunction, 12V ran through the pin when the maximum voltage an ADC pin supports is 3V. Since then, whenever I connect the STM to my computer via the USB in CN1,…
4
votes
1 answer

Why operations on float variable are performed on a double? STM32F401RE, MDK-ARM v5

I am debugging a simple line of code: float temp_f; ... ... temp_f= temperature[0] +(temperature[1] >> 5)*0.125; that is assembled into 316: temp_f= temperature[0] +(temperature[1] >> 5)*0.125; 0x080018CE 4C1C LDR …
4
votes
3 answers

How to debug current consumption with STM32 Nucleo board?

I'm trying to configure an STM32L011-Nucleo developement board to consume about 600 uA of current or so. It uses an STM32L011K4. The datasheet states that this should be possible if I drive the MCU at 8 MHz and keep it in sleep mode for most of the…
Roman Matveev
  • 2,942
  • 7
  • 32
  • 75
4
votes
1 answer

Why does STM32 use a two-stage initialization process? What is the primary purpose of each stage?

I'm learning to use STM32 microcontrollers using CubeMX to generate a project. I've noticed that CubeMX generates two basic stages of initialization for nearly every peripheral: (A) Within the stm32fxxxx_hap_msp.c file, it defines a number of…
ChalkTalk
  • 211
  • 1
  • 9
1
2 3
14 15