cancel
Showing results for 
Search instead for 
Did you mean: 

I am currently using a STM32G081b eval board with a STM32G474QE MCU I am using the demoucpd example code if i plug in display for my laptop it works over usb c but doesn't on mobiles device does anyone know why?

NApps.1
Associate II
 
22 REPLIES 22

Also this is a log from a Dell XPS 15

Thanks for the logs... Just a remark, it will be fine to close CubeMonitor-UCPD to reset every time the log!

My analysis:

  • on your iPad: I can see that the power negotiation is done in 2 steps, request to 5V and then request to 9V. After DRS, if power is already to 9V, we can see the VDM negotiation seem OK. If VDM negotiation is done when contract is at 5V, VDM negotiation failed (I can see request from iPAD during this negoiation !?)
  • on your DELL, it seems working well every time, isn't it?
    • power negotiation directly to 15V
    • 1st VDM disco transaction done by Dell (0002182740 VENDOR_DEFINED VDM:SVDM_DISCOVER_SVIDS INIT)
    • VCONN swap triggered by DELL (0002182749 VCONN_SWAP)
    • VDM negotiation successfully thanks to VDM enter mode (0002182949 VENDOR_DEFINED VDM:SVDM_ENTER_MODE INIT)

As you know, STM32G081 does not support USB, can it be an issue for iPAD? Can you try to delay the Data Role Swap to be sure the power contract has been established to 9V? (Usage timer in DPM can be found HERE...)

void USBPD_DPM_Notification(uint8_t PortNum, USBPD_NotifyEventValue_TypeDef EventVal)
{
  char _str[20];
/* USER CODE BEGIN USBPD_DPM_Notification */
  switch(EventVal)
  {
  case USBPD_NOTIFY_STATE_SRC_READY:
    {
      /* Check that the current data role is not already in UFP (device) */
      if (USBPD_PORTDATAROLE_DFP == DPM_Params[PortNum].PE_DataRole)
      {
         if (USBPD_DPM_RequestDataRoleSwap(PortNum) != USBPD_OK){
 	        sprintf(_str, "Error with role swap");
 	        USBPD_TRACE_Add(USBPD_TRACE_DEBUG, 0, 0, (uint8_t*)_str, strlen(_str));
 	       DPM_START_TIMER(PortNum, DPM_TimerSRCExtendedCapa, DPM_TIMER_GET_SRC_CAPA_EXT);
         }
          //while(1); // Should not occur
      }
    }
    break;
  default :
    break;
  }
/* USER CODE END USBPD_DPM_Notification */
}

I attempted this to see if made any difference for iPad but still no display. On the dell it does work I just occasionally get the system trying to do a hardreset then loops doing that very random