2025-06-07 7:19 AM
I am trying to switch the USB to DisplayPort mode via the PD (Power Delivery) line. I have a custom board based on the STM32G0B1CBT6, and another board based on the RTD2556, which works well for switching. I am sniffing PD communication using the LA1016 logic analyzer, and I have successfully been able to repeat all responses connected to perform the switching mode, except for sending SOP from the device to the host. All the necessary logic is implemented in the usbpd_vdm_user.c file, in the callbacks function. In the main thread, I have
osDelay(2000);
/* Update DP Status first */
sDP_Status[0].d.HPDState = 1; // Set HPD state
sDP_Status[0].d.Enable = 1; // Set enabled
/* Request attention - this will trigger message send */
USBPD_DPM_RequestDisplayPortStatus(0, USBPD_SOPTYPE_SOP, 0xFF01U, &sDP_Status[0].d32);
I'm tring to send
2.5380323000,Preamble
2.5382400500,SOP,,
2.5383050000,Header,0x2E8F,DataObject:2 Sink V3 UFP Vendor_Defined
2.5383698500,PayLoad[0],0xFF018106,
2.5384997500,PayLoad[1],0x0000008A,
2.5386294500,CRC32,0xD565C97C
But don't know how to force PD stack to make it.
2025-06-07 11:20 AM
The USBPD_DPM_RequestDisplayPortStatus() function may just update the internal status and not trigger actual message sending unless the mode has been entered.
Try calling USBPD_DPM_RequestAttention() after setting sDP_Status.
USBPD_DPM_RequestAttention(0, USBPD_SOPTYPE_SOP, 0xFF01U);
This API is designed to trigger a VDM Attention message with current sDP_Status.