5 Replies Latest reply on Jun 15, 2020 7:32 AM by SananyaM_56

    Finding Mode of a BC1.2 Charger connected


      Hello all / RajathB_01,


      I'm taking referrence from low 3 discussions:

      Ref1 : CCG3PA as a BC1.2 Sink(Portable Device)

      Ref2: BC1.2Sink(PortableDevice) Functionality in CCg3pA

      Ref3: Re: CCG3PA as a BC1.2 Sink(Portable Device)


      I'm using ccg3pa for my development and in configuration utility

      I enabled BC1.2 configuration and disabled Apple charger mode in Charging configurations --> Sink settings tab.

      and in LEGACY_PD_PARALLEL_OPER  is 1u


      when a BC supported provider(DCP) is connected i can see bc_fsm_sink_dcp_connected() is being executed which is expected

      but when I connected cable to Laptop USB ports(CDP), I'm unable to see bc_fsm_sink_cdp_connected() executing.


      It is said as " But, the firmware is only identified DCP and SDP, there is no possible to go to CDP states"  by ShifangZ_26 in Ref2 discussion mentioned above

      Is CDP detection by ccg3pa is possible or not ?

      Do I need to make any changes in FW for detection of such ports.


      And in Ref1 discussion in Resolution summary it is said that DCP detection will be stored in bc_stat->cur_mode in same way as CDP by editing @ pdo.c file

      Is it @ pdo.c file or @ battery_charging.c file ??


      Can you please clarify this point?


      Thanks in Advance.


      Best Regards,


        • 1. Re: Finding Mode of a BC1.2 Charger connected

          Hello Pranay,


          -Yes CDP detection is supported by CCG3PA. Please let us know if you have checked for CDP connected state in bc_fsm_sink_secondary_charger_detect()?

          -Are you using the power bank firmware as reference? Please check for bc_stat->cur_mode in the battery_charging.c file.


          Best Regards,

          • 2. Re: Finding Mode of a BC1.2 Charger connected

            Hi SananyaM_56,


            Thanks for the response,


            I'm attaching the batter_charging.c file for your reference.


            -Yes, I'm using power bank firmware as release build.


            -Yes, in bc_fsm_sink_secondary_charger_detect(), I added bc_stat->cur_mode = BC_CHARGE_CDP , but still execution is not even entering this condition when I connect typeA-C cable to my laptop USB port. so when I read bc_stat->cur_mode I'm getting 0 (zero) as a return value which is not expected for a CDP .


            I'm not sure why this is happening, My requirement is to detect what kind of DUT is connected(DCP / SDP/ CDP), but now I'm able to detect on DCP using bc_stat->cur_mode.


            Am I missing anything here,

            Do i need to add any other snippet for detection ?

            Can you also verify this from your end ?




            • 3. Re: Finding Mode of a BC1.2 Charger connected

              Hi SananyaM_56,


              Any update on this thread so far ?


              Expecting an early reply.




              • 4. Re: Finding Mode of a BC1.2 Charger connected

                Hi SananyaM_56,

                I've a little observation here.

                I read "bc_status_t  gl_bc_status[0];" structure when DCP and CDP is connected and I'm attaching that log here.

                I came to know that when DCP(Any BC12 Charger) is connected:

                    cur_mode is  BC_CHARGE_DCP and

                    bc_fsm_state is BC_FSM_SINK_DCP_CONNECTED


                but when a CDP(Mobile phone or laptop port) is connected:

                    cur_mode is BC_CHARGE_NONE  and

                    bc_fsm_state is BC_FSM_SINK_TYPE_C_ONLY_SOURCE_CONNECTED


                Find the attached logger.

                Am I missing anything here that needs to be addressed ?


                Is the sequence expected or will CDP detection works with ccg3pa ??




                • 5. Re: Finding Mode of a BC1.2 Charger connected

                  Hi Pranay,


                  I tested using my laptop's port and saw the same behavior as in your logs i.e. detection is failing at primary detection. Based on the voltage levels, the DM voltage is less than VDP_SRC in primary detection so it fails and enters the else condition. Comparing with BC 1.2 Spec, the port qualifies as a SDP.


                  But using a DCP and CDP port from our hub, I was able to see secondary detection in both cases and bc_fsm_state updated correctly. However, the cur_mode still needs to be updated for CDP as you have already done in your code.


                  Please use a different CDP charger if possible or let us know the DP/DM voltage levels when connecting to the laptop port.


                  Best Regards,