How to properly set up ov2718 camera module? - Printable Version +- Lindeni Forum (http://forum.lindeni.org) +-- Forum: Lindenis V5 (http://forum.lindeni.org/forumdisplay.php?fid=5) +--- Forum: General Discussion on Lindenis V5 (http://forum.lindeni.org/forumdisplay.php?fid=6) +--- Thread: How to properly set up ov2718 camera module? (/showthread.php?tid=7201) Pages:
1
2
|
How to properly set up ov2718 camera module? - DWD - 10-22-2019 Hey everyone! I tested Lindenis with imx317 module and it works good, but we're currently trying to make it work with "ov2718" and it doesn't work. I compiled ov2718_mipi.c driver, it correctly loads into kernel and even able to read/write to camera's i2c address but when I run 'ldcam -c -d 0 -o out' it freezes with the following dmesg errors: Code: [ 114.995285] [ov2718_mipi]PWR_ON! Here's the [sensor0] section from sys_config.fex file that I corrected to suit my camera: Code: [vind0/sensor0] Can someone help me with getting this camera to work? According to Allwinner V5 manual it is supported. RE: How to properly set up ov2718 camera module? - ssdmt - 10-23-2019 how do you start imx317_mipi ?? my imx317 don't work (both sensors) set up: #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */ and compare dmesg log for imx317 with ov2718 ... logs output in v4l_print_fmtdesc(..) and v4l_print_format(..) functions do you have ov2718 datasheet? compare sensor_win_sizes structure for ov2718 and imx317 driver file .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12 (imx317) vs .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12 (ov2718) !! (SRGGB12 != SBGGR12) also: info->combo_mode = CMB_TERMINAL_RES | CMB_PHYA_OFFSET3 | MIPI_NORMAL_MODE; (ov2718 sens) vs info->combo_mode = CMB_TERMINAL_RES | CMB_PHYA_OFFSET2 | MIPI_NORMAL_MODE; (imx317 sens) RE: How to properly set up ov2718 camera module? - DWD - 10-24-2019 Thanks for response! Yeah, I have ov2718 manual. I don't see errors about pixelformat (MEDIA_BUS_FMT_SBGGR12_1X12) so I guess error is not here? I tried setting "BG12" format in ldcam.c but it doesn't make any difference. Although, what does CMB_PHYA_OFFSET3 mean? Are we sure ov2718 driver sets it correctly? I am currently out of ideas... Seems that something's up in MIPI configuration, because i2c works. If you have any more suggestions, I will gladly try it. (10-23-2019, 08:50 AM)ssdmt Wrote: how do you start imx317_mipi ?? my imx317 don't work (both sensors) Well they work out of the box. Did you try to boot your Lindenis board using the official image: http://wiki.lindeni.org/index.php/Linbian_Setup#Writing_an_image_to_the_SD_card ? After boot, compile ldcam and try to take a photo by running ./ldcam -c -d 0 -o out RE: How to properly set up ov2718 camera module? - ssdmt - 10-24-2019 1) show modules.conf & mpp.conf file from: PROJECT_DIR/out/eagle/lindeni-v5/debian/target/etc/modules-load.d/ 2) show modules.order file and list of the all files in directory: PROJECT_DIR/out/eagle/lindeni-v5/debian/target/lib/modules/4.4.55+/ P.s: "Did you try to boot your Lindenis board using the official image: http://wiki.lindeni.org/index.php/Linbia...he_SD_card ?" I use emmc official image. RE: How to properly set up ov2718 camera module? - itzandroidtab - 10-24-2019 (10-24-2019, 09:25 AM)DWD Wrote: Thanks for response! Maybe you can try sochips image as they are supporting it as well. http://www.sochip.com.cn/v5/index.php?title=Device_support RE: How to properly set up ov2718 camera module? - DWD - 10-25-2019 (10-24-2019, 06:31 PM)ssdmt Wrote: 1) show modules.conf & mpp.conf file from: PROJECT_DIR/out/eagle/lindeni-v5/debian/target/etc/modules-load.d/ modules.conf: Code: # /etc/modules: kernel modules to load at boot time. mpp.conf: Code: videobuf2-dma-contig modules.order: Code: kernel/crypto/echainiv.ko List of all files in kernel directory (ls -R /lib/modules/4.4.55+/): Code: /lib/modules/4.4.55+/: Yesterday, I was reading the source file of ov2718_mipi.c more carefully and noticed that a lot of registers it attempts to write to does not exist in the ov2718 manual! So now I am skeptical about the quality of the driver and maybe register set for 1080p mode is wrong. I will investigate about it more and return if I get any results. P.S. There's a suggestion for you to use Sochip's image - I would advise you against it. The reason is that sochip uses different kind of RAM (if I remember correctly) and therefore different voltage. You may damage your Lindenis if you don't correct the sys_config.fex in Sochip's image first. RE: How to properly set up ov2718 camera module? - ssdmt - 10-25-2019 'I was reading the source file of ov2718_mipi.c more carefully and noticed that a lot of registers it attempts to write to does not exist in the ov2718 manual!" my ov2718 datasheet has version 2.03, july 2001 year ))) 18 year old! and datasheet describe 2720 sensor! not 2718 )) What the pixel rate are you setup? (which registers used for this?) table rate for ov2718 - https://yadi.sk/d/rithIqzt6W_Rqw What the input clock frequency (for ov2718) are you setup in clk-sun8iw12.c file or sys_config.fex? RE: How to properly set up ov2718 camera module? - DWD - 10-28-2019 (10-25-2019, 11:54 AM)ssdmt Wrote: my ov2718 datasheet has version 2.03, july 2001 year ))) 18 year old! and datasheet describe 2720 sensor! not 2718 ))Wait, are you suggesting that driver in Lindenis kernel named ov2718_mipi.c is actually a driver for ov2710 sensor? (10-25-2019, 11:54 AM)ssdmt Wrote: What the pixel rate are you setup? (which registers used for this?) table rate for ov2718First, the table you linked is for ov2720 sensor. About pixel rate and registers, I am currently researching this topic... I honestly thought that driver would work out of the box, because you know, the name "ov2718_mipi" suggests it should work with ov2718 camera I will provide more info on this later. (10-25-2019, 11:54 AM)ssdmt Wrote: What the input clock frequency (for ov2718) are you setup in clk-sun8iw12.c file or sys_config.fex?This is interesting, can you elaborate on it a bit more? Where in fex should I specify the input clock? I found this section: Code: [clock] The improper clock/frequency setup might be the case. Thanks, you gave me some ideas where to look. I'll check ov2718 manual and will be back when I get additional information. RE: How to properly set up ov2718 camera module? - ssdmt - 10-28-2019 there is still a moment: sys_config.fex file contains the following line vind0_clk = 384000000 vind0 - this is the video input module, and in src kernel files we can see following lines: of_property_read_u32(np, "vind0_clk", &core_clk); vind->clk[VIN_TOP_CLK].frequency = core_clk; where VIN_TOP_CLK is the clock of module CSIS module(hardware)! WHY 384MHz ??!! ))) in kernel code, in vin.c file we can see isp_clk = 297MHz .. WHY!!??? (may be it from pll9) 2-nd: we have in imx317_mipi.c file following: pixel clock = 720Mhz! mipi bitrate = 576MHz! why 384MHz, if thepixel clock is 720MHz or the mipi bitrate is 576MHz )))) RE: How to properly set up ov2718 camera module? - ssdmt - 10-30-2019 "Although, what does CMB_PHYA_OFFSET3 mean?" answer: the function sunxi_mipi_subdev_s_stream(..) has the following function calls: Code: mipi->cmb_mode = res->res_combo_mode & 0xf; mipi->pyha_offset it is the CMB_PHYA_OFFSET3 argument! and it is passed to the function combo_rx_init(sd); and then to the func. cmb_rx_phya_offset(mipi->id, mipi->pyha_offset); void cmb_rx_phya_offset(unsigned int sel, unsigned int offset) { vin_reg_clr_set(cmb_rx_base_addr[sel] + CMB_PHYA_CTR_REG_OFF, CMB_PHYA_OFFSET_SEL_MASK, offset << CMB_PHYA_OFFSET_SEL); /*mipi 3, lvds 0*/ } But V5 manual does not contain descriptions of mipi registers ((( may be Lindenis will help us ??? )) |