Skip to main content
This topic has been closed for replies.
victagayun
victagayunBest answer
Senior III
Jan 28, 2023 12:14 PM UTC

Some files can be found in:

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

just rename the files to .c

23 replies

JGrap.1
Associate II
Jan 19, 2023 7:49 AM UTC

Hi,

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

victagayun
Senior III
Jan 19, 2023 8:05 AM UTC

Hi,

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

JGrap.1
Associate II
Jan 19, 2023 9:23 AM UTC

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.

GRINA.1
Visitor II
Jan 22, 2023 7:32 PM UTC

Hi,

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

victagayun
Senior III
Jan 23, 2023 2:38 AM UTC

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

victagayun
Senior III
Jan 23, 2023 3:07 AM UTC

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.

victagayun
Senior III
Jan 23, 2023 3:19 AM UTC

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

0693W00000Y8rjpQAB.png

victagayun
Senior III
Jan 26, 2023 2:22 AM UTC

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'".

victagayun
Senior III
Jan 26, 2023 2:31 AM UTC

it should be missing the ***_control_layer.c

victagayun
victagayunAuthorBest answer
Senior III
Jan 28, 2023 12:14 PM UTC

Some files can be found in:

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

just rename the files to .c

PBo
Visitor II
Feb 7, 2023 8:50 AM UTC

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

victagayun
Senior III
Feb 7, 2023 10:28 AM UTC

@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.

JGrap.1
Associate II
Feb 7, 2023 9:16 AM UTC

Glad to here it's now working.

victagayun
Senior III
Feb 7, 2023 10:57 AM UTC

Sorry, not working.

You can verify yourself.