Unable to detect the charger on imx6ull

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to detect the charger on imx6ull

5,127 Views
bhushan_b
Contributor I

Hi,

We are using i.MX6ULL and BQ25703A for charger detection.

We are following steps specified in "i.MX 6ULL Applications Processor Reference Manual, Rev. 1, 11/2017" at page no 3910.

After setting  "EN_B = 0, CHK_CHRG_B = 1 and CHK_CONTACT = 1" bits of CHRG_DETECTED register, we are monitoring PLUG_CONTACT bit of USB1_CHRG_DETECT_STAT register.

But when we connect USB cable to, dedicated charger it read low (i.e. 0) and it read high (i.e 1). which is not as per expectation as per defined flow in reference manual.

Please suggest us step to detect the dedicated charger, charging through PC/Laptop and data transfer to  the pc/laptop.

Thank you in advance.

0 Kudos
Reply
9 Replies

4,392 Views
sumankumar
Contributor I

Hi igor,

The imx6_charger_data_contact_detect shows "vbus is not valid".

Power on the device (vbus detection fine) -> Now device is ON -> Restart the device with USB connected -> The dmesg shows "vbus is not valid,". 

The entire serial console logs below.

SumanKumar at macbook-pro in ~/Downloads/work/logs

[02:47:07 PM] $ sudo picocom -b 115200 /dev/tty.usbserial-DN03EQZN

Password:

picocom v3.1

port is        : /dev/tty.usbserial-DN03EQZN

flowcontrol    : none

baudrate is    : 115200

parity is      : none

databits are   : 8

stopbits are   : 1

escape is      : C-a

local echo is  : no

noinit is      : no

noreset is     : no

hangup is      : no

nolock is      : no

send_cmd is    : sz -vv

receive_cmd is : rz -vv -E

imap is        :

omap is        :

emap is        : crcrlf,delbs,

logfile is     : none

initstring     : none

exit_after is  : not set

exit is        : no

Type [C-a] [C-h] to see available commands

Terminal ready

Freezing of tasks aborted after 0.001 seconds

PM: Some devices failed to suspend, or early wake event detected

__wmi_control_rx : event handler is not registered: event id 0x11001

PM: Some devices failed to suspend, or early wake event detected

PM: Some devices failed to suspend, or early wake event detected

PM: Some devices failed to suspend, or early wake event detected

cdc_acm 1-1.2:1.6: failed to set dtr/rts

sysrq: SysRq : Emergency Remount R/O

imx2-wdt 20bc000.wdog: Device shutdown: Expect reboot!

reboot: Restarting system with command 'userrequested'

U-Boot 2017.07-g4f38c7b (Sep 04 2018 - 07:55:17 -0700), Build: jenkins-C2-build-user-115

CPU:   Freescale i.MX6D rev1.2 at 792 MHz

Reset cause: WDOG

Board: cid

I2C:   ready

DRAM:  2 GiB

MMC:   FSL_SDHC: 0, FSL_SDHC: 1

SF: Detected gd25q16c with page size 256 Bytes, erase size 4 KiB, total 2 MiB

In:    serial

Out:   serial

Err:   serial

Net:   usb_ether

Hit any key to stop autoboot:  0

timeout irqstat=10000

timeout irqstat=10000

switch to partitions #0, OK

mmc1(part 0) is current device

Scanning mmc 1:1...

Found U-Boot script /6x_bootscript

4991 bytes read in 6 ms (811.5 KiB/s)

## Executing script at 10008000

** File not found uEnv.txt **

461824 bytes read in 17 ms (25.9 MiB/s)

SF: Detected gd25q16c with page size 256 Bytes, erase size 4 KiB, total 2 MiB

device 0 offset 0x400, size 0x70c00

SF: 461824 bytes @ 0x400 Read: OK

Total of 461824 byte(s) were the same

50571 bytes read in 9 ms (5.4 MiB/s)

btmac=00:19:b8:b4:3d:72

9568920 bytes read in 263 ms (34.7 MiB/s)

1613049 bytes read in 49 ms (31.4 MiB/s)

Kernel image @ 0x10800000 [ 0x000000 - 0x920298 ]

## Loading init Ramdisk from Legacy Image at 13800000 ...

   Image Name:   RAM Disk

   Image Type:   ARM Linux RAMDisk Image (gzip compressed)

   Data Size:    1612985 Bytes = 1.5 MiB

   Load Address: 00000000

   Entry Point:  00000000

   Verifying Checksum ... OK

## Flattened Device Tree blob at 13000000

   Booting using the fdt blob at 0x13000000

   reserving fdt memory region: addr=13000000 size=d000

   Using Device Tree in place at 13000000, end 1300ffff

Starting kernel ...

max7w-uart: version 1.0

imx_usb 2184000.usb: vbus is not valid, 6

imx_usb 2184000.usb: Error occurs during detection: -22

