• 0

PCAM 5C WITH ZEDBOARD


Question

Hi.,

Im trying to run the project available in Github for Pcam 5C camera with Zedboard using FMC Adapter.

Upto bit stream is done and exported to SDK Successfully.

After creating Application and adding files it is showing errors.

Kindly help regarding this

Version: Vivado 2018.2.1

Edited by BANDI
Link to post
Share on other sites

Recommended Posts

  • 0

Hello @[email protected],

Please download the release https://github.com/Digilent/ZedBoard-FMC-Pcam-Adapter-DEMO/releases/tag/v2019.1-1

and when you open the project in SDK, right -click on project name -> C/C++ Build Settings then Arm v7 g++ compiler -> Directories and make sure the path is:

"${workspace_loc:/${ProjName}/src}"

image.thumb.png.b8ee148b1cb8b39b9aef02faa62905a8.png

Clean the project ( Project -> Clean)

That should solve the errors regarding include files ( Fatal error: no such file or directory). After that the build should be successful. Run the application and tell us if is working.

Please  post here screen-capture if you encounter other errors.

 

Edited by Ana-Maria Balas
Link to post
Share on other sites
  • 0

Hi @[email protected],

I attached the project for 2018.2 version with errors resolved:Zedboard-FMC-2Pcam.zip

The errors were related to repository sources that weren't added to SDK project. The repo_0 folder inside ZedBoard-FMC-Pcam-Adapter-DEMO.ipdefs contains the driver sources for Digilent custom IPs from the hardware project. 

Please run the application and tell us if it's working properly.

 

 

Link to post
Share on other sites
  • 0

hi

Could any one help me to understand where  I  am going wrong? I cant run simple helloworld / sample code on zedboard. I am using ubuntu 18.04 vivado version 2018.2.

in the sdk, I get message like

xsct% WARNING: [Hsi 61-9] Current Software design may not be compatible with "memory_tests" app. Tool is ignoring the MSS file specified in the app directory
attempting to launch hw_server

****** Xilinx hw_server v2018.2
  **** Build date : Jun 14 2018-20:18:37
    ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

INFO: hw_server application started
INFO: Use Ctrl-C to exit hw_server application

INFO: To connect to this hw_server instance use url: TCP:127.0.0.1:3121

what does this mean? I tried checking the hardware server and it is connected to this IP address but not to the 192.168.1.10.

It is quite frustrating that I am spending allot of time in configuring than creating my ow1929019971_Screenshotfrom2020-08-0419-42-30.thumb.png.e7e7d2add306df1e79d31fe231e6f25e.png310915346_Screenshotfrom2020-08-0419-46-23.thumb.png.c02d6eaa9694860c8b2d816f19ede353.pngn project and I didnt have any such issues when I had windows platform.

I am running out of time for my final project for my degree.

I appreciate the guidance I have got from this forum so far.

thanks

meghana

 

Link to post
Share on other sites
  • 0

So cable drivers must be installed if you can program the FPGA. As to why you cannot run Hello world, check the logs for clues on whether elf download succeeds and could even try debug to see where the processor is stuck at.

SDK terminal show a crash of some sort.

Link to post
Share on other sites
  • 0

Hi

I am using ''PUTTY'' and ''SDK serial Terminal''

settings are Serial line to connect to - /dev/ttyACM0

speed - 115200, data bits - 1, stop bits- 1, Parity and Flow control are none.

this connection works fine, but then I cant really run write_led 0xff  command. It says try ''help''. I have no issues when it comes to windows. the image from SDCARD reads completely.

 

thanks

Edited by [email protected]
Link to post
Share on other sites
  • 0

I must have missed a post, but how did you get from a simple helloworld in bare-metal to booting Linux on the Zedboard?

The crash you sent us in this post is, as far as I can see, a kernel panic from a Linux boot on the Zedboard, write_led 0xff is also a application in Linux developed by Avnet. Are you trying to run helloworld on a target which has Linux on it? Do you want to use the FMC Pcam while running Linux on the Zedboard?

-Ciprian

Link to post
Share on other sites
  • 0

yes, My target is to use FMC with PCAM cameras for image processing application. Initially I started to use windows and made the fmc card work using the sample code.

later when i switched from windows to ubuntu 18.04 LTE. I am trying to run hello world having linux as OS.

