How to use Unstructured VDMs on a STM32G071 with USB-PD
I'm trying to send and receive Unstructured Vendor Defined Messages with the ST USB-PD stack but there is very little information in the documentation about the API.
I have found that I need to call USBPD_PE_UVDM_RequestMessage after which the stack will fire the USBPD_VDM_SendUVDM callback. However, the stack usually calls this function more than once, and it's not clear how to send more than 1 VDO.
Am I supposed to copy all of the data to the address given by pVDO or only copy 1 VDO each time the function is called? What is the maximum number of VDOs that I can send? Why does the stack call this function more than once when I can see on a PD traffic analyzer that only 1 message is sent over the wire?
Is there some document or example that actually explains how to use UVDMs? It seems like VDMs are mostly just used to enable DisplayPort support. I need to send small arbitrary messages between several boards connected with USB-PD.
@Yohann M.
I stripped out the function params on the initial question while trying to actually get it to submit, so here are the complete calls.
This function starts the process of sending a message: USBPD_PE_UVDM_RequestMessage(USBPD_PWR_TYPE_C_PORT_1, USBPD_SOPTYPE_SOP) .
This function is called by the stack multiple times afterward:
static void USBPD_VDM_SendUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef *pUVDM_Header, uint8_t *pNbData, uint32_t *pVDO).
Thanks,
Nathan

