STMicroelectronics / x-cube-tcpp

STM32 expansion package providing an integrated solution for a robust protection of MCU-based USB Type-C applications
https://www.st.com/content/st_com/en/stm32-usb-c.html
Other
26 stars 9 forks source link

When `_TRACE` and `_GUI_INTERFACE` is not set, the `_PWR_CHECK_*` macros defined in `usbpd_pwr_if.c` always returns `USBPD_ERROR` #7

Closed DinkDonk closed 2 years ago

DinkDonk commented 2 years ago

Describe the set-up Board: NUCLEO-G0B1RE / X-NUCLEO-DRP1M1

Describe the bug When _TRACE and _GUI_INTERFACE is not set, the _PWR_CHECK_* macros defined in usbpd_pwr_if.c always returns USBPD_ERROR.

How To Reproduce

  1. Set up the DRP1M1_DRP example project.

  2. Disable _TRACE and _GUI_INTERFACE.

  3. Observe that USBPD_PWR_IF_Init() returns USBPD_ERROR.

Additional context I suggest removing the #if defined(_GUI_INTERFACE) at line #116 in usbpd_pwr_if.c.
I don't fully understand the reasoning for the difference in these macros when _GUI_INTERFACE is disbled, so the cause of the error might originate from somewhere else.

HFISTM commented 2 years ago

Hello @DinkDonk,

Thank you for reporting this issue. It is currently being fixed - internal tracking number 135988.

Some info on the bug itself:

This don't seems to be related to the tracer, but the GUI. When using the GUI, the PDO data are stored in RAM. When not, is is defined in usbpd_pdo_def.h. In this case, the structure which contains the PDO data is not filled from the usbpd_pdo_def.h file, and so the macro detect it as an error. The fix is to fill the structure in USBPD_PWR_IF_Init function prior to calling the macros.

This fix will be provided soon in version v3.3.2

Thank you and best regards

HFISTM commented 2 years ago

Hello @DinkDonk,

The fix to this issue has been made available in the frame of release V3.3.2 of this firmware published a couple of minutes ago.

Please allow me to close this issue and thank you again for having reported.

With regards,