Ov5642_mipi probe called wrw

imx_usb 2184000.usb: vbus is not valid, 6

imx_usb 2184000.usb: Error occurs during detection: -22

mxc_v4l2_master_attach: 0

fingersensor init called wrw

fingersensor_probe: starting probe for fingerprint

FP--no mclk deferring

snvs-secvio 20cc000.caam-snvs: can't get snvs clock

fingersensor_probe: starting probe for fingerprint

mxc_v4l2_master_attach: 0

REturning error from CIS FP

INIT_CIS_ERROR FP

init: waitpid failed: No child processes

init: init.freescale.i.MX6Q.rc: 163: invalid keyword 'setenforce'

init: do_start: Service debuggerd64 not found

init: property_set("ro.adb.secure", "1") failed

init: cannot find '/system/bin/update_verifier' (No such file or directory), disabling 'exec 2 (/system/bin/update_verifier)'

configfs-gadget gadget: unbind function 'mtp'/d6bff200

configfs-gadget gadget: unbind function 'Function FS Gadget'/d6ca6b64

configfs-gadget gadget: unbind function 'mtp'/d6bff200

configfs-gadget gadget: unbind function 'Function FS Gadget'/d6b4ff24

mxc_v4l_open: Mxc Camera no sensor ipu0/csi0

mxc_v4l_open: Mxc Camera ipu0/csi0

ipu_csi_window_size_crop: Error left=0 top=59455247

REturning error from CIS FP

INIT_CIS_ERROR FP

mxc_v4l_open: Mxc Camera no sensor ipu0/csi1

mxc_v4l_open: Mxc Camera ipu0/csi1

mxc_v4l_open: Mxc Camera no sensor ipu0/csi1

mxc_v4l_open: Mxc Camera ipu0/csi1

hifDeviceInserted: Dumping clocks (50000000,198000000)

mxc_v4l_open: Mxc Camera no sensor ipu0/csi1

mxc_v4l_open: Mxc Camera ipu0/csi1

0 Kudos
Reply

4,392 Views
bhushan_b
Contributor I

Hello,

Continuing with above query.........

Today we have also tried with linux USB driver "linux/drivers/usb/chipidea/usbmisc_imx.c".

But when we connect usb charger,  observed that "imx6_charger_data_contact_detect()" function never called.

Last called function is "usbmisc_imx6_hsic_set_clk" function,and observed that it does not enter in to if condition.

And in driver most of called function are related to  i.mx6q.

Can we use same driver for i.mx6ull?

Please provide us solution on same.

 

Best Regards,

Bhushan Bute

0 Kudos
Reply

4,392 Views
igorpadykov
NXP Employee
NXP Employee

please try procedure described in sect.39.2.8 USB Charger Detection

attached Linux Manual. Use Demo Images from

i.MX Software|NXP 

Best regards
igor

0 Kudos
Reply

4,392 Views
bhushan_b
Contributor I

We already done setting suggested in document.

In our case there is no file under the path "/sys/class/power_supply/"

0 Kudos
Reply

4,392 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bhushan

one can try use settings found in usb linux driver (function imx6_charger_data_contact_detect()):

linux/drivers/usb/chipidea/usbmisc_imx.c

usbmisc_imx.c\chipidea\usb\drivers - linux-imx - i.MX Linux kernel 

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

0 Kudos
Reply

4,392 Views
bhushan_b
Contributor I

Hi Igor,

As per your suggestion we have tried the setting suggested by you.

With dedicated charger, we are getting "0x0000000C" value of "USB1_CHRG_DETECT_STAT"(0x20C81D0) register means DP_STATE and DM_STATE are high, but unable to detect PLUD_CONTACT = 1.

And with PC/Laptop, we are getting "0x00000001" value of "USB1_CHRG_DETECT_STAT"(0x20C81D0) register.

we are not using linux/drivers/usb/chipidea/usbmisc_imx.c deriver file.

We have done the implementation as per flow chart on page no 3910 of reference manual.

Is there any changes required in .dtb or u-boot or uimage?

Please provide us solution on same.

Best Regards,

Bhushan Bute

0 Kudos
Reply

4,392 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bhushan

sorry, nxp support only own official linux releases described on

i.MX Software|NXP 

for support with other operatings systems one can follow

NXP Professional Services|NXP 

Best regards
igor

0 Kudos
Reply

4,392 Views
bhushan_b
Contributor I

We have Linux version "L4.1.15_2.0.0", which we have taken from yocto and it is NXP linux.

0 Kudos
Reply

4,392 Views
igorpadykov
NXP Employee
NXP Employee

I checked internally, there were no issues with charger detection, other customers

successfully used it. Suggest once more time recheck connections with oscilloscope

and test probably with baremetal test. Unfortunately I do not have additional documentation

for that, sorry.

Best regards
igor.

0 Kudos
Reply