WIP: Add OV5647 sensor support #31
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
maxpeterkaya/LicheeRV-Nano-Build!31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "KuRue/KuRue-OV5647"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I tried to test this patch with sensor_test demo. But it return this error:
** I changed config /mnt/data/sensor_cfg.ini to yours and apply another changes from pull request and recompile image.
i also tried with the same result, may be we use wrong connector?
Maybe, I use RPi Zero Camera (blue textolite) with default ribbon. But I don't check pinout of csi port on board and on camera module. But anyway there are some problems with software.
Lane_id: 0, 1, 2, 3, -1is incorrect for new RV boards revision, but even I changed them it doesn't affect. Also, I think it is not good idea to usesystem("devmem <...>")for camera init.The RPI camera ov5647 has pull-down (to GND) resistors R4,R8 on I2C pins.
After removing this resistors my licheerv-nano can recognize this camera, but now I have another problem:
Do you have some progress on this issue?
I also have same issue I dont know how to make it work and anyone find any solution! For this problem
Dear anyone who trying to add OV5647 support.
Explanation: According to schematic, I modified the lane_id to matches actual sensor routes.
You may check for detail: [https://doc.sophgo.com/cvitek-develop-docs/master/docs_latest_release/CV180x_CV181x/en/01.software/MPI/Sensor_Debugging_Guide/build/html/4_Image_Output_Debugging.html#adding-sensor-ini-configuration](CVITEK DEVELOP ADDING SENSOR INI CONFIGURATION)
I don't know why but enable ov5647 sensor in menuconfig not affects the build artifacts. So I do this trick:
Adding following lines at very top of
middleware/v2/sample/common/sample_common_sensor.c:This helps add stSnsOv5647_Obj into sensor.
Then remove pull-down to GND resistor on camera on 2 I2C pin.
Compiles the Image
Connect to board and run following command for enabling I2C:
Run sensor_test for test the sensor.
If not working, run it again and it will magically work or you may use
i2cdetect -y 4to make sure your camera were detected. I'm still diving in kernel and middlewares to see why there's still some potential issue and strangeness on these but at least if you want to bring up your sensor, this may work for you.** Note:
Disclaimer: I'm not an expert and I'm just wandering around. If any information being provided were wrong, please kindly assist me on changing them! ^^
Did you tested output image from
sensor_testtool. Does it save correct raw/yuv frame?From my side, everything seems to work flawlessly
@ret7020 I'm glad to see you ret7020. I'm learning LicheeRV Nano based on your tutorial on Medium. I'm struggling with how to drive the OV5647. I can detect I2C devices now, but I get the error
VI_SDK_IOC_S_CTRL - vi_sdk_get_chn_frame NG, Operation not permittedwhen trying to capture the frame. If you can resolve this issue, I suggest you also post the process on Medium. Thank you very much!Hello @watermeko! Currently I have same problem, i2c works but no frames received from VI. But I use this (https://github.com/scpcom/LicheeSG-Nano-Build) image for tests. I will try to build this sipeed image, but I think there is as problem in driver implementation for ov5647
I only managed to get the OV5647 to power on when attempting to use the provided test programs or ones I wrote myself. The OV5647 module I had didn't work with the lower I2C voltage, and there were no resistors to pull. The IMX335 seems to be a more suitable option with its 1.8V I/O, assuming the driver works. I honestly wonder if anyone has managed to get these things to read an image from a sensor.
EDIT: I also wonder if the pins are correct. The OV5647 camera modules don't require mclk so I wonder if that should be disabled. Reading the schematics mclk=1 would probably be sending that signal to MIPI_RX0_N or MIPI_RX4_P. I'm assuming mclk_en=1 would make it send to MIPI_RX4_P, which is used for data on raspberry pi 22pin style camera modules (including the OV5647). It's quite possible mclk_en=1 sends it to MIPI_RX0_N, which considering the schematic has a bridge from MIPI_RX0_N to CAM_IO1 specifically stated to be the MCLK for the Sipeed GC4653 board which uses mclk=1 and mclk_en=1. Its highly likely!
So try this:
set mclk=1 and mclk_en=0 to (maybe) route mclk to MIPI_RX0_N (which is unused)
Maybe also try setting lane_id= 2, 3, 4, -1, -1, as its possible the first index is the CSI_CLK.
And see if you can read some images. If that doesn't work just try all 4 combinations of mclk and mclk_en (I could be entirely wrong on this)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.