Skip to main content
Visitor II
March 10, 2020
Solved

USB PD library Can't source higher than 5V

  • March 10, 2020
  • 2 replies
  • 1907 views

Hello,

We are using x-cube-usb-pd v3 library to implement source/sink application for our product. We've ported it to use on an STM32F030CC and using PTN5110 chip for TCPC controller. We are using configuration USBPD_TCPM_LIB_PD3_CONFIG_1.

We have tested sourcing 5V 3A and is working well and now we'd like to go over 5V and want to support different voltages such as 9V and 12V.

However, we run into problem where we can't seem to do this.

On our hardware, we know we can support 9V or 12V output but for some reason, as soon as we turn the VBus to 9V, the vbus seems to disappear. I've collected a log again and attached here. I am testing with a phone this time (Huawei Redmi Note7).

I've also monitored the VBUS on a scope and I can see that it tries to go up ( to around 8V) and then it goes down to 0V. I also scoped the EN_SRC pin and that is pulled low at the same time 8V disappears.

It seems that before all that happens, we get an Hi voltage alarm and Low voltage alarm. I'm not sure if these are related but something is stopping from the VBUS to go up to the desired voltage.

Any help would be greatly appreciated.

Thanks,

AOF

    This topic has been closed for replies.
    Best answer by Yohann M.

    Hi AOF,

    All is fine... Thanks.

    The DRP application delivered for TCPM is based on 1 port only but we have examples in other FW packages with 2 ports.

    We have now a specific page for our USB-PD solutions:

    https://www.st.com/en/interfaces-and-transceivers/usb-type-c-and-power-delivery-controllers.html

    You can have a look to FW package delivered on G0 and mainly the demonstrations done for EVAL_G0 (https://github.com/STMicroelectronics/STM32CubeG0/tree/master/Projects/STM32G081B-EVAL/Demonstrations/DemoUCPD)

    Regards,

    Yohann

    2 replies

    ST Employee
    March 10, 2020

    Dear AOF,

    Here is the extract of detach:

    <--- 0000098828 P0 SOP s:002 H:0x0001 GOODCRC
    debug 0000098830 P0 DEBUG0 "Alert= 0 "
    -pe - 0000098831 P0 PE_SRC_TRANSITION_SUPPLY
    debug 0000098833 P0 DEBUG0 "ValidAlert= 0 "
    debug 0000098865 P0 DEBUG0 "VbusVolt=4950 "
    -no - 0000098866 P0 NOTIFY_POWER_STATE_CHANGE
    debug 0000098869 P0 DEBUG0 "Target vbus= 9000"
    debug 0000098870 P0 DEBUG0 "HV ON"
    debug 0000098872 P0 DEBUG0 "1 9000V"
    -pe - 0000098874 P0 PE_SRC_TRANSITION_SUPPLY_EXIT
    debug 0000098874 P0 DEBUG0 "ALERT IT1"
    debug 0000098875 P0 DEBUG0 "ALERT_TASK"
    debug 0000098877 P0 DEBUG0 "Alert= 183 " (=> 0xB7 (CC_STATUS|PWR|RX|TX_FAIL|TX_DISC|VBUS_ALARM_HI)
    debug 0000098879 P0 DEBUG0 "ValidAlert= 1 "
    debug 0000098885 P0 DEBUG0 "CC_S2= 0 "
    debug 0000098887 P0 DEBUG0 "state=0 "
    debug 0000098891 P0 DEBUG0 "tcpc_set_power 0 "
    debug 0000098894 P0 DEBUG0 "Vbus= 0 "
    debug 0000098898 P0 DEBUG0 "0 0V"
    debug 0000098899 P0 DEBUG0 "tcpc_set_pin_role(DIS, RD)"
     
    ==== 0000098901 P0 EVENT_DETACHED ====

    An interruption is detected and when stack read values of CC lines, we detect both as detach (CC_S2= 0).

    You may have rights... it can be related to VBUS alarm. Can you try to disable it? (Registers.Control.s.u5.b5.DIS_VALRM = 1)

    Regards,

    Yohann

    Visitor II
    March 12, 2020

    Hi Yohann,

    So Alert = 183 is already in hex value so it's reporting low voltage alarm and high voltage alarm.

    I've disabled/changed the low/high voltage alarm threshold but still can't seem to get the 9V to come out at VBUS end. Feels like PTN chip is solely making a decision to turn off the SRC voltage.

    I've successfully modified the example code for on-semi dev board and while it doesn't go up to 9V, I can source out 6.7V.

    So we are really puzzled to why our application does not work.

    One question I have is why you do not use Command.TCPC_REG_COMMAND_SRC_VBUS_HIGH anywhere in the FUSB307 code.

    Wouldn't you send that command if you want to up the source voltage? Without this command, how come on-semi board can source higher voltage than 5V?

    Thanks,

    AOF

    ST Employee
    March 12, 2020

    Hi AOF,

    It seems that on EVAL_FUS307 board, the command SRC_VBUS_HIGH does not allow to enable correctly the SRC_HV_ON pin. It is why Onsemi suggests to use the pin PB12 to enable correctly the FPF2895C load switch (/* GPIO workaround for HV path - connect PB12 TP to SRC_HV TP*/).

    I updated the X-CUBE-USBPD github accordingly (commit 12).

    With the latest commit, I was able to switch to 12V.

    For your problem, we could try to discard the alert 0x183 in the function 'fusb305_tcpc_alert' and check if you have still a disconnection.

    Regards,

    Yohann

    Visitor II
    April 6, 2020

    Hi Yohann,

    Long time to talk to you. Hope all is well on your end.

    We finally figured out why our board was not putting the high voltage.

    The high voltage alarm was somehow re-set every time we supply 5V so we needed to set the high voltage cfg to 21V every time.

    I still need to do a bit of digging to completely understand the problem but it's for now solved.

    I have a new question - Have you built the library with USBPD_PORT_COUNT=2?

    I first ran into few issues and fixed few things as listed below.

    1. in USBPD_PWR_IF_Init(), it sets links to PDO values and number for PORT 0 but does not have code to do the same for PORT 1.
    2. DPM_Settings did not have a definition for PORT 1

    etc

    If you could test the code on your end with USBPD_PORT_COUNT=2, and add fixes to that would be helpful.

    Should have made a new thread - sorry.

    Thanks,

    AOF