-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.
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 ?
battery_charging.zip 13.2 K
I've a little observation here.
I read "bc_status_t gl_bc_status;" 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 ??
bc12_log.txt.zip 1,011 bytes
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.