cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jpbb
Participant
Participant
816 Views
Registered: ‎03-26-2018

how to test generated module generated in petalinux 2017.4?

Hi,

I am newbie and working on a zcu102 with Petalinux 2017.4.  My test project is rather simple. I connected to ZyqMP an Axi-gpio (dual connected to the 8 leds and 5 push buttons). I also  activated the interrupt which is directly connected to the ZynqMP.(see attachment)


  gpio@a0000000 {
   #gpio-cells = <0x2>;
   #interrupt-cells = <0x2>;
   compatible = "xlnx,xps-gpio-1.00.a";
   gpio-controller;
   interrupt-controller;
   interrupt-parent = <0x4>;
   interrupts = <0x0 0x59 0x4>;
   reg = <0x0 0xa0000000 0x0 0x1000>;
   xlnx,all-inputs = <0x0>;
   xlnx,all-inputs-2 = <0x1>;
   xlnx,all-outputs = <0x1>;
   xlnx,all-outputs-2 = <0x0>;
   xlnx,dout-default = <0x55>;
   xlnx,dout-default-2 = <0x0>;
   xlnx,gpio-width = <0x8>;
   xlnx,gpio2-width = <0x5>;
   xlnx,interrupt-present = <0x1>;
   xlnx,is-dual = <0x1>;
   xlnx,tri-default = <0xffffffff>;
   xlnx,tri-default-2 = <0xffffffff>;
  };

 

I generated a custom module called fpga.ko (according to ug1144.pdf). I replaced the "compatible" name found in the driver with the name  found in in plnx_aarch64-system.dts (See above")

 

My question is simple:

- When I run " insmod  /lib......./extra/fpga.ko" i cannot see that the probe function is called (only init).Is it normal?

Should i run something else?

 

 

Any help will be welcome

 

best regards.

JP

 

 

 

 

 

 

 

Screenshot from 2018-03-26 17-12-06.png
0 Kudos
3 Replies
sandeepg
Moderator
Moderator
784 Views
Registered: ‎04-24-2017

Hi @jpbb,

 

To test AXI GPIO refer the wiki page http://www.wiki.xilinx.com/AXI%20GPIO

 

You no need to create a module you can use sysfs entries to test the drivers.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
jpbb
Participant
Participant
742 Views
Registered: ‎03-26-2018

Hi Sandeepg,

The problem is actually not from the gpio block. I tested it and I can see that it generates the(level) interrupt as expected. My problem is now that I try to use a dedicated module called "fpga". In the device tree I specified "compatible" as my driver name. I also built a generic module with petalinux-build and connected with the name specified in the device tree. when "insmod"ing my module, I can see that an interrupt is allocated (irq=53) . But I cannot catch any interrupt. THe number of detected interrupt does not change. (I run "cat /proc/interrupts" )

 

I have a feeling that the same problem is described in:

https://forums.xilinx.com/t5/Embedded-Linux/Custom-IP-driver-interrupt/td-p/749942

 

I will be very happy if uyou could solve this problem.

//jp

0 Kudos
jpbb
Participant
Participant
740 Views
Registered: ‎03-26-2018

1.pngThe original design has been modified . it looks like that now. I verified that I can either generate interrupt from the GPIO or the interrupt controller (axi_intc).

 

1.png

1.png
0 Kudos