STMicroelectronics Getting started User Manual
STMicroelectronics Getting Started
The X-CUBE-DPOWER Expansion Package is part of the STMicroelectronics digital switch-mode power supply (DSMPS) software development kit (SDK) ecosystem. It provides users with an easy and friendly way to configure their digital power converters, matching their hardware setups.
The X-CUBE-DPOWER Expansion Package runs on the STM32F334 and STM32G4x4 microcontrollers based on the Arm® Cortex®‑M4 processor.
With the X-CUBE-DPOWER Expansion Package, users can:
- Configure their digital power converters using a graphical user interface (GUI)
- Generate projects compatible with STM32CubeMX for further application extensions or modifications
Annonce
Annonce
UM3102
User manual
Getting started with X-CUBE-DPOWER
Introduction
•
•
The X-CUBE-DPOWER STM32Cube Expansion Package is part of the STMicroelectronics digital switch-mode power supply
(DSMPS) software development kit (SDK) ecosystem. It includes:
The firmware library for power factor corrector (PFC) and power supply unit (PSU) converters usage
The graphical user interface (GUI) for the configuration of the converter with STM32CubeMX
• PFC and PSU as examples projects running on different STMicroelectronics boards ( *.ioc
files provided)
This user manual explains how to install and use the X-CUBE-DPOWER Expansion Package.
UM3102 - Rev 1 - December 2022
For further information contact your local STMicroelectronics sales office.
www.st.com
1
Note:
UM3102
General information
General information
The X-CUBE-DPOWER Expansion Package is part of the STMicroelectronics digital switch-mode power supply
(DSMPS) software development kit (SDK) ecosystem. It provides users with an easy and friendly way to configure their digital power converters, matching their hardware setups.
After the configuration phase, the users generate their projects compatible with STM32CubeMX for further application extensions or modifications if needed.
The STM32 DSMPS SDK runs on PC systems with the Windows
®
10 OS or later. It requires a USB connector when using the ST-LINK toolset.
For all information about the supported converter topologies, refer to the STM32 DSMPS SDK release note.
The X-CUBE-DPOWER Expansion Package runs on the STM32F334 and STM32G4x4 microcontrollers based on the Arm ® Cortex ® ‑ M4 processor.
Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
Windows is a trademark of the Microsoft group of companies.
All other trademarks are the property of their respective owners.
UM3102 - Rev 1 page 2/19
2
UM3102
Related documents
Related documents
Arm ® Cortex ® document
• Arm Cortex-M4 Processor Technical Reference Manual , available from developer.arm.com
(1)
1. This URL is hosted by a third-party website. It is active at document publication. However, STMicroelectronics shall not be liable for any change, move, or inactivation of the URL or the referenced material.
STMicroelectronics documents
•
•
•
STM32F334x4, STM32F334x6, and STM32F334x8 datasheet ( DS9994
STM32G474xB, STM32G474xC, and STM32G474xE datasheet (
)
DS12288 )
STM32CubeMX for STM32 configuration and initialization C code generation user manual ( UM1718
For any product-specific STMicroelectronics document, refer to the product page in the STMicroelectronics website at www.st.com
.
)
UM3102 - Rev 1 page 3/19
3
3.1
UM3102
STM32CubeMX
STM32CubeMX
The STM32CubeMX software tool is first used to select and configure the DSMPS converter topology, then to generate the user’s project.
Launch STM32CubeMX
Launch the STM32CubeMX software tool by:
•
• either clicking on its icon on the desktop or running it directly from the installation folder tree
Figure 1. STM32CubeMX — Icon and installation folder tree
3.2
5.
6.
7.
8.
9.
Install X-CUBE-DPOWER
Install the X-CUBE-DPOWER Expansion Package (proposed as the X-CUBE-DPower pack in the
STM32CubeMX menus) as described below and shown in
1.
2.
Click on the [
Select the
INSTALL/REMOVE
STMicroelectronics
] button
tab
3.
4.
Click on the [ From Local … ] button
Select the pack to install from the download repository
Click on the [ Open ] button
Accept the license agreement terms
Click on the [ Finish ] button
Check that the pack is correctly installed
Click on the [ Close ] button
Figure 2. STM32CubeMX — X-CUBE-DPOWER installation (1/3)
1
2
3
UM3102 - Rev 1 page 4/19
UM3102 - Rev 1
8
4
Figure 3. STM32CubeMX — X-CUBE-DPOWER installation (2/3)
UM3102
Install X-CUBE-DPOWER
5
6
Figure 4. STM32CubeMX — X-CUBE-DPOWER installation (3/3)
7
9 page 5/19
3.3
UM3102
Import the pack components
Import the pack components
In a first step, create or select the STM32CubeMX hardware configuration file (the *.ioc
file). Note that the
X-CUBE-DPower pack provides several supported converter topologies. One topology can be used to jumpstart any new project. Click on the [ Software Packs ] drop-down menu and then on [ Select Components ] to access the list of available components from the pack as shown in
.
Figure 5. STM32CubeMX – X-CUBE-DPOWER component import (1/2)
In a second step, select the components setup as shown in Figure 6 :
1.
Expand the X-CUBE-DPower pack
2.
3.
Select the application converter type from the drop-down menu
Select the needed library components to import within the project, possibly with more than one selection
4.
5.
6.
Matching item 3 above, select the converter topology applicable to the PFC type (only one must be selected)
Matching item 3 above, select the converter topology applicable to the PSU type (only one must be selected)
When done, click on the [ Ok ] button
Figure 6. STM32CubeMX – X-CUBE-DPOWER component import (2/2)
1
3
4
5
2
UM3102 - Rev 1 page 6/19
3.4
UM3102
Select the pack components
Select the pack components
1.
2.
Expand the [ Software Packs ] area and click on the STMicroelectronics X-Cube-DPower string to show the pack components setup (refer to
)
Select all the components for the project as indicated in Figure 7
Figure 7. STM32CubeMX – X-CUBE-DPOWER component selection
2
1
Check that the STMicroelectronics X-Cube-DPower string becomes green, and that all the checkboxes are blue like presented in
.
UM3102 - Rev 1 page 7/19
3.5
UM3102
Configure the converter parameters with the GUI
Configure the converter parameters with the GUI
shows that many parameters are available at this stage. These parameters depend on the selected converter topology. For more information about the parameters’ usage, refer to the dedicated application note.
Figure 8. STM32CubeMX – X-CUBE-DPOWER parameters
3.6
The application example provided is based on an STMicroelectronics board supporting the converter topology. All the hardware peripherals can be modified to match a user's board implementation.
Generate the project
When the hardware peripherals and converter parameters are correctly set up, generate the project using
STM32CubeMX as usual. Refer to the STM32CubeMX user manual ( UM1718 ) for more information.
UM3102 - Rev 1 page 8/19
4
UM3102
Project files architecture and usage
Project files architecture and usage
When a project is generated in the basic mode, many files are created. All of them are matching the generic files architecture presented in
. These files can be arranged in the five groups detailed in the following sections.
Figure 9. DSMPS generic files architecture
4.1
4.2
STM32CubeMX configuration files
Several STM32CubeMX reference files (the *.ioc
files) are provided. They are useful for the DSMPS converters setup. Depending on the desired topology, the user can find one or more reference files running on the related
STMicroelectronics board. These files can serve to jumpstart the project or to evaluate the algorithm provided.
These files are located into the STM32CubeMX installation directory:
C:\Users\...\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-DPower\x.y.z\Cube
MX Files References\
Generic project files
Although all the files are automatically generated by the STM32CubeMX tools, some of them are generic to
DSMPS applications. They are useful for some of the MCU functions configuration such as the system core, analog, timers, and computing.
In addition to the MCU functions used, the files main.c
and main.h
manage the DSMPS project initialization and processing functions for the selected converter.
The usual MCU configuration files are:
•
•
•
•
• stm32g4xx_hal_conf.h
stm32g4xx_hal_msp.c
stm32g4xx_it.c
stm32g4xx_it.h
system_stm32g4xx.c
These files do not implement any specific functions or any variables related to the generated converter.
The RTE_Components.h
file is an intermediate file created during the STM32CubeMX generation process. It is not needed for the DSMPS project compilation and for its execution.
UM3102 - Rev 1 page 9/19
4.3
4.4
4.5
UM3102
Topology dedicated files
•
•
•
•
•
Topology dedicated files
They are dedicated to the selected converter.
The app_dpower.h
file declares the global variables, the macros, and the constants (such as board LEDs status blinking, coefficients filter, and others) used by the selected topology. The application parameters, previously initialized with the STM32CubeMX tools usage through the dedicated GUI, are all located in this file.
The app_dpower.c
file implements the MX_DPower_Init() and the MX_DPower_Process() functions, which are called from the main function. It also implements the local functions needed for the converter:
– The MX_DPower_Init() function initializes the global variables, data structure filter, and soft start ramp. It performs the calibration, starts the MCU parts used, enables the interrupts, and sets the timers comparators.
– The MX_DPower_Process() function implements the generic state machine as indicated in the next chapter. Each state of the machine implements a part of the selected converter.
The DCDC_Lib_Conf.h
file or PFC_Lib_Conf.h
file contains the instantiation and configuration of all the
MCU peripherals used. It virtualizes the algorithm implemented into the DSMPS application files.
The DCDC_IRQ_Handlers.c
file or PFC_IRQ_Handlers.c
file provides all the interrupt routines used to run the converter. This file is complementary to the interrupt configuration files from STM32CubeMX (for instance the stm32g4xx_it.c
and stm32g4xx_it.h
files).
The DCDC_Control_Layer.c
and DCDC_Control_Layer.h
files, or the PFC_Control_Layer.c
and
PFC_Control_Layer.h
files, implement the basic functions used to manage the software counters needed by the algorithm. They also implement board level functions.
•
•
•
•
•
Converter-type specific files
These files are generic to the converter type: AC ‑ DC (the PFC converters), DC ‑ DC (the PSU converters), or both.
• The yyyy_Communication.c
and yyyy_Communication.h
files manage the communication link between the microcontrollers. They exist for both the PSU and PFC converters.
The DCDC_Fault_Processing.c
and DCDC_Fault_Processing.h
files check the converter protections and set the potential fault accordingly. They exist only for the PSU converters.
The DCDC_Globals.c
and DCDC_Globals.h
files define and initialize the global variables needed by the converter type. They exist only for the PSU converters.
The DCDC_PWMnCurrVoltFdbk.c
and DCDC_PWMnCurrVoltFdbk.h
files implement functions to drive the PWM signals according to the existing features: synchronous rectification, active clamp, fan usage, and others. They exist only for the PSU converters.
The yyyy_STM32_Interface.c
and yyyy_STM32_Interface.h
files abstract the hardware from a specific microcontroller (for instance the FMAC) to propose software or hardware computing indifferently at application level. They also implement tick conversion functions based on the hardware setup. They exist for both the PSU and PFC converters.
The yyyy_type.h
file declares global data structures. It exists for both the PSU and PFC converters.
•
•
Library files
These library files are located in the STM32CubeMX installation directory:
C:\Users\...\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-DPower\x.y.z\Midd lewares\ST\
The library files are useful for DSMPS converters. Two libraries are provided:
One library originally initiated by Biricha Digital Power Ltd., then modified and maintained by
STMicroelectronics
One library fully developed by STMicroelectronics
UM3102 - Rev 1 page 10/19
UM3102
Library files
The third-party library (initially from Biricha Digital Power Ltd.) provides several groups of functionalities:
•
•
•
•
•
The biricha-dpow-lib.h
file provides macros for quick access to the registers that are frequently used
The dpwr_cntrl.c
and dpwr_cntrl.h
files implement the different poles and zeros controllers needed by the Biricha Digital Power Ltd. control method
The dpwr_dcdc.c
and dpwr_dcdc.h
files define the common supported DC ‑ DC converter errors and data structures
The dpwr_filt.c
and dpwr_filt.h
files implement optimized type II/III filtering algorithms and associated data structures
The dpwr_pfc.c
and dpwr_pfc.h
files define the common supported AC ‑ DC converter errors and data structures, as well as the functions needed to control PFC converters
The digital power converter library (from STMicroelectronics) provides the following groups of functionalities:
•
•
•
The DPC_DebugMode.c
and DPC_DebugMode.h
debug with the EWARM IDE only
files provide data structures and functions useful to
The DPC_Miscellaneous.c
and DPC_Miscellaneous.h
files provide LED data structure and management functions, as well as min/max values for several data types
The DPC_Pid.c
and DPC_Pid.h
files implement the different PID controllers needed by the legacy control method
UM3102 - Rev 1 page 11/19
5
UM3102
Generic state machine
Generic state machine
The generic state machine aims to homogenize the implementation of all the converter types generated with
X-CUBE-DPOWER, thus keeping the source code coherent and more understandable.
For a given topology, the exact state machine behavior is fully described in the related application note describing this topology. This description takes precedence over this generic one.
UM3102 - Rev 1 page 12/19
UM3102 - Rev 1
UM3102
Generic state machine
Figure 10. DSMPS generic state machine
IDLE
INIT
à
No DC/DC error existence
User’s LED management
à
No DC/DC error existence
User’s LED management
START
à
No DC/DC error existence
User’s LED management
RUN
à
DC/DC error existence
User’s LED management
STOP
à
DC/DC error exists
User’s LED management
à
DC/DC error existence
User’s LED management
ERROR
à
Recovery trial
à
DC/DC error existence
User’s LED management
WAIT
à
Time is elapsed
FAULT
page 13/19
UM3102 - Rev 1
UM3102
Generic state machine
The generic state machine behaves as shown in Figure 10 . It is composed of the following states:
•
•
•
•
IDLE state:
The converter waits for the input voltage and frequency conditions. When existing, the green user LED blinks slowly, and the red user LED is switched off.
INIT state:
The converter reinitializes the control variables and enables the output. When existing, the green user LED blinks normally, and the red user LED is switched off.
START state:
The converter ramps up the output voltage until it reaches the expected one. After the ramp-up delay, either an error is signaled and the next state is STOP, or the target voltage is reached.
RUN state:
The converter regulates as expected and the user can test the converter behavior with different loads.
When existing, the green user LED blinks quickly to indicate normal operation, and the red user LED is switched off.
•
•
•
•
•
STOP state:
The converter stops after any error detection to protect itself. Disabling PWM outputs must be done at that stage. When existing, the red user LED blinks quickly, and the green user LED is switched off.
ERROR state:
Regardless of the type of error, the converter goes in this state in case of an error. This is where the error treatment is performed. Usually, there is either a temporary error that can be recovered by the system, or a permanent error that cannot be recovered by the system. The latter error is then reclassified as a fault.
Then, and when existing, the green and red user LEDs blink slowly.
WAIT state:
The converter waits for a delay before going back to the ERROR state.
FAULT state:
The converter loops forever in this state until the fault is recovered manually, or the system is reset. Then, and when existing, the red and green user LEDs are switched on permanently.
DEFAULT state:
The converter executes the MX_DPower_Init() function.
page 14/19
Revision history
Date
16-Dec-2022
Revision
1
Table 1. Document revision history
Changes
Initial release.
UM3102
UM3102 - Rev 1 page 15/19
UM3102
Contents
Contents
UM3102 - Rev 1 page 16/19
UM3102
List of tables
List of tables
UM3102 - Rev 1 page 17/19
UM3102
List of figures
List of figures
UM3102 - Rev 1 page 18/19
UM3102
IMPORTANT NOTICE – READ CAREFULLY
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgment.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of purchasers’ products.
No license, express or implied, to any intellectual property right is granted by ST herein.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, refer to www.st.com/trademarks . All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.
© 2022 STMicroelectronics – All rights reserved
UM3102 - Rev 1 page 19/19
Download
Annonce