2023-03-27 06:42 PM
2023-03-31 04:21 AM
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 :
USBPD_StatusTypeDef ADC_Configured=USBPD_NOTSUPPORTED;
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
2023-04-02 06:25 PM
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,
CM
2023-04-03 02:35 AM
Hi ccheo.1,
I tried to reproduce your case connecting an SNK1M1 to the DRP1M1. The sink device is loaded by a variable resistor.
The 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
This 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
2023-04-05 12:43 AM
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.
Figure 1: Type A pd power bank
Figure 2: Type B pd power bank
2023-04-05 10:56 PM
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
2023-04-06 12:10 AM - edited 2023-11-20 09:08 AM
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.
Figure1: 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.
2023-04-06 02:28 AM - edited 2023-11-20 09:08 AM
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:
So 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