Skip to main content
This topic has been closed for replies.
Best answer by victagayun

Some files can be found in:

Repository\Packs\STMicroelectronics\X-CUBE-DPower\1.0.1\STM32CubeMX\templates

just rename the files to .c

16 replies

Visitor II
January 19, 2023

Hi,

I've generated code for STM32G474 Discovery board. But can't compile, it's missing a 'DCDC_Control_layer.c'

Explorer
January 19, 2023

Hi,

So you are only using the DC-DC (PSU) configurations?

Visitor II
January 19, 2023

Hi,

Yes.

Actually I use the 'PSU - Buck VoltageMode_HW G474inLQFP64.ioc' in folder 'xxxx\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-DPower\1.0.1\CubeMX Files References' to generated the project, then compile.

Visitor II
January 22, 2023

Hi,

I have installed the package X-CUBE-DPOWER following the instructions on UM3102. There are compilation problem, some file are missing...

Explorer
January 23, 2023

I had the same problem when importing PFC - Interleaved Boost G474inFQFP64.ioc.

I need to manually add the components to the Software pack dropdown menu when importing it.

Once added and generate the new code, I got an error with a missing file: "app_dpc_application.h".

This is not mentioned in UM3102 and not even included in:

Repository\Packs\STMicroelectronics\X-CUBE-DPower\1.0.1\STM32CubeMX\templates

Explorer
January 23, 2023

For PSU - Full_Bridge Phase_Shifted G474inLQFP64. I have the same missing file: "app_dpc_application.h".

Aside from that, it included "dpwr_pfc.h", so I enabled and added PFC under the AC-DC_converter in CCM of X-CUBE-DPower.

Explorer
January 23, 2023

I asked chatgpt regarding  "app_dpc_application.h", here is the response.

0693W00000Y8rjpQAB.png

Explorer
January 26, 2023

So I was able to make some progress on it using the PFC firmware.

In V1.0.0:

The original folder and files are using DPower and app_dpower.c/f files.

So the include is

#include "app_dpower.h"

While in V1.01:

The folder and files became X-CUBE-DPower and app_X-CUBE-DPower.c/h files.

The include is

#include "app_dpc_application.h"

you may need to change to

#include "app_X-CUBE-DPower.h"

In both versions, you'll get an error on app_dpower.h and app_X-CUBE-DPower.h files because of the comma

/* Scaling Vout */
#define G4		 (0,00662251655629f)	// ((+1.8f/(1.8f+(180.0f*3.0f)))*(2.0f)) = 0.0066445182724252f

you change to dot

/* Scaling Vout */
#define G4		 (0.00662251655629f)	// ((+1.8f/(1.8f+(180.0f*3.0f)))*(2.0f)) = 0.0066445182724252f

The last error I encounter and still cannot solve is

/* Enable PWMs */
PFC_PWMOutputEnable(&DPC_APPL_HRTIM);

where the error is "undefined reference to `PFC_PWMOutputEnable'".

Explorer
January 26, 2023

it should be missing the ***_control_layer.c

victagayunAuthorAnswer
Explorer
January 28, 2023

Some files can be found in:

Repository\Packs\STMicroelectronics\X-CUBE-DPower\1.0.1\STM32CubeMX\templates

just rename the files to .c

Visitor II
February 7, 2023

Dears,

Because behavior was different when using STM32CubeMX v6.6.1 and v6.7.0, we have issued a new X-Cube-DPower patch version (v1.0.2) for you. The previous problem existing with STM32CubeMX v6.7.0 is now solved, the "DCDC_Control_layer.c" file is now well generated.

Regarding the question about the STEVAL-ISA172V2 usage with this X-Cube-DPower pack : This board version (=V2) is not supported with our pack.

Best Regards

Explorer
February 7, 2023

@PBo​ ,

I disagree when you say "the "DCDC_Control_layer.c" file is now well generated."

There is no generated ***_Control_layer.c thus the generated project has numerous errors.

I tried PSU, Voltage Mode.

First error is,

../X-CUBE-DPower/App/DCDC_Fault_Processing.c:32:10: fatal error: dpwr_pfc.h: No such file or directory
 32 | #include "dpwr_pfc.h"
 | ^~~~~~~~~~~~
compilation terminated.

Then I tried to comment out #include "dpwr_pfc.h"

Came this second error.

../X-CUBE-DPower/App/DCDC_PWMnCurrVoltFdbk.c:34:10: fatal error: app_dpc_application.h: No such file or directory
 34 | #include "app_dpc_application.h"
 | ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
../X-CUBE-DPower/App/DCDC_IRQ_Handlers.c:33:10: fatal error: app_dpc_application.h: No such file or directory
 33 | #include "app_dpc_application.h"
 | ^~~~~~~~~~~~~~~~~~~~~~~
../X-CUBE-DPower/App/DCDC_Fault_Processing.c:34:10: fatal error: app_dpc_application.h: No such file or directory
 34 | #include "app_dpc_application.h"
 | ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
../X-CUBE-DPower/App/DCDC_Globals.c:35:10: fatal error: app_dpc_application.h: No such file or directory
 35 | #include "app_dpc_application.h"
 | ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
../X-CUBE-DPower/App/app_X-CUBE-DPower.c:40:10: fatal error: app_dpc_application.h: No such file or directory
 40 | #include "app_dpc_application.h"
 | ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Visitor II
February 7, 2023

Glad to here it's now working.

Explorer
February 7, 2023

Sorry, not working.

You can verify yourself.