2025-03-07 4:55 AM
Hi,
I am using the STM32CubeMX ver 6.13.0 to generate a USB-PD DRP application. After generating the code following this procedure for custom boards (https://wiki.stmicroelectronics.cn/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Dual_Role) I see that the file "usbpd_pwr_if.c" is defining the following macro "#define __USBPD_PWR_IF_C" first thing, than including the necessary header files. One of the header files, "usbpd_pdo_defs.h", is using the __USBPD_PWR_IF_C to check if there is the need to initialize the list of SRC/SNK PDOs or get them as externs. The issue is that even though the __USBPD_PWR_IF_C is defined and the "usbpd_pdo_defs.h" header is included after the definition, the "usbpd_pdo_defs.h" header file is not seeing the definition and is enabling the necessary code as if the macro __USBPD_PWR_IF_C was not defined.
Any possible reasons for this behaviour?
Thanks
2025-03-07 6:20 AM
Try it on the latest CubeMX version and include the IOC file that shows the issue.