cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup SMPS Supply source in STM32CubeMX?

Tuoman
Senior II

Hi,

I want to configure my STM32H7 MCU to use SMPS configuration.

I try to select RCC -> Supply Source -> PWR_DIRECT_SMPS_SUPPLY, but then get build error

Src/main.c:136:26: error: 'PWR_DIRECT_SMPS_SUPPLY' undeclared (first use in this function)

This is because "SMPS" is not defined. I try to define this manually typing #define SMPS in stm32h7b3xx.h (it is in stm32h7b3xxq.h example projects), but again got more build errors in various lines that SMPS and many more is not defined.

Where am I supposed to define and configure this? Is the STM32CubeMX supposed to work this way or is it a bug?

EDIT, additional info:

My project does not contain stm32h7b3xxq.h files, only stm32h7b3xx.h. The Q-file includes a lot of power related defines (e.g. PWR_CR3_SMPSEN).

Why my project is missing these "Q files"? Why STM32CubeMX does not generate these files for me?

Our MCU is STM32H7B3IIK6

EDIT2: wait, this number does not seem to contain SMPS (Q-type), yet our schematic is wired using SMPS configuration. Need to resolve this with the PCB designer.

1 ACCEPTED SOLUTION

Accepted Solutions
Tuoman
Senior II

Resolved issue! I used wrong part number in STM32Cube MX, H7B3IIK, instead of H7B3IIKxQ. There was wrong number in schematics.

View solution in original post

1 REPLY 1
Tuoman
Senior II

Resolved issue! I used wrong part number in STM32Cube MX, H7B3IIK, instead of H7B3IIKxQ. There was wrong number in schematics.