cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMonUCPD ibus monitor show value zero

Robert7
Associate III

Hello,

I am using STM32-U585I-IOT02A board. I have initialized USB-C SINK TCPP project with fixed 9V settings. On STM32CubeMonUCPD, 'ibus(mA)' value is always zero when connected BMS board shows charging current more than 1A. Please let me know if I missed something. Thank you.

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
LLECH.1
ST Employee

Hi @Robert7

The behavior you observed in STM32CubeMon UCPD is normal since the ADC measurement in BSP of B-U585I-IOT02A is not implemented. Indeed you can find in b_u585i_iot02a_usbpd_pwr.c file that API BSP_USBPD_PWR_VBUSGetCurrent doesn't compute the current value (adc_value variable) but only initializes it to 0.  If you want this current to be measured by the ADC, you can configure it by following this example : x-cube-tcpp/Drivers/BSP/X-NUCLEO-DRP1M1/drp1m1_usbpd_pwr.c at main · STMicroelectronics/x-cube-tcpp · GitHub

. In this example, ADC is configured to continuously read the current on VBUS line. A DMA channel is also configured to transfer the data read by ADC to a buffer in memory. 

 

Best Regards,

Lucas

View solution in original post

4 REPLIES 4
FBL
ST Employee

Hi @Robert7 

Good catch! It seems a bug in GUI interface. To reproduce, could you specify your BMS board? Could you reproduce using STM32G071B-DISCO - USB Type-C and Power Delivery Discovery kit with STM32G071RB MCU - STMicroelectronics. Or, you can add debug prints in the firmware to log current measurement values.

An internal ticket 188693 is submitted to dedicated team for further investigation.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!
Robert7
Associate III

Hi FBL,

Thank you for your reply.

I try to build a 'PDO SINK' project on B-U585I-IOT02A and I have followed steps of 'STMicroelectronics.X-CUBE-TCPP_GettingStarted'.

On STM32CubeMonUCPD, 'ibus(mA)' value seems mixed with Vbus(mV). But I can't find where is TCPP03-M20's Iana_gain settings in the generated code.

I would appreciate it if you could let me know where is PD13 USB_IANA calculation in 'BSP_USBPD_PWR_VBUSGetCurrent' function and how to separate the trace in LPUART1 or ADC4.

Please find below screenshot and attached for your reference.

Best regards.

Robert

 

Robert7_0-1723683190529.png

 

 

image.png

Hi @Robert7 

Just to keep you informed, I am not an expert in TCPPxx, but you can find GPIO configuration of Iana on the TCPP0203_PORT0_IANA_GPIO_PIN in PWR_TCPP0203_GPIOConfigInit(). You can add debug prints to make sure you are getting correct values

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!
LLECH.1
ST Employee

Hi @Robert7

The behavior you observed in STM32CubeMon UCPD is normal since the ADC measurement in BSP of B-U585I-IOT02A is not implemented. Indeed you can find in b_u585i_iot02a_usbpd_pwr.c file that API BSP_USBPD_PWR_VBUSGetCurrent doesn't compute the current value (adc_value variable) but only initializes it to 0.  If you want this current to be measured by the ADC, you can configure it by following this example : x-cube-tcpp/Drivers/BSP/X-NUCLEO-DRP1M1/drp1m1_usbpd_pwr.c at main · STMicroelectronics/x-cube-tcpp · GitHub

. In this example, ADC is configured to continuously read the current on VBUS line. A DMA channel is also configured to transfer the data read by ADC to a buffer in memory. 

 

Best Regards,

Lucas