Index: trunk/fw_g473rct/USBPD/Target/usbpd_dpm_conf.h
===================================================================
--- trunk/fw_g473rct/USBPD/Target/usbpd_dpm_conf.h	(revision 59)
+++ trunk/fw_g473rct/USBPD/Target/usbpd_dpm_conf.h	(revision 65)
@@ -64,5 +64,5 @@
     .PE_SupportedSOP = USBPD_SUPPORTED_SOP_SOP    , /* Supported SOP : SOP, SOP' SOP" SOP'Debug SOP"Debug */
     .PE_SpecRevision = USBPD_SPECIFICATION_REV3,/* spec revision value                                     */
-    .PE_DefaultRole = USBPD_PORTPOWERROLE_SNK,  /* Default port role                                       */
+    .PE_DefaultRole = USBPD_PORTPOWERROLE_SRC,  /* Default port role                                       */
     .PE_RoleSwap = USBPD_FALSE,                  /* support port role swap                                  */
     .PE_VDMSupport = USBPD_FALSE,
@@ -72,4 +72,5 @@
     .PE_CapscounterSupport = USBPD_FALSE,       /* support caps counter                                    */
     .CAD_RoleToggle = USBPD_FALSE,               /* CAD role toggle                                         */
+    .CAD_DefaultResistor = 0x02u,
     .CAD_TryFeature = 0,              /* CAD try feature                                         */
     .CAD_AccesorySupport = USBPD_FALSE,         /* CAD accessory support                                   */
