Why do I not receive a USBPD_NOTIFY_SRCCAP_SENT notification?
I am trying to set up a sourcing power delivery port on an STM32G0 system. I have set up switching of VBUS, and when I connect up a sinking device my system detects it, sets up VBUS and starts sending source capacity messages.
Log:
<Connect source to port 0>
USBPD_DPM_Notification - USBPD stack started
USBPD_DPM_UserCableDetection - Cable attached to port 0; role=sink
USBPD_DPM_Notification - USBPD stack started
USBPD_DPM_SetDataInfo - Reset sink PDO on port 0 (data=0)
USBPD_DPM_SetDataInfo - Received sink request of size 1 on port 0
USBPD_DPM_SetDataInfo - Received 5 Source PDOs on port 0
USBPD_DPM_SNK_EvaluateCapabilities - Selecting PDO offer 0
USBPD_DPM_Notification - Power state changed on port 0
USBPD_DPM_Notification - Request accepted on port 0
USBPD_DPM_Notification - Power state changed on port 0
USBPD_DPM_Notification - Explicit contract on port 0
USBPD_DPM_Notification - Sink ready on port 0
<Connect sink to port 1>
BSP_USBPD_PWR_VBUSOff on port 1
USBPD_DPM_Notification - USBPD stack started
USBPD_DPM_UserCableDetection - Cable attached to port 1; role=source
BSP_USBPD_PWR_VBUSOn on port 1
USBPD_DPM_Notification - USBPD stack started
USBPD_DPM_SetDataInfo - Reset sink PDO on port 1 (data=0)
USBPD_DPM_SetDataInfo - Received sink request of size 1 on port 1
USBPD_DPM_Notification - Power state changed on port 1
USBPD_DPM_GetDataInfo - get source PDO
USBPD_DPM_IsPowerReady - Power supply check on port 0 // << Port 1 passes on the PD contract of port 0, so checking port 0 is part of determining whether port 1 is able to sourceUsing a PD analyzer I can see that VBUS goes up and three source capabilities messages are sent, but that is where the process hangs. Nothing happens and I do not receive a USBPD_NOTIFY_SRCCAP_SENT notification, presumably because the source capabilities messages never get acknowledged by the sink device.
I can see that the USBPD_CAD_Task keeps running (removing cables also triggers new activity), and I do not see any error handling calls. Comparing my code to stm32 source port example code, there are no differences that I can find that would explain this behaviour.
It looks like something hangs in some state machine while sending SRC_CAP messages, but I have no clue where to start searching for where the process fails.
