cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, I'm working on ST-NUCLEO G071RB with DRP1M1 board. The USB-PD negotiation is successful as attached image shown but no current is being drawn from the external PSU to the sink device (which is a power bank). Please provide solution/support, thank you.

ccheo.1
Associate II

0693W00000aJo9dQAC.png

7 REPLIES 7
PPAIL.1
ST Employee

Hello ccheo.1,

Thanks for reporting this problem on STM32G071RB,

This will be solved in our next x-cube-tcpp release, and to fix it immediately, please find here below some code to add is drp1m1_usbpd_pwr.c :

  • Add the following variable:

USBPD_StatusTypeDef ADC_Configured=USBPD_NOTSUPPORTED;

  • Correct the BSP_USBPD_PWR_VBUSInit function :

int32_t BSP_USBPD_PWR_VBUSInit(uint32_t PortNum)

{

 int32_t ret;

 /* Check if instance is valid */

 if (PortNum >= USBPD_PWR_INSTANCES_NBR)

 {

  ret = BSP_ERROR_WRONG_PARAM;

 }

 else

 {

  BSP_USBPD_PWR_TRACE(PortNum, "-- BSP_USBPD_PWR_VBUSInit --");

  /* Initialize required HW for VBUS management */

  switch (USBPD_PWR_Port_Configs[PortNum].Type)

  {

   case USBPD_PWR_HW_CONFIG_TYPE_TCPP02:

   case USBPD_PWR_HW_CONFIG_TYPE_TCPP03:

    /* Switch to Normal mode */

    ret = BSP_USBPD_PWR_SetPowerMode(PortNum, USBPD_PWR_MODE_NORMAL);

    if (ADC_Configured!=USBPD_OK)

    {

     PWR_TCPP0203_Configure_ADC();

     ADC_Configured=USBPD_OK;

    }

    PWR_TCPP0203_Activate_ADC();

    /* Start Conversion */

    LL_ADC_REG_StartConversion(VISENSE_ADC_INSTANCE);

    break;

   case USBPD_PWR_HW_CONFIG_TYPE_DEFAULT:

   case USBPD_PWR_HW_CONFIG_TYPE_TCPP01:

   default:

    ret = BSP_ERROR_FEATURE_NOT_SUPPORTED;

    break;

  }

 }

 return ret;

}

Best regards

Pascal

ccheo.1
Associate II

Hi Pascal,

Thank you for your support but still I couldn't charge the power bank with the quick fix given. I'll show you my setup, I'm not sure what else is missing out for the external PSU to supply the current. Please advise, thank you very much.

Regards,

CM0693W00000bhMi9QAE.jpg0693W00000bhMi4QAE.jpg

PPAIL.1
ST Employee

Hi ccheo.1,

I tried to reproduce your case connecting an SNK1M1 to the DRP1M1. The sink device is loaded by a variable resistor.

0693W00000bhOZdQAM.jpg0693W00000bhOZsQAM.jpgThe contract is in 5V and we can observe the current is rising as I increase the load.

But, I can observe on your power supply and on the measurement that you are started negotiation under 15V.

The negotiation should occur under default 5V as in the example below where you can observe 4 phases,

- before connection

- The negotiation

- The power supply ramp up

- The steady state at 20V

0693W00000bhOabQAE.jpgThis can explain why the power bank does not charge.

Please can you try supplying your DRP under 5V, and perhaps increase the SINK load with an external resistor ?

The STEVAL-2STPD01 is a USB Type-C Power delivery dual port adapter. This can be an example for the Provider side of your dual role Power delivery device.

Best regards

Pascal

ccheo.1
Associate II

Hi Pascal,

Thank you for your support, I can now get the external PSU to supply current. However, I can charge type A pd power bank but not type B pd power bank. Type A power bank is a commercial power bank as you can see in the figure below, I swap the power role to SNK role after connected and hard reset it afterwards while type B power bank's USB C port is only designed to be charged, so no power role swap is performed. Do you have any ideas/thoughts on this? Thank you.

0693W00000bhYgFQAU.jpgFigure 1: Type A pd power bank

0693W00000bhYflQAE.jpgFigure 2: Type B pd power bank

PPAIL.1
ST Employee

Hi ccheo.1,

Reading your traces, I can see that both power banks communicates in USBPD. They are both well connected as SINK.

Type A power bank selected PDO Number 2 (TimeStamp 38100 - objectPosition 2): so 9V - But due to the DRP1M1 board supply, the measurement is 5V, and up to 1.5 or 1.6A.

Reading the measurement graph, It seems you manually change the DRP1M1 supply voltage to 9V and back to 5V during the test ?

Type B power bank selected PDO Number 1 (TimeStamp 21753 - ObjectPosition 1): so 5V - And it current measurement is 30mA - The DRP1M1 does not limit the current under 3A in this case: it means that the battery does not request more current. It looks like an already charged battery.

I understand this is not the behavior you expected please can you explain. Also what Type A or type B power bank stand for ? What is their difference ? construction / interface ?

Best regards

Pascal

ccheo.1
Associate II

Hi Pascal,

Thank you for your support. Let's forget about the Type A power bank above, it's basically a random brand power bank in the market while Type B power bank is company's product. In short, my goal is to charge the company's power bank with different voltages such as 5V/9V/15V/20V. However, the external power supply is not supplying current to the power bank even though the pd communication is completed. In addition, with the exact same setup, the external power supply would supply current if I connected it to random brand power bank in the market or my phone. It would be great if you could find any clues from the traces that could explain the behaviors. I'll share you the traces for different cases at below. Hope it clears the picture and please request for more info if needed, thank you.


_legacyfs_online_stmicro_images_0693W00000bhdpqQAA.pngFigure1: Company's power bank UCPD trace

Remark:

1) The company's power bank is not fully charged. If I use a 100W USB pd charger to charge it, it could receive 20V with 5A current.

2) The external power supply is set to 5V@0.5A.

PPAIL.1
ST Employee

Hi ccheo.1,

I understand your point: you cannot charge your power bank at 5A @ 20V with our DRP1M1 while you can with a 100W pd charger.

I tried to reproduce implementing 2 PDO in the DRP1M1 : 5V and 9V connected to a SNK1M1 choosing the highest PDO.

Here is the UCPD monitor screenshot:


_legacyfs_online_stmicro_images_0693W00000bheTlQAI.pngSo I reproduce an expected working mode.

Does-it help if you change PDO4 from 20V-3.25A to 20V-5A as your commercial charger capability ?

I continue my investigations

Best regards

Pascal