I cant really see ''hello world '' on serial terminal.

also I tried checking using putty write_led 0xff, even this doesn't work. I see that SDCARD image is booting till gpios part or before SCSI part... I dont understand what is the main issue for not having a communication with the zedboard.

 

meghana

 

 

Edited by [email protected]
Link to post
Share on other sites
  • 0

There seams to be a misunderstanding either on my part or on yours. To clarify things here is what I understand so far:

You recently switched to Ubuntu 18.04 LTE on the PC (host) and you noticed that the console is  not working, you tried to create a helloworld project in standalone mode (aka bare-metal) for your Zedboard (target) but for some reason its not working. The part which I don't understand  is this image , judging by it the console it's outputting a kernel panic of a Linux boot sequence on the target. This means that you are booting from the SDcard on which you have a embedded Linux setup for the Zedboard. Because you are seeing an output in the terminal it means that the USB-UART is active, which tells me that your UART is working properly (host is set up correctly and the target it sending stuff over the UART). Due to the kernel panic the boot process is interrupted in the kernel space, and is hanging there, before it can hand off the control to the rootfs (user space), this means that you can't run write_led 0xff. write_led, as far as I can tell, is an application which has been packaged in the Zedboard rootfs. If you are booting form the SDcard the JTAG chain will not have limited access to the Zynq, which means you can reprogram the FPGA but I don't think it will allow you to load a new .elf in the processor. Therefore the helloworld will not work properly, thus not sending anything to the UART.

I don't know why you have the kernel panic on the target. But I would like to ask you to use the board in JTAG mode if you are trying to run a bare-metal application on it.

-Ciprian

 

Link to post
Share on other sites
  • 0

Hello

I need help building the device tree for the Pcam 5c camera and FMC with a zedboard. I am trying to create linux application using zedboard with fmc and PCAM 5c

 Do you  have any idea what to do? this is my device tree, could anyone check on this.

Issue: generates the petalinux project successfully but I do have a problem running the boot image and it says kernel panic (attached log files).

Another question : do I need to include the FMC configuration part during the configuration of the kernel?

&mipi_csi2_rx_subsyst_0{
xlnx,vc = <0x4>;
csiss_ports: ports {
#address-cells = <1>;
#size-cells = <0>;
csiss_port0: [email protected] {
reg = <0>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
mipi_csi2_rx_0_to_demosaic_0: endpoint {
remote-endpoint = <&demosaic_0_from_mipi_csi2_rx_0>;
};
};
csiss_port1: [email protected] {
reg = <1>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
csiss_in: endpoint {
data-lanes = <1 2>;
remote-endpoint = <&ov5640_to_mipi_csi2>;
};v
};
};
};
&v_demosaic_0 {
compatible = "xlnx,v-demosaic";
reset-gpios =<&gpio 86 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
[email protected] {
reg = <0>;
xlnx,video-width = <8>;
demosaic_0_from_mipi_csi2_rx_0: endpoint {
remote-endpoint = <&mipi_csi2_rx_0_to_demosaic_0>;
};
};
[email protected] {
reg = <1>;
xlnx,video-width = <8>;
demosaic_0_tov_fb: endpoint {
remote-endpoint = <&vcap_in>;
};
};
};
};

&mipi_csi2_rx_subsyst_1{
xlnx,vc = <0x4>;
csiss_ports: ports {
#address-cells = <1>;
#size-cells = <0>;
csiss_port0: [email protected] {
reg = <0>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
mipi_csi2_rx_1_to_demosaic_1: endpoint {
remote-endpoint = <&demosaic_1_from_mipi_csi2_rx_1>;
};
};
csiss_port1: [email protected] {
reg = <1>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
csiss_in: endpoint {
data-lanes = <1 2>;
remote-endpoint = <&ov5640_to_mipi_csi2>;
};
};
};
};
&v_demosaic_1 {
compatible = "xlnx,v-demosaic";
reset-gpios =<&gpio 86 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
[email protected] {
reg = <0>;
xlnx,video-width = <8>;
demosaic_1_from_mipi_csi2_rx_1: endpoint {
remote-endpoint = <&mipi_csi2_rx_1_to_demosaic_1>;
};
};
[email protected] {
reg = <1>;
xlnx,video-width = <8>;
demosaic_0_to_fb: endpoint {
remote-endpoint = <&vcap_in>;
};
};
};
};

