Skip to main content
Graduate
November 6, 2025
Solved

USB PD enable display port [STM32N6 - SNK]

  • November 6, 2025
  • 4 replies
  • 325 views

* board - STM32N6570-DK

*  using STM Cube 1.19.0

* Example - USBPD_SNK

 

Goal - to enable Display port

 

Problem - is i'm getting stuck with the current example.  It gets stuck at SVDM_deiscovery_identity part.  Which in that packet i should be able to start to tell the host that i have display port capability, but i what is currently set it that the message is unsupported.  How would i go about enabling this.

 

Thoughts - In usbpd_vdm_user.c it seems like it has all the stuff that i need to start sending back these kind of messages but they don't seem to be called anywhere.  

There's a function called

USBPD_VDM_DiscoverSVIDs()

But it doesn't seem to be called.  

 

 

Capture from a STM32 PD G0 - with STM32CubeMonitor app

PD_Example_results.png

    This topic has been closed for replies.
    Best answer by Brenden_PLUS

    Currently using a

    * STM32G071 nucleo board

     

    SUB problem

    The larger sub problem was i couldn't figure out how to get the VDM messages to work.

     

    Solution

    • use reference example DEMOUCPD with cpu STM32G081 eval board
    • make sure your using USBPDCORE_PD3_FULL 
    • Enable VDMSupport
      • You can do this in the ioc file in the middleware 
      • Or usbpd_dpm_conf.h
    • In usbpd_dpm_userr.c, you need to init USBPD_VDM
    USBPD_StatusTypeDef USBPD_DPM_UserInit(void)
    {
    /* USER CODE BEGIN USBPD_DPM_UserInit */
    USBPD_VDM_UserInit(USBPD_PORT_0);
     return USBPD_OK;
    /* USER CODE END USBPD_DPM_UserInit */
    }​

     

    •  in usbpd_vdm_user.c you need to actually setup the callbacks for this subsystem 
    USBPD_StatusTypeDef USBPD_VDM_UserInit(uint8_t PortNum)
    {
    /* USER CODE BEGIN USBPD_VDM_UserInit */
    
     USBPD_PE_InitVDM_Callback(PortNum, (USBPD_VDM_Callbacks *)&vdmCallbacks);
    
     return USBPD_OK;
    /* USER CODE END USBPD_VDM_UserInit */
    }

     

    At this point you'll need to start defining some of these objects and looking at the eval example will help a lot with it.  At this point mixing most of the code in the usbpd_vdm_user.c from the eval project my usb monitor program looks like this.  Which was huge!  You can see the SNK send back a SVDM discovery identity packet!

     

    GotThePacketSentBack.png

    Documentation that was really helpful

    From the software stack guide

    VDM_description.png

     

    4 replies

    Graduate
    November 7, 2025

    In usbpd_dpm_conf.h it seems you can edit the DPM_Settings.

     

    So i enabled 

    .PE_VDMSupport = USBPD_TRUE,

    .PE_RespondsToDiscovSOP = USBPD_TRUE, /*!< Can respond successfully to a Discover Identity */ .PE_AttemptsDiscovSOP = USBPD_TRUE,

     

    None of these made any further changes.  

    Technical Moderator
    November 10, 2025

    Hi @Brenden_PLUS 

    It seems we are getting strange behavior running the example ! An internal ticket is submitted to dedicated team (221407) for further investigation. 

    About USBPD_VDM_DiscoverSVIDs API is called to retrieve SVID supported by device and answer to SVDM Discovery SVID init message sent by port partner

    Graduate
    November 17, 2025

    Do you have any info on whats weird about it?  I've currently moved to a different task, but figuring out this PD is very important to the project.  Just want to make sure this problems is or is not impeding my progress on my task. 

    Technical Moderator
    November 17, 2025

    Hi @Brenden_PLUS 

    I assume this line, __HAL_PWR_GET_FLAG(PWR_FLAG_USB33RDY) returns true if PWR_FLAG_USB33RDY is set. So, if the flag is set, the code is stuck in the instruction while(__HAL_PWR_GET_FLAG(PWR_FLAG_USB33RDY));

    If the code is waiting for the flag to be set, a simple correction could be

     while(!__HAL_PWR_GET_FLAG(PWR_FLAG_USB33RDY));

    Keep me updated, if you have further questions.

    Brenden_PLUSAuthorAnswer
    Graduate
    December 10, 2025

    Currently using a

    * STM32G071 nucleo board

     

    SUB problem

    The larger sub problem was i couldn't figure out how to get the VDM messages to work.

     

    Solution

    • use reference example DEMOUCPD with cpu STM32G081 eval board
    • make sure your using USBPDCORE_PD3_FULL 
    • Enable VDMSupport
      • You can do this in the ioc file in the middleware 
      • Or usbpd_dpm_conf.h
    • In usbpd_dpm_userr.c, you need to init USBPD_VDM
    USBPD_StatusTypeDef USBPD_DPM_UserInit(void)
    {
    /* USER CODE BEGIN USBPD_DPM_UserInit */
    USBPD_VDM_UserInit(USBPD_PORT_0);
     return USBPD_OK;
    /* USER CODE END USBPD_DPM_UserInit */
    }​

     

    •  in usbpd_vdm_user.c you need to actually setup the callbacks for this subsystem 
    USBPD_StatusTypeDef USBPD_VDM_UserInit(uint8_t PortNum)
    {
    /* USER CODE BEGIN USBPD_VDM_UserInit */
    
     USBPD_PE_InitVDM_Callback(PortNum, (USBPD_VDM_Callbacks *)&vdmCallbacks);
    
     return USBPD_OK;
    /* USER CODE END USBPD_VDM_UserInit */
    }

     

    At this point you'll need to start defining some of these objects and looking at the eval example will help a lot with it.  At this point mixing most of the code in the usbpd_vdm_user.c from the eval project my usb monitor program looks like this.  Which was huge!  You can see the SNK send back a SVDM discovery identity packet!

     

    GotThePacketSentBack.png

    Documentation that was really helpful

    From the software stack guide

    VDM_description.png

     

    Technical Moderator
    December 11, 2025

    Hi @Brenden_PLUS 

    Welcome and thank you for your feedback.

    I suggest to nominate this thread as frequently asked question !