cancel
Showing results for 
Search instead for 
Did you mean: 

USBPD PDO Sink tab missing

AWack
Associate III

Hi,

I just watched this video here: How to build an USBPD Sink application using the X-Cube-TCPP software pack - YouTube which explains how to build up a project with TCPP package for CubeMX.

I use the newest CubeMX 6.11.1 but it looks different than in the video: means that the tab "PDO Sink" is missing.

 

Any idea?

Best regards,

Achim

Capture.PNG

 

12 REPLIES 12
PPAIL.1
ST Employee

Hi AWack

You are right, depending on the MCU there are two options:

- A "PDO General definition" tab, as you have. You can describe there the number of sink PDO and the Sink PDO definitions below, but defined as a number as described in the tables form the standard.

(On your screenshot, the first PDO 0x26019096 is the 5V, 1.5A default PDO)

or

- A "Sink PDO" tab (or 'Source PDO" tab) with clear definitions of the PDO voltage and Current.

 

Thank you for reporting this difference, the trend is to have the definition of the PDO in clear values

I hope I answered you question,

Best regards

Pascal

 

Hi Pascal,

ok. I hope this Sink PDO tab is planned for all MCUs?

Just defining a second PDO in the general tab unfortunately does not select the highest voltage automatically. Is this intended? As I understood the highest available PDO is automatically selected...

Best regards,

Achim

Hi AWack

The Sink PDO (or Source PDO) is available for all MCU with UCPD except STM32G0xx.

Please can you confirm you are using STM32G0xx ?

 

The application selects the PDO with the highest power matching sink and source. Sometimes this is not the highest voltage.

Please can you share PDO values you implement or a screenshot of your "PDO General Definition" tab.

 

Best regards

Pascal

Hi Pascal,

yes I use the STM32G0B1CEU.

PDO0 is 0x26019096

PDO1 is 0x26064096

Several month ago when edited all the source code by hand the PDO1 values definitely work with the same power supply...

For my understanding: The STM32CubeMonitor USB-PD has two views: the first page where detected boards shall be shown and a second trace view after selecting a COM port in the Select Tracer Port upper right corner. I´ve selected USART1 to TRACE Source. Hence a shall see anything on USART1 in the monitor?

Best regards,

Achim

 

Hi Pascal,

now I tried to build up a new project.

Once I get as Trace:

AWack_0-1719320197654.png

And now permanently ADVICE: Update_BSP_USBPD_PWR_VBUSGetVoltage

Achim

 

Hi AWack

In usbpd_pwr_user.c, in the _weak function "BSP_USBPD_PWR_VBUSGetVoltage"

replace default code between   /* USER CODE BEGIN BSP_USBPD_PWR_VBUSGetVoltage */ and  

/* USER CODE END BSP_USBPD_PWR_VBUSGetVoltage */ by the following:

 
 
  /* Check if instance is valid */
  int32_t ret = BSP_ERROR_NONE;
  if ((Instance >= USBPD_PWR_INSTANCES_NBR) || (NULL == pVoltage))
  {
    ret = BSP_ERROR_WRONG_PARAM;
    *pVoltage = 0;
  }
  else
  {
    uint32_t value;
uint32_t vadc;
uint32_t voltage;
    value = LL_ADC_REG_ReadConversionData12(ADC1);
vadc = (value * VDDA_APPLI) / ADC_FULL_SCALE;
    voltage = vadc * (SNK1M1_VSENSE_RA + SNK1M1_VSENSE_RB ) / SNK1M1_VSENSE_RB ;
    *pVoltage = voltage;
  }
  return ret;
 
 
This will solve the missing VbusGetVoltage.
Are you using X-CUBE-TCPP software pack for STM32Cube-MX ? A wiki, a youtube tutorial ?
 
Best regards
Pascal
 

Hi AWack

Sorry, the answer to my last question is in your first post.

Please can you share your .ioc ?

Best regards

Pascal

Hi Pascal,

indeed the voltage reading is missing in the automatic generated code! (I use TCPP package with CubeIDE)

Then Ive tried to generate the code with MX and then it works! I´ve to investigate further, but I suspect, that maybe CubeIDE is not working correctly with the TCPP package...

I´ve not already the 20V running, but I get a trace (see attachement) in the meanwhile 🙂

 

Best regards,

Achim

 

 

Hi Pascal,

indeed! It is a problem with CubeIDE for Code generation.

Now I cleaned all USBPD and TCPP parts in the project and generated everything with CubeMX - and: I´ve 20V 🙂

 

Attached the trace. Do you think everything is fine?

 

Thank´s a lot for your quick support!

 

Best regards,

Achim