&mipi_csi2_rx_subsyst_2{
xlnx,vc = <0x4>;
csiss_ports: ports {
#address-cells = <1>;
#size-cells = <0>;
csiss_port0: [email protected] {
reg = <0>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
mipi_csi2_rx_2_to_demosaic_2: endpoint {
remote-endpoint = <&demosaic_2_from_mipi_csi2_rx_2>;
};
};
csiss_port1: [email protected] {
reg = <1>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
csiss_in: endpoint {
data-lanes = <1 2>;
remote-endpoint = <&ov5640_to_mipi_csi2>;
};
};
};
};
&v_demosaic_2 {
compatible = "xlnx,v-demosaic";
reset-gpios =<&gpio 86 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
[email protected] {
reg = <0>;
xlnx,video-width = <8>;
demosaic_2_from_mipi_csi2_rx_2: endpoint {
remote-endpoint = <&mipi_csi2_rx_2_to_demosaic_2>;
};
};
[email protected] {
reg = <1>;
xlnx,video-width = <8>;
demosaic_2_to_fb: endpoint {
remote-endpoint = <&vcap_in>;
};
};
};
};

&mipi_csi2_rx_subsyst_3{
xlnx,vc = <0x4>;
csiss_ports: ports {
#address-cells = <1>;
#size-cells = <0>;
csiss_port0: [email protected] {
reg = <0>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
mipi_csi2_rx_3_to_demosaic_3: endpoint {
remote-endpoint = <&demosaic_3_from_mipi_csi2_rx_3>;
};
};
csiss_port1: [email protected] {
reg = <1>;
xlnx,video-format = <0>;
xlnx,video-width = <8>;
csiss_in: endpoint {
data-lanes = <1 2>;
remote-endpoint = <&ov5640_to_mipi_csi2>;
};_
};
};
};
&v_demosaic_3 {
compatible = "xlnx,v-demosaic";
reset-gpios =<&gpio 86 GPIO_ACTIVE_LOW>;
ports {
#address-cells = <1>;
#size-cells = <0>;
[email protected] {
reg = <0>;
xlnx,video-width = <8>;
demosaic_3_from_mipi_csi2_rx_3: endpoint {
remote-endpoint = <&mipi_csi2_rx_3_to_demosaic_3>;
};
};
[email protected] {
reg = <1>;
xlnx,video-width = <8>;
demosaic_0_to_fb: endpoint {
remote-endpoint = <&vcap_in>;
};
};
};
};

 

putty(not bootong).log putty(07012021).log (No FMC)putty.log

Edited by [email protected]
Link to post
Share on other sites
  • 0

 

11 minutes ago, Ionel said:

Hi @[email protected] Does it boot if you comment all pcam related nodes in your device tree?

Hi, It does boot and when I check media-ctl -p or media-ctl -V

it says no such command is found. I have enabled the V4L2, Yavta, media-ctl packages, opencv package in the root file system. I have also enabled the drivers for mipi subsystem , i2c controller and ov5640 in the kernel.

Edited by [email protected]
Link to post
Share on other sites
  • 0
On 1/8/2021 at 11:05 AM, Ionel said:

Hi @[email protected] Does it boot if you comment all pcam related nodes in your device tree?

I am not sure if this is right way of doing, I tried this command and ran the boot image. It works now, but I cant really have image displaying on the screen

petalinux-package --boot --force --fsbl ./images/linux/zynqmp_fsbl.elf --fpga ./images/linux/system.bit --u-boot

Log file

Failed to enumerate /dev/media0 (-2)

 

 

Link to post
Share on other sites
  • 0

Just to sync our understanding.
Please fill in the `???` and if some statement are not true please make sure you clarify that in next post.

1. You have a development machine which has:
a. Arch x86_64 OS: ubuntu 18.04 
b. Vivado version ???, XSDK version ???, petalinux version ???

2. Your target hardware:
a. Is a zedboard rev ???
b. A pcam rev ??? is attached over FMC adapter

3. Your hardware configuration is https://github.com/Digilent/ZedBoard-FMC-Pcam-Adapter-DEMO/releases/tag/v2019.1-1 without any modifications.

4. You have run the bare-metal(standalone/without OS) demo included in above link and is working. This works without linux