@@ -107,38 +108,8 @@
 {
   {
-    .PE_DataSwap = USBPD_FALSE,                  /* support data swap                                       */
+    .PE_DataSwap = USBPD_TRUE,                  /* support data swap                                       */
     .PE_VconnSwap = USBPD_FALSE,                 /* support VCONN swap                                  */
-    .PE_DR_Swap_To_DFP = USBPD_FALSE,                  /*  Support of DR Swap to DFP                                  */
-    .PE_DR_Swap_To_UFP = USBPD_FALSE,                  /*  Support of DR Swap to UFP                                  */
-     .DPM_SNKExtendedCapa =                        /*!< SNK Extended Capability        */
-	 {
-	   .VID                    = USBPD_VID,  /*!< Vendor ID (assigned by the USB-IF)                      */
-	   .PID                    = USBPD_PID,  /*!< Product ID (assigned by the manufacturer)               */
-	   .XID                    = USBPD_XID,  /*!< Value provided by the USB-IF assigned to the product    */
-	   .FW_revision            = 1,          /*!< Firmware version number                                 */
-	   .HW_revision            = 2,          /*!< Hardware version number                                 */
-       .SKEDB_Version          = USBPD_SKEDB_VERSION_1P0,  /*!<SKEDV Version (not the specification Version)
-                                                               based on @ref USBPD_SKEDB_VERSION          */
-       .LoadStep               = USBPD_SKEDB_LOADSTEP_150MA,/*!< Load Step based on @ref USBPD_SKEDB_LOADSTEP */
-       .SinkLoadCharac.b       =             /*!< Sink Load Characteristics                               */
-        {
-           .PercentOverload    = 0,          /*!< Percent overload in 10% increments Values higher than 25
-                                                  (11001b) are clipped to 250%. 00000b is the default.    */
-           .OverloadPeriod     = 0,          /*!< Overload period in 20ms when bits 0-4 non-zero          */
-           .DutyCycle          = 0,          /*!< Duty Cycle in 5% increments when bits 0-4 are non-zero  */
-           .VBusVoltageDrop    = 0,          /*!< Can tolerate VBUS Voltage drop                          */
-        },
-       .Compliance             = 0,          /*!< Compliance based on combination of @ref USBPD_SKEDB_COMPLIANCE */
-       .Touchtemp              = USBPD_SKEDB_TOUCHTEMP_NA,  /*< Touch Temp based on @ref USBPD_SKEDB_TOUCHTEMP   */
-       .BatteryInfo            = 0,          /*!< Battery info                                                   */
-       .SinkModes              = 0,          /*!< Sink Modes based on combination of @ref USBPD_SKEDB_SINKMODES  */
-       .SinkMinimumPDP        = 0,          /*!< The Minimum PDP required by the Sink to operate without
-                                                  consuming any power from its Battery(s) should it have one     */
-       .SinkOperationalPDP     = 0,          /*!< The PDP the Sink requires to operate normally. For Sinks with
-                                                  a Battery, it is the PDP rating of the charger supplied with
-                                                  it or recommended for it.                                      */
-       .SinkMaximumPDP         = 0,          /*!< The Maximum PDP the Sink can consume to operate and
-                                                  charge its Battery(s) should it have one                       */
-      },
+    .PE_DR_Swap_To_DFP = USBPD_TRUE,                  /*  Support of DR Swap to DFP                                  */
+    .PE_DR_Swap_To_UFP = USBPD_TRUE,                  /*  Support of DR Swap to UFP                                  */
 #if defined(USBPD_REV30_SUPPORT)
 #if _MANU_INFO
Index: trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.c
===================================================================
--- trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.c	(revision 59)
+++ trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.c	(revision 65)
@@ -36,5 +36,7 @@
 #endif /* _TRACE */
 /* USER CODE BEGIN Includes */
-
+#ifdef DEBUG
+#include <stdio.h>
+#endif
 /* USER CODE END Includes */
 
@@ -182,32 +184,47 @@
 void USBPD_DPM_UserCableDetection(uint8_t PortNum, USBPD_CAD_EVENT State)
 {
-/* USER CODE BEGIN USBPD_DPM_UserCableDetection */
-DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_UserCableDetection");
-  // switch(State)
-  // {
-  // case USBPD_CAD_EVENT_ATTACHED:
-  // case USBPD_CAD_EVENT_ATTEMC:
-    // {
-      // if (USBPD_OK != USBPD_PWR_IF_VBUSEnable(PortNum))
-      // {
-        // /* Should not occur */
-        // HAL_Delay(6000);
-        // NVIC_SystemReset();
-      // }
-      // break;
-    // }
-  // case USBPD_CAD_EVENT_DETACHED :
-  // case USBPD_CAD_EVENT_EMC :
-  // default :
-    // {
-      // if (USBPD_OK != USBPD_PWR_IF_VBUSDisable(PortNum))
-      // {
-        // /* Should not occur */
-        // while(1);
-      // }
-      // break;
-    // }
-  // }
-/* USER CODE END USBPD_DPM_UserCableDetection */
+	/* USER CODE BEGIN USBPD_DPM_UserCableDetection */
+	DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_UserCableDetection");
+	switch(State)
+	{
+		case USBPD_CAD_EVENT_ATTACHED:
+		case USBPD_CAD_EVENT_ATTEMC:
+#ifdef DEBUG
+			printf("Cable attached\n");
+#endif
+			if (USBPD_OK != USBPD_PWR_IF_VBUSEnable(PortNum))
+			{
+				// Should not occur
+				while(1)
+				{
+#ifdef DEBUG
+					printf("ERRROR in USBPD_DPM_UserCableDetection!\n");
+#endif
+					HAL_Delay(2500U);
+				}
+			}
+			break;
+
+		case USBPD_CAD_EVENT_DETACHED:
+		case USBPD_CAD_EVENT_EMC:
+#ifdef DEBUG
+			printf("Cable disconnected\n");
+#endif
+			if (USBPD_OK != USBPD_PWR_IF_VBUSDisable(PortNum))
+			{
+				// Should not occur
+				while(1)
+				{
+#ifdef DEBUG
+					printf("ERRROR!\n");
+#endif
+					HAL_Delay(2500U);
+				}
+			}
+			break;
+		default:
+			break;
+	}
+	/* USER CODE END USBPD_DPM_UserCableDetection */
 }
 
@@ -241,43 +258,28 @@
 {
 /* USER CODE BEGIN USBPD_DPM_Notification */
-  /* Manage event notified by the stack? */
-  switch(EventVal)
-  {
-//    case USBPD_NOTIFY_POWER_EXPLICIT_CONTRACT :
-//      break;
-//    case USBPD_NOTIFY_REQUEST_ACCEPTED:
-//      break;
-//    case USBPD_NOTIFY_REQUEST_REJECTED:
-//    case USBPD_NOTIFY_REQUEST_WAIT:
-//      break;
-//    case USBPD_NOTIFY_POWER_SWAP_TO_SNK_DONE:
-//      break;
-//    case USBPD_NOTIFY_STATE_SNK_READY:
-//      break;
-//    case USBPD_NOTIFY_HARDRESET_RX:
-//    case USBPD_NOTIFY_HARDRESET_TX:
-//      break;
-//    case USBPD_NOTIFY_STATE_SRC_DISABLED:
-//      break;
-//    case USBPD_NOTIFY_ALERT_RECEIVED :
-//      break;
-//    case USBPD_NOTIFY_CABLERESET_REQUESTED :
-//      break;
-//    case USBPD_NOTIFY_MSG_NOT_SUPPORTED :
-//      break;
-//    case USBPD_NOTIFY_PE_DISABLED :
-//      break;
-//    case USBPD_NOTIFY_USBSTACK_START:
-//      break;
-//    case USBPD_NOTIFY_USBSTACK_STOP:
-//      break;
-//    case USBPD_NOTIFY_DATAROLESWAP_DFP :
-//      break;
-//    case USBPD_NOTIFY_DATAROLESWAP_UFP :
-//      break;
-    default:
-      DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: USBPD_DPM_Notification:%d", EventVal);
-      break;
-  }
+	// Manage event notified by the stack?
+	switch(EventVal)
+	{
+		case USBPD_NOTIFY_POWER_EXPLICIT_CONTRACT:	break;
+		case USBPD_NOTIFY_REQUEST_ACCEPTED:			break;
+		case USBPD_NOTIFY_REQUEST_REJECTED:			break;
+		case USBPD_NOTIFY_REQUEST_WAIT:				break;
+		case USBPD_NOTIFY_POWER_SWAP_TO_SNK_DONE:	break;
+		case USBPD_NOTIFY_STATE_SNK_READY:			break;
+		case USBPD_NOTIFY_HARDRESET_RX:				break;
+		case USBPD_NOTIFY_HARDRESET_TX:				break;
+		case USBPD_NOTIFY_STATE_SRC_DISABLED:		break;
+		case USBPD_NOTIFY_ALERT_RECEIVED:			break;
+		case USBPD_NOTIFY_CABLERESET_REQUESTED:		break;
+		case USBPD_NOTIFY_MSG_NOT_SUPPORTED:		break;
+		case USBPD_NOTIFY_PE_DISABLED:				break;
+		case USBPD_NOTIFY_USBSTACK_START:			break;
+		case USBPD_NOTIFY_USBSTACK_STOP:			break;
+		case USBPD_NOTIFY_DATAROLESWAP_DFP:			break;
+		case USBPD_NOTIFY_DATAROLESWAP_UFP:			break;
+		default:
+			DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: USBPD_DPM_Notification:%d", EventVal);
+			break;
+	}
 /* USER CODE END USBPD_DPM_Notification */
 }
@@ -295,4 +297,16 @@
   DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_HardReset");
 /* USER CODE END USBPD_DPM_HardReset */
+}
+
+/**
+  * @brief  Request the DPM to setup the new power level.
+  * @param  PortNum The current port number
+  * @retval USBPD status
+  */
+USBPD_StatusTypeDef USBPD_DPM_SetupNewPower(uint8_t PortNum)
+{
+/* USER CODE BEGIN USBPD_DPM_SetupNewPower */
+  return USBPD_PWR_IF_SetProfile(PortNum);
+/* USER CODE END USBPD_DPM_SetupNewPower */
 }
 
@@ -308,29 +322,31 @@
 {
 /* USER CODE BEGIN USBPD_DPM_GetDataInfo */
-  /* Check type of information targeted by request */
-  switch(DataId)
-  {
-//  case USBPD_CORE_DATATYPE_REQ_VOLTAGE:       /*!< Get voltage value requested for BIST tests, expect 5V*/
-//    *Size = 4;
-//    (void)memcpy((uint8_t *)Ptr, (uint8_t *)&DPM_Ports[PortNum].DPM_RequestedVoltage, *Size);
-    // break;
-//  case USBPD_CORE_DATATYPE_SRC_PDO:           /*!< Handling of port Source PDO                         */
-    // break;
-//  case USBPD_CORE_PPS_STATUS:                 /*!< PPS Status message content                          */
-    // break;
-//  case USBPD_CORE_SNK_EXTENDED_CAPA:          /*!< Retrieve of Sink Extended capability message content*/
-    // break;
-//  case USBPD_CORE_INFO_STATUS:                /*!< Information status message content                  */
-    // break;
-//  case USBPD_CORE_MANUFACTURER_INFO:          /*!< Retrieve of Manufacturer info message content       */
-    // break;
-//  case USBPD_CORE_BATTERY_STATUS:             /*!< Retrieve of Battery status message content          */
-    // break;
-//  case USBPD_CORE_BATTERY_CAPABILITY:         /*!< Retrieve of Battery capability message content      */
-    // break;
-  default:
-    DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_GetDataInfo:%d", DataId);
-    break;
-  }
+	// Check type of information targeted by request
+	switch(DataId)
+	{
+		//case USBPD_CORE_DATATYPE_REQ_VOLTAGE:       /*!< Get voltage value requested for BIST tests, expect 5V*/
+			//*Size = 4;
+			//(void)memcpy((uint8_t *)Ptr, (uint8_t *)&DPM_Ports[PortNum].DPM_RequestedVoltage, *Size);
+			//break;
+		case USBPD_CORE_DATATYPE_SRC_PDO:           /*!< Handling of port Source PDO                         */
+			USBPD_PWR_IF_GetPortPDOs(PortNum, DataId, Ptr, Size);
+			*Size *= 4;
+			break;
+		//case USBPD_CORE_PPS_STATUS:                 /*!< PPS Status message content                          */
+			// break;
+		//case USBPD_CORE_SNK_EXTENDED_CAPA:          /*!< Retrieve of Sink Extended capability message content*/
+			// break;
+		//case USBPD_CORE_INFO_STATUS:                /*!< Information status message content                  */
+			// break;
+		//case USBPD_CORE_MANUFACTURER_INFO:          /*!< Retrieve of Manufacturer info message content       */
+			// break;
+		//case USBPD_CORE_BATTERY_STATUS:             /*!< Retrieve of Battery status message content          */
+			// break;
+		//case USBPD_CORE_BATTERY_CAPABILITY:         /*!< Retrieve of Battery capability message content      */
+			// break;
+		default:
+			DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_GetDataInfo:%d", DataId);
+			break;
+	}
 /* USER CODE END USBPD_DPM_GetDataInfo */
 }
@@ -383,15 +399,23 @@
 
 /**
-  * @brief  Evaluate received Capabilities Message from Source port and prepare the request message
-  * @param  PortNum         Port number
-  * @param  PtrRequestData  Pointer on selected request data object
-  * @param  PtrPowerObjectType  Pointer on the power data object
-  * @retval None
-  */
-void USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType)
-{
-/* USER CODE BEGIN USBPD_DPM_SNK_EvaluateCapabilities */
-  DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_SNK_EvaluateCapabilities");
-/* USER CODE END USBPD_DPM_SNK_EvaluateCapabilities */
+  * @brief  Evaluate received Request Message from Sink port
+  * @param  PortNum Port number
+  * @param  PtrPowerObject  Pointer on the power data object
+  * @retval USBPD status : USBPD_ACCEPT, USBPD_REJECT, USBPD_WAIT, USBPD_GOTOMIN
+  */
+USBPD_StatusTypeDef USBPD_DPM_EvaluateRequest(uint8_t PortNum, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObject)
+{
+/* USER CODE BEGIN USBPD_DPM_EvaluateRequest */
+  /*
+    Set power data object to initialize value.
+    This parameter is used by the stack to start or not tPPSTimeout
+    (in case of USBPD_CORE_PDO_TYPE_APDO, stack will wait for periodic request
+    from the port partner in PPS mode).
+  */
+  *PtrPowerObject = USBPD_CORE_PDO_TYPE_FIXED;
+
+  DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: update USBPD_DPM_EvaluateRequest");
+  return USBPD_ACCEPT;
+/* USER CODE END USBPD_DPM_EvaluateRequest */
 }
 
@@ -827,7 +851,6 @@
 USBPD_StatusTypeDef USBPD_DPM_RequestGetSinkCapabilityExt(uint8_t PortNum)
 {
-  USBPD_StatusTypeDef _status = USBPD_PE_Request_CtrlMessage(PortNum, USBPD_CONTROLMSG_GET_SNK_CAPEXT, USBPD_SOPTYPE_SOP);
-  DPM_USER_ERROR_TRACE(PortNum, _status, "GET_SINK_CAPA_EXT not accepted by the stack");
-  return _status;
+  DPM_USER_ERROR_TRACE(PortNum, USBPD_ERROR, "GET_SINK_CAPA_EXT not accepted by the stack");
+  return USBPD_ERROR;
 }
 
Index: trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.h
===================================================================
--- trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.h	(revision 59)
+++ trunk/fw_g473rct/USBPD/Target/usbpd_dpm_user.h	(revision 65)
@@ -47,8 +47,7 @@
   uint32_t PE_DR_Swap_To_UFP                              : 1U;  /*!< If supported, DR Swap to UFP can be accepted or not by the user else directly rejected */
   uint32_t Reserved1                                      :28U;  /*!< Reserved bits */
-  USBPD_SNKPowerRequest_TypeDef DPM_SNKRequestedPower;          /*!< Requested Power by the sink board                     */
+  uint32_t            Reserved_ReqPower[6];                       /*!< Reserved bits to match with Resquested power information            */
   USBPD_MIDB_TypeDef  DPM_ManuInfoPort;                         /*!< Manufacturer information used for the port            */
-USBPD_SKEDB_TypeDef DPM_SNKExtendedCapa;                        /*!< SNK Extended Capability           */
-uint8_t             ReservedSnkCapa[3];                       /*!< Reserved bits to match with SnkCapaExt information     */
+uint32_t          ReservedSnkCapa[6];                       /*!< Reserved bits to match with SnkCapaExt information     */
   uint16_t            ReservedManu;                             /*!< Reserved bits to match with Manufacturer information            */
 } USBPD_USER_SettingsTypeDef;
