2009-07-08 13:38:17 V4L driver for ov9655
andy (UNITED STATES)
Message: 76928
Hi
Am using uClinux distribution 2008R1.5-RC3. I followed the instructions given in the following link:
docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:v4l_blackfin_camera
for enabling the V4L driver for ov9655. Am not using the SRV hardware. I have a custom board and the connections to the ov9655 camera module are same as that of SRV except that am using an external 24MHz oscillator for the camera.
Upon doing modprobe the ov9655 camera was not detected. Hence I put some printks sensor_detect_client and sensor_attach_adapter in blackfin_cam.c. It seems like the function sensor_detect_client never gets called. Here is what I get:
root:/> modprobe i2c-bfin-twi
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller Driver, Version 1.8, regs_base@ffc01400
root:/> modprobe blackfin-cam
Linux video capture interface: v2.00
inside sensor_attach_adapter
OV9655: i2c driver ready
root:/>
If the V4L driver works fine that it should have printed a message saying it has detected client at address:0x60 or something on those lines and created a /dev/video0 file right?
Am not sure what is going wrong here. Why is the function sensor_detect_client never getting called? I dont think that using an external clock could cause problems?
Arvind
QuoteReplyEditDelete
2009-07-08 14:39:15 V4L driver for ov9655
Michael Hennerich (GERMANY)
Message: 76932 For now it's pretty simple -
You sensor doesn't get detected on the I2C bus.
Use u-boot iprobe command to see what IDs are present on the I2C bus.
-Michael
QuoteReplyEditDelete
2009-07-08 18:35:27 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76935
Ok after meddling around for some more time, i realized that i had freakin connected the wrong lines. Anyways that has been corrected now.
When I do an iprobe, it just return without giving any valid address as shown below.
bfin> iprobe
Valid chip addresses:
bfin>
But now when I do the modprobes I get the following messages:
root:/> modprobe i2c-bfin-twi
i2c-bfin-twi i2c-bfin-twi.0: Blackfin BF5xx on-chip I2C TWI Contoller Driver, Version 1.8, regs_base@ffc01400
root:/> modprobe blackfin-cam
Linux video capture interface: v2.00
inside sensor_attach_adapter
inside sensor_detect_client
OV9655: detecting client on address 0x60
OV9655: V4L driver Blackfin CMOS Camera now ready
inside sensor_detect_client
OV9655: detecting client on address 0x62
Unable to register Video4Linux driver for Blackfin CMOS Camera
OV9655: init error 0xffffffe9
i2c-adapter i2c-0: Client creation failed at 0x31 (-23)
OV9655: i2c driver ready
root:/>
Why is the init failing? Could it be because of the difference in clocking the module? I thought the 9655 v4l driver would not care about that or am i wrong?
Arvind
QuoteReplyEditDelete
2009-07-08 22:20:47 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76936
Am not understanding why the driver is detecting the device again at 0x62 after detecting at 0x60??
QuoteReplyEditDelete
2009-07-09 14:53:06 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76979
The camera module is still not being detected. I checked the SDA and SCL lines on the scope and whenever I do an iprobe I see the signals on the scope. So the lines are correctly connected. Still the iprobe returns no address. Am unable to find out what the problem could be. Any suggestions??
QuoteReplyEditDelete
2009-07-09 15:27:45 Re: V4L driver for ov9655
Michael Hennerich (GERMANY)
Message: 76980 Do you have Pull Up's on SDA SCL lines?
I don't know the ov9655 - but some sensors feature a standby pin.
Make sure it is not actively asserted.
-Michael
QuoteReplyEditDelete
2009-07-09 16:01:12 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76981
Yes I have pull ups on those lines. And the camera is not on standby. The thing is I use to talk to the camera module from GPIO pins and grab images through the PPI driver. So I know that the camera works and the rest of the connections are fine. I thought I shall use the v4l driver, hence disconnected the GPIO lines and connected the TWI lines.
I also checked the uboot config file and I have the following lines:
#define CONFIG_HARD_I2C 1
#define CFG_I2C_SPEED 50000
#define CFG_I2C_SLAVE 0
Am thinking, I shall try to get some other I2C device like a temperature sensor or something and check if iprobe is able to detect that. Will let you know.
QuoteReplyEditDelete
2009-07-10 00:55:13 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76994
I have another question. The camera module is supposed to be using SCCB protocol right. Now, I know that I2C is not that different from SCCB but still....using I2C should not work with camera sensors right?
Also, going through the v4l driver I see that nowhere do you specify the register settings for the camera? Is it that when you request for a particular format through an IOCTL, the camera automatically adjusts the register settings for a required image format??
QuoteReplyEditDelete
2009-07-10 01:58:50 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 76996
More questions!! Sorry for the trouble and thnx for your patience in advance!
Am using a CM-BF537 module from bluetechnix and a custom interface board to the camera module. I have been using uclinux 2006 distribution until recently. I was talking to the camera using gpio pins pg12 and pg15 using the pflags driver , my own sccb driver and PPI frame capture driver. Everything worked fine. Now on the new uclinux distribution .i.e. 2008R1.5, I thought and still think that I can use the v4l driver. But because of the i2c problems I thought I shall try and see if my old sccb driver worked.
On the 2008 distribution, the gpio drivers have changed. Am using the simple-gpio driver and opening the gpio28 and gpio31 /dev files using the appropriate commands. But am unable to communicate to the camera. The camera module being ov9655 in both the cases.
The hardware and the rest of the code has not changed. Am I opening the wrong gpio pins? Or it has something to do with the difference in gpio drivers pflags and simple-gpio??
I did scope the gpio31 pin which is supposed to be the SIO_C line and I can see the signals. Hence I guess am using the correct gpio files and I am able to do something on the gpio pins!
QuoteReplyEditDelete
2009-07-10 11:12:55 Re: V4L driver for ov9655
Michael Hennerich (GERMANY)
Message: 77041 Andy,
If I remember correctly there have been issues with the SCCB. Please
search our site for SCCB.
Here is one:
blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumB
rowse&forum_id=39&_forum_action=ForumMessageBrowse&thread_id=8387
Martin Strubel:
" It appears to me that the current i2c driver code does not support the
SCCB 'standard', as there are other bit length used (9 bits per command
phase).
Is anyone working on that and willing to put adaptations back into the
uClinux i2c code?
The BF537 obviously supports the SCCB variant, but the code doesn't make
use of the SCCB bit..(yet)."
>Also, going through the v4l driver I see that nowhere do you specify
the register settings for the
>camera? Is it that when you request for a particular format through an
IOCTL, the camera
>automatically adjusts the register settings for a required image
format??
Well - I didn't write this driver. And yes this driver isn't full
implemented.
It is just supposed to work with the power on default.
And if I remember correctly Martin Strubel sent me the ov9655 driver
patch.
I would go to the Surveyor mailing list/forum and ask there.
www.surveyor.com/blackfin/
There might be people having a more feature complete driver or some
workarounds for the SCCB issue.
Best regards,
Michael
QuoteReplyEditDelete
2009-07-10 12:19:27 Re: V4L driver for ov9655
andy (UNITED STATES)
Message: 77047
ok, thanks!