5. Your target OS: 
a. Is a petalinux project that you have created using hardware description in https://github.com/Digilent/ZedBoard-FMC-Pcam-Adapter-DEMO/releases/tag/v2019.1-1
b. First build was working
c. First boot from sd card went ok without any issues (no kenel panic).
d. You started extending the linux kernel and the rootfs to include support for pcam and required tools.
e. At this point things started to go wrong.

Link to post
Share on other sites
  • 0
36 minutes ago, Ionel said:

Just to sync our understanding.
Please fill in the `???` and if some statement are not true please make sure you clarify that in next post.

1. You have a development machine which has:
a. Arch x86_64 OS: ubuntu 18.04 
b. Vivado version ???, XSDK version ???, petalinux version ???

2. Your target hardware:
a. Is a zedboard rev ???
b. A pcam rev ??? is attached over FMC adapter

3. Your hardware configuration is https://github.com/Digilent/ZedBoard-FMC-Pcam-Adapter-DEMO/releases/tag/v2019.1-1 without any modifications.

4. You have run the bare-metal(standalone/without OS) demo included in above link and is working. This works without linux

5. Your target OS: 
a. Is a petalinux project that you have created using hardware description in https://github.com/Digilent/ZedBoard-FMC-Pcam-Adapter-DEMO/releases/tag/v2019.1-1
b. First build was working
c. First boot from sd card went ok without any issues (no kenel panic).
d. You started extending the linux kernel and the rootfs to include support for pcam and required tools.
e. At this point things started to go wrong.

1) a - yes

b- v2019.1 -vivado, xsdk, petalinux and also I use SDSOC v2019.1

2) a-  Zedboard rev D

b- FMC rev C, PCAM rev C.0

3) yes, no modifications were made

4) Demo works well, I tried on windows.

5) a- yes, I used from this project

b- yes, with no troubles

c- yes, it was okay

d- I recreated the project

steps were

A)petalinux-create --type project --template zynq --name nlos

B) cd nlos
petalinux-create -t project -s <path to/ avnet-digilent-zedboard-v2019.1-final.bsp>

C) cd avnet-digilent-zedboard-v2019.1-final
petalinux-config --get-hw-description= <path to hdf file>

D)petalinux-config -c kernel
Enable drivers for mipi subsytem ip, i2c controller and ov5640 in the kernel, staging driver for ap accelerator

E)petalinux-config -c rootfs
Enable the V4L2,Yavta,media-ctl, opencv, tcf agent, glibc packages in the root file system.

F) copy the following text to ./project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi:

/{
xlnk {
compatible = "xlnx,xlnk-1.0";
};
};

G) fix a bug in petalinux-2019.1: replace "booti" with "bootm" in /avnet-digilent-zedboard-2019.1/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h

H) petalinux-build

I) petalinux-package --boot --force --fsbl ./images/linux/zynqmp_fsbl.elf --fpga ./images/linux/system.bit --u-boot

step I- after I did this, the kernel panic was solved, but now I cant really display any image/ video ( attached putty log)

My main objective is to have the Pcam working (in Linux), capture images, save them on SD card and apply xf_otsuthreshold function on the images (Also work similiar to zybo PCAM live_IO)

e- yes

 

puttyMO.log

Edited by iyer25
Link to post
Share on other sites
  • 0

