USB 2.0 charger detection in i.mx 8M mini

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB 2.0 charger detection in i.mx 8M mini

ソリューションへジャンプ
654件の閲覧回数
BHAVANI_S
Contributor I

Hi all,

We are having a custom board based on I.MX 8M mini. We want to have the usb charger detection functionality to limit the current drawn from a max charger IC. The reference manual of imx8m mini specifies that it supports Battery charging specification 1.2 in the features section of Universal Serial Bus 2.0 PHY (refer page 2928 Section 11.2.1.2 Features of i.MX 8M Mini Applications Processor Reference Manual). 

As per the reference manual I.MX8M mini does not have a seperate unit or registers for Charger detection.

The 29 bit (CHRGDET) in USBNC_n_PHY_STATUS register contains the information on charger detection output. But does not specify whether the external charger connected is a DCP or a CDP.

We were also able to find an external signal CHGDET<#> responsible for Battery charger detection output. (refer section 11.2.3 page no. 2932).

We are looking for usb charger detection functionality  similar to imx6q in imx8. Please could you help us with the solution and help us in understanding how is the imx8m mini implementing this feature.

 

Thanks and Regards,

Bhavani S

0 件の賞賛
1 解決策
620件の閲覧回数
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @BHAVANI_S,

I have included below my replies to your queries,

 

"As per the reference manual I.MX8M mini does not have a separate unit or registers for Charger detection."
=> Yes, your understanding is correct. IMX8M mini does not have such functionality.

 

"The 29-bit (CHRGDET) in the USBNC_n_PHY_STATUS register contains the information on charger detection output. But does not specify whether the external charger connected is a DCP or a CDP."
=> The CHRGDET bit will indicate whether the voltage level on USB_OTG*_DP or USB_OTG*_DN is greater than VDAT_REF as defined in the "USB Battery Charger, Revision 1.2 Specification."
We can predict using the voltage level that the connected charger is DCP or CDP from the USB Battery Charger specification. But it depends on the charger.

 

I hope it helps!

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

 

Thanks & Regards,
Dhruvit.

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
621件の閲覧回数
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @BHAVANI_S,

I have included below my replies to your queries,

 

"As per the reference manual I.MX8M mini does not have a separate unit or registers for Charger detection."
=> Yes, your understanding is correct. IMX8M mini does not have such functionality.

 

"The 29-bit (CHRGDET) in the USBNC_n_PHY_STATUS register contains the information on charger detection output. But does not specify whether the external charger connected is a DCP or a CDP."
=> The CHRGDET bit will indicate whether the voltage level on USB_OTG*_DP or USB_OTG*_DN is greater than VDAT_REF as defined in the "USB Battery Charger, Revision 1.2 Specification."
We can predict using the voltage level that the connected charger is DCP or CDP from the USB Battery Charger specification. But it depends on the charger.

 

I hope it helps!

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

 

Thanks & Regards,
Dhruvit.

0 件の賞賛
610件の閲覧回数
BHAVANI_S
Contributor I

Hi Dhruvit,

Thanks for the response. We were able to proceed on this and we are able to detect the connected host.

We are facing some issues during the detection. We are testing the detection in various scenarios and the  details are as mentioned below.

1. USB is connected before booting the kernel:

The detection of the host charger connected is happening fine when the cable is connected to the charger before kernel boots up. 

2.   USB is not connected before booting the kernel and then hotplugged:

The detection is also happening fine when the cable is not connected to the charger and on ,kernel bootup the cable is hotplugged. We observe that in this case the BSVIS[USBx_nOTGSC[19]] interrupt which indicates that "VBus has either risen above or fallen below the B session valid threshold" is set  and hence it is enabling the vbus comparator, entering the "usb_gadget_vbus_connect" function in kernel/drivers/usb/gadget/udc/core.c and also completing the detection process.

3.  USB is connected before booting the kernel and then again hotplugged:

In this case the "BSVIS"[USBx_nOTGSC[19] register bit] is not getting set  and hence not indicating that there is a change in vbus connected and its not entering the detection process. 

 

We are stuck with this issue and require your help in understanding the reason for the interrupt not getting generated and also how can we reinitiate the detection process on hotplug.

 

Thanks and Regards,

Bhavani S

0 件の賞賛
605件の閲覧回数
Dhruvit
NXP TechSupport
NXP TechSupport
Hi,
I have sent an email with additional details.

Thanks & Regards,
Dhruvit.
0 件の賞賛
596件の閲覧回数
BHAVANI_S
Contributor I
Hi Dhruvit,
Have added the query in a separate thread.
0 件の賞賛