Skip to main content
Graduate
August 13, 2024
Solved

STM32CubeMonUCPD ibus monitor show value zero

  • August 13, 2024
  • 2 replies
  • 2260 views

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

    This topic has been closed for replies.
    Best answer by LLECH.1

    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

    2 replies

    Technical Moderator
    August 14, 2024

    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.

    Robert7Author
    Graduate
    August 15, 2024

    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

    Technical Moderator
    August 21, 2024

    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

    LLECH.1Answer
    ST Employee
    October 24, 2024

    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