cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G071 disco USBPD_Analyzer

aber
Associate

Hi,

I am trying to modify the USBPD_Analyer Demonstration to use a fixed PDO definition in the usbpd_pdo_defs.h

Eventually I would like to modify it to create a source slave as it is not available in the CubeMonitor-UCPD but to begin with I am just adding the fixed sources already in the code.

I have commented out 

#define _USBPD_PWR_IF_C      in usbpd_pwr_if.c 

to use the definition of

PORT0_PDO_ListSNK[USBPD_MAX_NB_PDO]  in the usbpd_pdo_defs.h

and I have also added 

#include "usbpd_pwr_if.h" to the usbpd_pdo_defs.h

as the compiler was warning of implicit declarations of PWR_A_50MA, PWR_V_100MV etc.

Now when I compile the project I get

multiple definition of PORT0_PDO_ListSNK 

multiple definition of USBPD_NbPDO 

in usbpd_dpm_core.ousbpd_dpm_user.o, bsp_gui.o  and gui_api.o

I can see that PORT0_PDO_ListSNK is used in these file but don't understand why it thinks there are multiple definitions. 

I would be grateful if you could explain what I am doing wrong or let me know how to define a PDO definition for a source slave.

Thanks 

 

 

1 REPLY 1
FBL
ST Employee

Hi @aber 

An internal ticket is already submitted to developers to adjust include order to ensure that macro __USBPD_PWR_IF_C is defined before usbpd_pdo_defs.h is included. Check this thread as well Re: Issue with MACROs after generating code using ... - STMicroelectronics Community

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.