2025-04-24 2:11 AM
Hi
I have developed a device based on the Nucleo G071RB and X-NUCLEO-DRP1M1 boards. The main difference in my design is that my MCU is in a UFQFPN28 package, which means I only have the CC1 pin and not the CC2 pin. The USB PD is configured to work in dual role mode.
However, I am facing an issue where the PD negotiation does not start when I connect a USB device (an Android smartphone). Using an oscilloscope, I observed that the CC line goes to Rd when the USB PD is set as the source. The MCU then sends a message to the TCPP over I2C, and VBUS is passed to the sink. Despite this, the PD negotiation does not commence.
I have not implemented a virtual COM port for monitoring USB PD, so I do not have all the traces. However, I have enabled some parts of the code for debugging. It appears that the USBPD_PE_StateMachine_DRP function does not start the negotiation, but without the code, I cannot debug it further.
Here are the logs:
USBPD_CAD_STATE_EMC
USBPD_CAD_STATE_SWITCH_TO_SNK
-- BSP_USBPD_PWR_SetRole : SNK --
USBPD_CAD_STATE_DETACHED
-- BSP_USBPD_PWR_SetRole : SRC --
USBPD_CAD_STATE_EMC
USBPD_CAD_STATE_SWITCH_TO_SNK
-- BSP_USBPD_PWR_SetRole : SNK --
USBPD_CAD_STATE_DETACHED
-- BSP_USBPD_PWR_SetRole : SRC --
USBPD_CAD_STATE_EMC
USBPD_CAD_STATE_SWITCH_TO_SNK
-- BSP_USBPD_PWR_SetRole : SNK --
USBPD_CAD_STATE_DETACHED
-- BSP_USBPD_PWR_SetRole : SRC --
USBPD_CAD_STATE_EMC
USBPD_CAD_STATE_SWITCH_TO_SNK
-- BSP_USBPD_PWR_SetRole : SNK --
USBPD_CAD_STATE_DETACHED
-- BSP_USBPD_PWR_SetRole : SRC --
USBPD_CAD_STATE_EMC
-- BSP_USBPD_PWR_VBUSInit --
-- BSP_USBPD_PWR_SetPowerMode --
-- Normal --
USBPD_CAD_STATE_ATTACHED_WAIT
USBPD_CAD_STATE_ATTEMC
NOTIFY_USBSTACK_START
VBUS ON
-- BSP_USBPD_PWR_VBUSOn --
-- GDP/GDC setting : SRC --
NOTIFY_USBSTACK_START
NOTIFY_POWER_STATE_CHANGE
NOTIFY_HARDRESET_RX
NOTIFY_USBSTACK_STOP
I also attach the schema and picture of the oscilloscope (Green line is the CC and the blue is VBUS)
Thanks for the help