Sleep/Stop mode while using the USBPD lib
Hi,
I have an issue with low power operation when using the USBPD library. We have successfully implemented a low power feature for our new product. After that we have started the development of a USBPD feature. The problem is, that after the function "USBPD_PreInitOs()" is called in main.c the power is much higher as it was before. As this function calls a static linked library, I have no idea what has been turned on and how to disable it again. Therefore I need your help as only you have the source code.
Here my simple steps to reproduce the problem:
Hardware (Nucleo144 STM32H563, STLINK-V3PWR):

1) In CubeMX I select the example USBPD_SNK, then I generate the code.
2) In main I add this two lines after USBPD_PreInitOs():
USBPD_PreInitOs();
/* USER CODE BEGIN 2 */
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);The current is 3600µA (3,6mA).
When commented out USBPD_PreInitOs() like here:
//USBPD_PreInitOs();
/* USER CODE BEGIN 2 */
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);The current is <700µA (0,7mA).
I have tried a lot, e.g. reseting the PD but without full success. Like here:
//USBPD_PreInitOs();
/* USER CODE BEGIN 2 */
__HAL_RCC_UCPD1_FORCE_RESET();
__HAL_RCC_APB1_RELEASE_RESET();
HAL_SuspendTick();
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFE);With the reset of the PD the current is <1350µA (1,35mA), but still higher then the 700µA without calling USBPD_PreInitOs().
Do anyone has a idea what can I turn off to reverse the USBPD_PreInitOs()?
Regards,
Roman

