I hope someone can explain what's going wrong.
I started with e-consystems Denebola firmware, which works fine on my PC with their RDK board.
I then copied it to another Eclipse project and removed the linker reference to their RDKOV5640LIB. In its place I added the cy_OV5640.c file that Cypress supplied me (under our NDA with Omnivision). I then copied the camera settings file, yuv422_ov5640.cycx into the project and using the CX3 configuration program generated with CX3 configuration files: cyu3mipicsi.c, cycx3_uvcdsrc.c, cycx3_uvc.h & .c.
When I load the compiled executable into the Denebola board using control center, e-CAM doesn't capture video. Instead its screen is always black and the frame rate is always zero. I monitor the debug (UART) port, and see the sensor initialize correctly, and don't see any errors.
Next, I used my oscilloscope to capture the I2C sequences when the original e-consystems firmware initializes the sensor, and compared those values with those generated by the Cypress source code. There are many differences. I tried modifying the Cypress firmware to supply the values I captured from the e-consystem's code. That didn't work either.
Can you explain what's happening, why what I did isn't a valid solution or give me a place to look for the problem?
Solved! Go to Solution.
I am not sure about the purpose for you to do that.
If you want to get familiar with the SDK, I suggest you do it in this way.
1. Create a new project with the CX3 configuration wizard(instead of using the code from E-con system).
2. Fill up the structures used to configure the sensor.
3. Complie the project and test it. It should work.
I used this approach because it's the only way I seem to be able to create a project that builds. Eclipse is such an awkward development environment to work with!
I gave your approach a try. I opened yuv422_ov5640.cycx with the CX3 configuration editor and created a new project. I didn't make any changes to the camera or MIPI settings because they are already what I need.
I then generated the source files: cycx3_uvc.c/.h, cycx3_uvcdsrc.c, cyfxtx.c and cyu3mipicsi.c but I can't compile the project. I get the message "no rule to make target ov5640_RDK_C.elf" and nothing I've done with the make file has helped. I've tried copying makefile from a working project and changing all references to the project within it to the new project's name, but this hasn't worked either! How to I fix this problem?
Thanks for your help,
I tried a different approach. I copied the cx3 demo project from EZ-USB FX3 SDK\1.3\cx3_examples\cycx3_uvc_ov5640 to a new project directory. I then renamed the project and compiled it. It compiled successfully. When I load it into the e-con systems RDK board (Denebola) it does *NOT* output video to e-cam. Black screen, 0 fps. Frame capture doesn't work either.
Had a little success. Using Eclipse|file|new|other|cx3 configuration project and opening the existing cycx3_yuv422_ov5640 to create a new project, compiling and loading into the Debebola RDK does indeed work with e-cam at all the resolutions.
What does *not* work is replacing the cy_ov5640 library with the like-named source code Cypress sent me. After doing that, all I get a black screens and 0 fps. Interestingly enough, if I then remove the cy_ov5640.c module and replace the library, the project still doesn't work (but does compile without error). I don't know what to make of this.
Yes, we followed your outline. In one case we created a configuration with basic settings, in the other case we copied the cycx file supplied with the cy_ov5640 project. Both showed the same results. In both cases we replaced the code in cyu3imagesensor.c with the source code Cypress supplied us (under NDA) from cy_ov5640.c. Neither approach worked.
The only approach that did work was to import the example project from the install directory (C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\cx3_examples\cycx3_uvc_ov5640) to a project in the workspace then run it. That did produce streaming video and images with e-camView.
Using the working copy of cycx3_uvc_ov5640, I replaced the linker's library reference to cy_ov5640 with the supplied source file of the same name. When this compiled successfully, the resulting code did *not* produce streaming video with e-camView. Interestingly enough, when I removed the supplied source file (cy_ov5640.c) from the project and replaced it with the original library of the same name, the compiled project did *not* produce video with e-camView as one would expect.
I look forward to your reply.
We had some luck this morning. By adding CyU3PMipicsiSetPhyTimeDelay to the 5MP case in the super-speed section of cycx3_uvc.c, we are able to image with both e-camView and VLC player using *either* the supplied cy_ov5640 library, or the like-named Cypress source code.
I have written a simple imaging application using OpenCV to make video time-out measurements in hopes of optimizing the Phy time delay. So far, I have been testing delay values in the 6-16 range and have been getting random time-outs after tens to hundreds of seconds. I am assuming there is some value that produces a video stream that doesn't cause time-outs.
Congratulations to you. As you said you could stream video now with either the source code or the static library.
From my understanding, you have tried to set the parameter of CyU3PMipiCSiSetPhyDealy from 6 to 16 and they all work. Is that right?
In addition, what time-outs are you getting? Does it happen to your host tool? Could you please share the OpenCV codes so that I could help you to check.
Thanks. The Phy delay values I ended up with (after considerable study) are resolution dependent:
5MP 100 (didn't notice much difference for the range 50 to 100)
1080p 50 (didn't really experiment with this or 720p, my initial guess of 50 worked OK)
VGA 5 (50 does not produce streaming video).
The timeouts we're seeing happen with all viewers. I have tried ecamView, VLC and even written my own code using OpenCV, so I've got to believe it is a Cypress firmware or Windows driver issue. I have seen that after a lot of timeouts (perhaps 100s), the video stream will not open until the PC is rebooted. To me this suggests some memory allocation issue.
Any advise on how to configure the sensor to stream RGB format? We are trying to use the OV5647 which can only stream RAW and RGB formats. Any idea how to do this? We spent a lot of yesterday trying to configure the OV5640 to stream either of these formats without any success. We will be writing our own software using OpenCV, so UVC compatibility won't be an issue.
Thanks for your continued help.
Sorry but maybe I could not understand the meaning of "time out". Could you please try with Denbola RDK+ exmaple firmware+OpenCV codes to see if same problem appears? I am not able to reproduce the issue with Denebola board and E-cam viewer.
In general, the Ths-settle values depends on Ths-prepare, Ths-zero and PCLK of CX3 but not resolution. I presume that these three values are different in different resoultion configurations.
By timeout, I mean the video freezes and the e-cam program must be restarted or the resolution must be changed (to a different setting) to get video to resume. This happens on the Denebola RDK using their original code as well as most firmware projects I've created using either the e-consystems original code or the Cypress OV5640 example project. I don't know that my college using the same RDK board has the same issues on his PC. On my computer the e-cam application has another issue: it will not display video on my second monitor. If the main e-cam window overlaps my second monitor or I manually move the window to the second monitor, refreshing stops and the e-cam display remains white. I wrote to e-consystems about this issue -- they didn't seem to care.
In general I have worked out enough of the issues to get my custom board working. We are streaming RAW10 video by fooling the CX3/PC into believing it is YUY2 video. Of course all the standard video display programs (e-camView, VLC, OpenCV, etc.) display the wrong colors, but the image can be reformatted by the display application to display correctly.
I was just testing another CX3+AR0521 board and record a video to show my result here. I run the E-cam viewer to display the video captured by CX3. According to your feedback, I drag the window into external monitor, drag it out of it and then drag it back. Do you see the same phenomenon?
Download from the link below
It was a little hard to tell from the video, but if you see the video window stops updating on the external monitor, then yes, that's what I see. I am working on a desktop with two monitors running from an NVIDIA card. If I draw the e-camView window so it overlaps both monitors, only the primary monitor shows video. Monitor "2" never updates. Of course both monitors work for all other applications I've tried, so this appears to be a bug in e-camView. Also to note that I was having a different issue with e-camView last week, so I went to their site and updated to the very latest 188.8.131.52.
Based on the fact that we face the same problem and other players work well(according to your test), I presume it is a limitition in E-cam viewer. You could report this issue to e-consystem and wait for their reply.