Should BSP_USBPD_PWR_VBUSOff() and BSP_USBPD_PWR_VBUSOn() of the USBPD library block until the VBUS voltage is ok?
Hi,
We try to implement a DRP device with the USBPD library on a STM32G071 uC.
From the documentation the requirements for the following functions are not clear:
BSP_USBPD_PWR_VBUSOff():
- Should it block until VBUS < USBPD_PWR_LOW_VBUS_THRESHOLD?
- What is the maximum allowed blocking duration? In the PD standard the spec for tSafe0V is max 650ms.
BSP_USBPD_PWR_VBUSOn() & BSP_USBPD_PWR_VBUSSetVoltage_Fixed() in source operation:
- Same as above, should these functions block until the VBUS voltage is settled or should they return immediately?
- What is the maximum allowed blocking duration? Spec for tSrcTurnOn is max 275ms in the PD standard, tSrcReady is max 285ms.
- Note, if it returns immediately, the hard resets do not work, since USBPD_PWRR_IF_SupplyReady() is called only once, and VBUS is not > USBPD_PWR_HIGH_VBUS_THRESHOLD at this time. See the attached screenshot.
USBPD_DPM_UserCableDetection():
- Only in one example (DemoUCPD) I saw a delay before enabling VBUS. In the USB-PD_Provider_1port example there is no delay. Is this delay required?
void USBPD_DPM_UserCableDetection(uint8_t PortNum, USBPD_CAD_EVENT State)
{
...
case USBPD_CAD_EVENT_ATTACHED:
...
if(USBPD_PORTPOWERROLE_SRC == DPM_Params[PortNum].PE_PowerRole)
{
USBPD_DPM_WaitForTime(110); // <-------------------
if (USBPD_OK != USBPD_PWR_IF_VBUSEnable(PortNum))We are using CubeMX to generate the basic skeleton with the following libs:
- FW pack STM32Cube_FW_G0_V1.5.1
- USBPD core library V4.0.0
- USBPD device library V3.3.1
Thanks!
BR, Christoph
