2025-03-24 5:05 AM
Hi,
I am using the STM32ubeMX v6.14.0 to generate a USB-PD DRP following the link below:
I noticed that when I set the CubeMX to have more than 1 PDO, say 7, the macros USBPD_MAX_NB_PDO and PORT0_NB_SOURCEPDO are correctly set to 7 but the USBPD_NbPDO[1] has a value of 1 and I see that only the first element of the PORT0_PDO_ListSRC array is populated. Moreover, I also noticed that the USBPD_PWR_IF_SetProfile function is fixed to get only the first PDO due to explicitly choosing PORT0_PDO_ListSRC[0].
Is this an issue in the cubeMX code generation? Also, I couldn't find anywhere where the PORT0_PDO_ListSRC (and the same way, PORT0_PDO_ListSNK) are iniitialized as in the usbpd_pdo_defs.h file, the externs are enabled and the initialization code is disabled through the #ifndef __USBPD_PWR_IF_C instruction.
NB. Attached is the ioc file