@@ -105,10 +104,10 @@
   */
 void                USBPD_DPM_Notification(uint8_t PortNum, USBPD_NotifyEventValue_TypeDef EventVal);
+USBPD_StatusTypeDef USBPD_DPM_SetupNewPower(uint8_t PortNum);
 void                USBPD_DPM_HardReset(uint8_t PortNum, USBPD_PortPowerRole_TypeDef CurrentRole, USBPD_HR_Status_TypeDef Status);
 void                USBPD_DPM_ExtendedMessageReceived(uint8_t PortNum, USBPD_ExtendedMsg_TypeDef MsgType, uint8_t *ptrData, uint16_t DataSize);
 void                USBPD_DPM_GetDataInfo(uint8_t PortNum, USBPD_CORE_DataInfoType_TypeDef DataId , uint8_t *Ptr, uint32_t *Size);
 void                USBPD_DPM_SetDataInfo(uint8_t PortNum, USBPD_CORE_DataInfoType_TypeDef DataId , uint8_t *Ptr, uint32_t Size);
-void                USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType);
-uint32_t            USBPD_DPM_SNK_EvaluateMatchWithSRCPDO(uint8_t PortNum, uint32_t SrcPDO, uint32_t* PtrRequestedVoltage, uint32_t* PtrRequestedPower);
+USBPD_StatusTypeDef USBPD_DPM_EvaluateRequest(uint8_t PortNum, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObject);
 USBPD_StatusTypeDef USBPD_DPM_EvaluateVconnSwap(uint8_t PortNum);
 USBPD_StatusTypeDef USBPD_DPM_PE_VconnPwr(uint8_t PortNum, USBPD_FunctionalState State);
