Skip to main content
Visitor II
May 7, 2026
Solved

USB PD VDM / eMarker Example on STM32G071C8 ?

  • May 7, 2026
  • 1 reply
  • 147 views

Hello,

I am currently working on a simple USB Power Delivery test project using the STM32G071C8.
The system has two USB Type-C ports.

I need to detect PDO information and eMarker capabilities in order to determine the appropriate power delivery behavior. However, eMarker detection requires VDM-related functionality, and I could not find any relevant examples or documentation on the official website to continue development.

The usbpd_vdm_user files generated by STM32CubeMX are essentially empty, and I could not find any useful reference information in either STM32CubeG0 v1.6.3 or X-CUBE-TCPP.

Could you please provide any related example code, application notes, or documentation that demonstrates:

  • VDM handling

  • Discover Identity flow

  • eMarker cable detection

  • SOP'/cable communication

Any reference material would be greatly appreciated and would help me continue development.

Thank you.

Best answer by FBL

Hello @mitch_Hsieh 

There is a related discussion on this topic, and demo USB Sniffer/ SPY mode available on the STM32G071B-DISCO board.

When the Type-C port cover (the blue door) is open, the board enters this mode, enabling it to monitor USBPD communication between a USB PD charger and a PC. In SPY mode, the board does not actively participate in the communication but instead captures trace data for analysis. This is particularly useful for debugging

  1. Configure hardware for sniffing Initialize_USBPD_Spy(); 
    husbpd = USBPD_HW_GetUSPDInstance(0);
    
    LL_UCPD_StructInit(&settings);
    LL_UCPD_Init(husbpd, &settings);
    LL_UCPD_SetRxOrderSet(husbpd, LL_UCPD_ORDERSET_SOP | LL_UCPD_ORDERSET_HARDRST);
    LL_UCPD_Enable(husbpd);
    LL_UCPD_SetccEnable(husbpd, LL_UCPD_CCENABLE_CC1CC2);
  2. Prepare UCPD RX + DMA Intialize_RX_processing(CC1) since it is attached 
  3. Launch DEMO_Task_SPY

I hope this could be helpful

 

1 reply

FBLBest answer
ST Technical Moderator
May 7, 2026

Hello @mitch_Hsieh 

There is a related discussion on this topic, and demo USB Sniffer/ SPY mode available on the STM32G071B-DISCO board.

When the Type-C port cover (the blue door) is open, the board enters this mode, enabling it to monitor USBPD communication between a USB PD charger and a PC. In SPY mode, the board does not actively participate in the communication but instead captures trace data for analysis. This is particularly useful for debugging

  1. Configure hardware for sniffing Initialize_USBPD_Spy(); 
    husbpd = USBPD_HW_GetUSPDInstance(0);
    
    LL_UCPD_StructInit(&settings);
    LL_UCPD_Init(husbpd, &settings);
    LL_UCPD_SetRxOrderSet(husbpd, LL_UCPD_ORDERSET_SOP | LL_UCPD_ORDERSET_HARDRST);
    LL_UCPD_Enable(husbpd);
    LL_UCPD_SetccEnable(husbpd, LL_UCPD_CCENABLE_CC1CC2);
  2. Prepare UCPD RX + DMA Intialize_RX_processing(CC1) since it is attached 
  3. Launch DEMO_Task_SPY

I hope this could be helpful

 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL