2024-08-12 06:10 PM - edited 2024-08-13 01:32 PM
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.
Solved! Go to Solution.
2024-10-24 07:38 AM
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
2024-08-14 04:14 AM
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.
2024-08-14 06:01 PM
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
2024-08-21 02:44 AM
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.
2024-10-24 07:38 AM
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