5.A. is reduntant since it is ovrewriten by 5.B. command. Also 5.B command is changing the hardware configuration that may not have a support for mipi/pcam
5.C. It is possible that you change the hardware to add support for mipi/pcam It is not clear. Hardware changes here should be reflected by the device tree.(under amba_pl node where all PL nodes are nested. Check pl.dtsi file under components directory to see what was generated by petalinux for your hardware description (.hdf/.xsa).
5.F What is xlnk node used for?
Are you trying to overwrite an existing device tree node?
Why have it as a child to device tree root node?

5.G Are you having problem with image.ub size? If i recall correctly there is a limit to 100Mb. If so make sure you add only what you need to rootfs or use an ext3/4 partition for `/` mount point instead of a ramdisk. You can do this in via `petalinux-config` check user guide for more details on how to do this.


In your device tree excerpt there is no node for pcam i2c here is an example for zybo-z7-20 under &axi_iic_0 node: https://github.com/Digilent/Zybo-Z7-OS/blob/20/Petalinux/next/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

Also the linux kernel used in 2019.1 was patched to fix some ov5640 issues.
Here are the patches you can use:
https://github.com/Digilent/Zybo-Z7-OS/tree/20/Petalinux/next/project-spec/meta-user/recipes-kernel/linux/linux-xlnx

0001-Partially-revert-media-ov5640-Fix-timings-setup-code.patch
0002-media-ov5640-use-old-clock-tree-calculation-methods.patch

As a general rule: Start by having a simple as possible pipeline and add filters at a later stage.You may want to commit(git) when things are working so you can go back. Probably you are already doing this but just as a reminder. Also run `petalinux-config --silent` when you go back to early states/commits this way you avoid wasting time on non issues.

Edited by Ionel
Link to post
Share on other sites
  • 0
1 hour ago, Ionel said:

5.A. is reduntant since it is ovrewriten by 5.B. command. Also 5.B command is changing the hardware configuration that may not have a support for mipi/pcam
5.C. It is possible that you change the hardware to add support for mipi/pcam It is not clear. Hardware changes here should be reflected by the device tree.(under amba_pl node where all PL nodes are nested. Check pl.dtsi file under components directory to see what was generated by petalinux for your hardware description (.hdf/.xsa).
5.F What is xlnk node used for?
Are you trying to overwrite an existing device tree node?
Why have it as a child to device tree root node?

5.G Are you having problem with image.ub size? If i recall correctly there is a limit to 100Mb. If so make sure you add only what you need to rootfs or use an ext3/4 partition for `/` mount point instead of a ramdisk. You can do this in via `petalinux-config` check user guide for more details on how to do this.


In your device tree excerpt there is no node for pcam i2c here is an example for zybo-z7-20 under &axi_iic_0 node: https://github.com/Digilent/Zybo-Z7-OS/blob/20/Petalinux/next/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

Also the linux kernel used in 2019.1 was patched to fix some ov5640 issues.
Here are the patches you can use:
https://github.com/Digilent/Zybo-Z7-OS/tree/20/Petalinux/next/project-spec/meta-user/recipes-kernel/linux/linux-xlnx

0001-Partially-revert-media-ov5640-Fix-timings-setup-code.patch
0002-media-ov5640-use-old-clock-tree-calculation-methods.patch

As a general rule: Start by having a simple as possible pipeline and add filters at a later stage.You may want to commit(git) when things are working so you can go back. Probably you are already doing this but just as a reminder. Also run `petalinux-config --silent` when you go back to early states/commits this way you avoid wasting time on non issues.

Thank you for the detailed explanation

I also tried to ignore 5B, which works well. with 5C drivers are added for the mipi.

I did check pl.dtsi file. I did not understand what all to be included in the device tree. I mentioned in the previous post of mine about what I was including for the four pcam cameras. Do we need to activate FMC driver in the kernel?

Also, could you please tell me how to check gpio pin numbers in my case? I am not sure about this part.

&mipi_csi2_rx_subsystem_0 {

reset-gpios = <&gpio0 57 GPIO_ACTIVE_LOW>;

csiss_ports: ports {

#address-cells = <1>;

#size-cells = <0>;

csiss_port0: [email protected] {

/* Fill cfa-pattern=rggb for raw data types, other fields video-format and video-width user needs to fill */

reg = <0>;

xlnx,cfa-pattern = "rggb";

xlnx,video-format = <12>;

xlnx,video-width = <8>;

csiss_out: endpoint {

remote-endpoint = <&vcap_mipi_in>;

};

};

csiss_port1: [email protected] {

/* Fill cfa-pattern=rggb for raw data types, other fields video-format,video-width user needs to fill */

/* User need to add something like remote-endpoint=<&out> under the node csiss_in:endpoint */

reg = <1>;

xlnx,cfa-pattern = "rggb";

xlnx,video-format = <12>;

xlnx,video-width = <8>;

csiss_in: endpoint {

};

};

};

};

 

Now, I will go through the links you provided me for device tree. get back to you about my understandings on it. Will the device tree holds same for Zedboard and FMC with two/four pcam cameras as zybo.

5F- I will be needing staging driver for the accelerators, which I configure in the kernel(this I saw in petalinux manual for opencv part, which i did use while implementing using offline images stored in SD Card)
5G- currently, I have no problem with the size for image.ub

pl.dtsi

Edited by iyer25
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now