Index: trunk/fw_g473rct/USBPD/Target/usbpd_pwr_user.c
===================================================================
--- trunk/fw_g473rct/USBPD/Target/usbpd_pwr_user.c	(revision 59)
+++ trunk/fw_g473rct/USBPD/Target/usbpd_pwr_user.c	(revision 65)
@@ -29,4 +29,6 @@
 /* USER CODE BEGIN include */
 
+#include "gpio.h"
+
 /* USER CODE END include */
 
@@ -266,5 +268,8 @@
   else
   {
+	HAL_GPIO_WritePin(UCPD1_VBUS_GPIO_Port, UCPD1_VBUS_Pin, GPIO_PIN_RESET);
     PWR_DEBUG_TRACE(Instance, "ADVICE: Update BSP_USBPD_PWR_VBUSInit");
+	/* Need to keep DISCHARGE ON as soon as not powering VBUS on MB1397 */
+	//DISCHARGE_SET_ON();
   }
 
@@ -306,14 +311,15 @@
   /* USER CODE BEGIN BSP_USBPD_PWR_VBUSOn */
   /* Check if instance is valid       */
-  int32_t ret;
-
-  if (Instance >= USBPD_PWR_INSTANCES_NBR)
-  {
-    ret = BSP_ERROR_WRONG_PARAM;
-  }
-  else
-  {
-    ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
+  int32_t ret = BSP_ERROR_NONE;
+
+  if (Instance >= USBPD_PWR_INSTANCES_NBR)
+  {
+    ret = BSP_ERROR_WRONG_PARAM;
+  }
+  else
+  {
     PWR_DEBUG_TRACE(Instance, "ADVICE: Update BSP_USBPD_PWR_VBUSOn");
+	// Turning discharger off;
+	HAL_GPIO_WritePin(UCPD1_VBUS_GPIO_Port, UCPD1_VBUS_Pin, GPIO_PIN_SET);		// Turning Power Source on;
   }
   return ret;
@@ -332,14 +338,15 @@
   /* USER CODE BEGIN BSP_USBPD_PWR_VBUSOff */
   /* Check if instance is valid       */
-  int32_t ret;
-
-  if (Instance >= USBPD_PWR_INSTANCES_NBR)
-  {
-    ret = BSP_ERROR_WRONG_PARAM;
-  }
-  else
-  {
-    ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
+  int32_t ret = BSP_ERROR_NONE;
+
+  if (Instance >= USBPD_PWR_INSTANCES_NBR)
+  {
+    ret = BSP_ERROR_WRONG_PARAM;
+  }
+  else
+  {
     PWR_DEBUG_TRACE(Instance, "ADVICE: Update BSP_USBPD_PWR_VBUSOff");
+	HAL_GPIO_WritePin(UCPD1_VBUS_GPIO_Port, UCPD1_VBUS_Pin, GPIO_PIN_RESET);	// Turning Power Source off
+	// Turning on Discharge and waiting till Vbus voltage is at low level (750mV)
   }
   return ret;
@@ -480,6 +487,6 @@
   else
   {
-    ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
     PWR_DEBUG_TRACE(Instance, "ADVICE: Update BSP_USBPD_PWR_VBUSGetVoltage");
+	val = 5000U;
   }
   *pVoltage = val;
@@ -712,5 +719,5 @@
   /* USER CODE BEGIN BSP_USBPD_PWR_VBUSIsOn */
   /* Check if instance is valid       */
-  int32_t ret;
+  int32_t ret = BSP_ERROR_NONE;
   uint8_t state = 0U;
 
@@ -721,5 +728,6 @@
   else
   {
-    ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;
+    if (HAL_GPIO_ReadPin(UCPD1_VBUS_GPIO_Port, UCPD1_VBUS_Pin) == GPIO_PIN_SET)
+		state = 1U;
     PWR_DEBUG_TRACE(Instance, "ADVICE: Update BSP_USBPD_PWR_VBUSIsOn");
   }
