Enabling Auto-Focus in ov5645 used in imx6

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

Enabling Auto-Focus in ov5645 used in imx6

1,973 Views
parveenkumaryad
Contributor III

Hi all,

I am working on a custom board based on imx6qd-sabresd.  I am using omnivision ov5645 camera over mipi interface for capturing video and live streaming. I have made the driver for the camera refering to the reference driver of ov5642 over mipi interface and by that i was successfully able to capture video from the camera and stream over wifi.

But i am facing some issue that are mentioned below:

1- When i tried to make the Auto Focus enable in the camera for which a firmware has to be downloaded, the kernel got crashed whenever it request for the firmware.(logs attched below)

2- While playing live video over LCD or HDMI using Gstreamer commands I am having some green patches at the corners of the screen and the video is also not of good quality as expected by ov5645 sensor.

3-While Streaming over wifi their were lot of lag in the video.

Auto Focus Crash:

ov5645_af_init auto focus intialization

ov5645_af_init download firmware

ov5645_af_init else download firmware

load_firmware loading firmware

_request_firmware requesting firmware to download

Unable to handle kernel NULL pointer dereference at virtual address 00000044

pgd = a8744000

[00000044] *pgd=387f9831, *pte=00000000, *ppte=00000000

Internal error: Oops: 17 [#1] PREEMPT SMP ARM

Modules linked in: cfg80211(O) wlcore_sdio(O) compat(O)

CPU: 0 PID: 444 Comm: v4l_id Tainted: G           O 3.10.17-1.0.0_ga+g232293e #15

task: a881c3c0 ti: a8b72000 task.ti: a8b72000

PC is at kobject_get+0x14/0x6c

LR is at device_add+0xbc/0x5b8

pc : [<8026a8a8>]    lr : [<8030129c>]    psr: 200f0013

sp : a8b73b78  ip : 00000000  fp : 80b6c80c

r10: 80b8a338  r9 : a8b73c50  r8 : a89be638

r7 : a89be600  r6 : a89be638  r5 : 00000000  r4 : 00000028

r3 : 00000044  r2 : 00000000  r1 : 80300250  r0 : 00000028

Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user

Control: 10c53c7d  Table: 3874404a  DAC: 00000015

Process v4l_id (pid: 444, stack limit = 0xa8b72238)

Stack: (0xa8b73b78 to 0xa8b74000)

3b60:                                                       a8ac0240 a89be640

3b80: 00000000 8030129c a8b73c50 80b8a338 80b6c80c 8026acb8 a8b73bc0 80aa4c80

3ba0: 805b83a4 a8577200 805b83a4 a8ac01c0 a89be600 a89be638 a8b73c50 80b8a338

3bc0: 80b6c80c 80310b10 a857723c a815cc10 80c002c8 00000000 80bfdee8 a8577200

3be0: 00000020 00001770 a857723c 00000001 80aa4c80 80bf0458 a8b73c50 a81a2c00

3c00: 000000ff 805c4634 00000020 a8ac0180 a8b73c50 00000001 80c002c8 80310e18

3c20: 00000000 805c4894 a8b73ba8 803deb98 a875fa80 8057661c 8001b7dc 00000000

3c40: a875fa80 80576864 f42c4074 1c01d25c a8025c80 60000013 00000001 00000000

3c60: a875fa80 80576864 00000001 8045622c 00000001 a81a2c00 a8025c80 80b95034

3c80: a801af00 00000000 00000280 a8460008 a8445800 80c002c8 a875fa80 803c5d10

3ca0: a8460000 803d6220 80080001 59565955 00000001 016e3600 000200da 80080001

3cc0: 59565955 00000001 016e3600 00000000 00000002 00000000 005b8d80 016e3600

3ce0: 016e3600 00000001 00000280 000001e0 59565955 00000000 00000000 00000000

3d00: 00000000 00000000 00000003 000000c1 80ba7880 00000002 ffffffff 00000000

3d20: 00000000 00000000 80ba8cc7 80ba7880 a87616a4 80b6c5c0 00000008 000200da

3d40: 00000000 00000003 00000000 00000002 80ba8980 8008f210 00000003 000000c1

3d60: 00000032 800882d8 00000000 a610d908 000000c0 a875ff00 a610d9dc 8008a5e8

3d80: 80ba7880 00000041 80ba7880 00000000 a89c88c0 00000001 800c22c8 a844b800

3da0: 00000000 800c22a8 800c22c8 a844b840 a800d400 a8445800 803d5f30 a875fa80

3dc0: a8445858 00000000 00000024 00000000 00000000 803b8d10 803b8c64 80bf578c

3de0: a844b800 a8443288 a875fa80 800c2628 a875fa80 00000000 a875fa80 a8443288

3e00: 00020000 a875fa88 800c2598 800bce2c 00000000 a8b73ebc a8b73f78 00020000

3e20: 00000000 a8b73ec0 00000024 800bcf40 a8b73f00 800ca768 a8b72000 800c87ac

3e40: 00000028 a8745db8 a89c8900 a8b72000 a875fa80 00000000 a6026000 00000000

3e60: 00000000 00000000 9087e695 00000006 a8649015 a8443288 a88b6b80 a875fa80

3e80: a8b73f00 a8b73f78 a8b73ec0 ffffff9c a8b72000 a8b72000 00000000 800cb070

3ea0: a8b73ebc 00000000 811207a0 8008e168 80c0f000 811207a0 00000000 00000000

3ec0: a84a06d0 a6005198 00000000 8008fa4c 00000000 a8b73f78 00000001 a8649000

3ee0: ffffff9c ffffff9c a8b72000 00000000 00000000 800cc03c 00000041 a8b73fb0

3f00: a84a06d0 a6005198 9087e695 00000006 a8649015 800c94d8 00000000 a60d3b28

3f20: a8443288 00000101 00000004 00000000 00000000 8057681c 00020000 800d747c

3f40: 80bf0458 00020000 00000001 00020000 a8649000 000085f0 00000001 00020000

3f60: a8649000 00000003 00000001 800bdeac 7ef66b44 80040464 00020000 00030000

3f80: 00000024 00000100 8000e204 7ef66f3e 7ef66e54 000085f0 00000005 8000e204

3fa0: a8b72000 8000e080 7ef66f3e 7ef66e54 7ef66f3e 00020000 00000000 00000000

3fc0: 7ef66f3e 7ef66e54 000085f0 00000005 00000000 00000000 76fb2000 00000000

3fe0: 76f136d4 7ef66c58 000084cc 76f13718 600f0010 7ef66f3e 00000000 00000000

[<8026a8a8>] (kobject_get+0x14/0x6c) from [<8030129c>] (device_add+0xbc/0x5b8)

[<8030129c>] (device_add+0xbc/0x5b8) from [<80310b10>] (_request_firmware+0x518/0x808)

[<80310b10>] (_request_firmware+0x518/0x808) from [<80310e18>] (request_firmware+0x18/0x20)

[<80310e18>] (request_firmware+0x18/0x20) from [<803deb98>] (ov5645_init_mode+0x7e0/0x9ec)

[<803deb98>] (ov5645_init_mode+0x7e0/0x9ec) from [<803c5d10>] (v4l2_int_ioctl_0+0x30/0x34)

[<803c5d10>] (v4l2_int_ioctl_0+0x30/0x34) from [<803d6220>] (mxc_v4l_open+0x2f0/0x394)

[<803d6220>] (mxc_v4l_open+0x2f0/0x394) from [<803b8d10>] (v4l2_open+0xac/0xe8)

[<803b8d10>] (v4l2_open+0xac/0xe8) from [<800c2628>] (chrdev_open+0x90/0x174)

[<800c2628>] (chrdev_open+0x90/0x174) from [<800bce2c>] (do_dentry_open.isra.16+0x164/0x258)

[<800bce2c>] (do_dentry_open.isra.16+0x164/0x258) from [<800bcf40>] (finish_open+0x20/0x38)

[<800bcf40>] (finish_open+0x20/0x38) from [<800ca768>] (do_last.isra.54+0x3b8/0xc14)

[<800ca768>] (do_last.isra.54+0x3b8/0xc14) from [<800cb070>] (path_openat.isra.55+0xac/0x470)

[<800cb070>] (path_openat.isra.55+0xac/0x470) from [<800cc03c>] (do_filp_open+0x2c/0x80)

[<800cc03c>] (do_filp_open+0x2c/0x80) from [<800bdeac>] (do_sys_open+0xe8/0x170)

[<800bdeac>] (do_sys_open+0xe8/0x170) from [<8000e080>] (ret_fast_syscall+0x0/0x30)

Code: e2504000 0a000009 e284301c f57ff05f (e1932f9f)

---[ end trace 8434ada4fb39d4e1 ]---

udevd[120]: 'v4l_id /dev/video1' [444] terminated by signal 11 (Segmentation fault)

0 Kudos
3 Replies

1,043 Views
parveenkumaryad
Contributor III

Hi Weidong Sun,

Sorry for late reply.

I was able to write the register setting for auto focus but still i am not able to enable the continuous auto-focus.

i am now able to change the focus o near and far by making some ioctl.

0 Kudos

688 Views
Jerin
Contributor I

Hi,

 

How did you resolve this issue "2- While playing live video over LCD or HDMI using Gstreamer commands I am having some green patches at the corners of the screen and the video is also not of good quality as expected by ov5645 sensor." ?

0 Kudos

1,043 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Parveen,

     OV5645 should be downloaded firmware through I2C interface, in order to confirm I2C communication, you can add code to dump values of some registers, or write a correct value to register , the read it out. Would you like to try ?

Regards,

Weidong

0 Kudos