UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Participant aroytman
Participant
3,083 Views
Registered: ‎12-07-2017

ZCU102 no interrupt from sw19

Jump to solution

Hello,

 

I want to check that gpio interrupt works with a stand alone program created from SDK "hello world" example.

This is a starting point for future work. SDK version is 2017.3, board revision 1.1. It is a new board, I've just unpacked it.

 

I took this example:

https://github.com/Xilinx/embeddedsw/blob/release-2017.3/XilinxProcessorIPLib/drivers/gpiops/examples/xgpiops_intr_example.c

 

The problem is that no interrupt is generated when sw19 button is pressed.

 

This example:

https://github.com/Xilinx/embeddedsw/blob/release-2017.3/XilinxProcessorIPLib/drivers/gpiops/examples/xgpiops_polled_example.c

 

works OK. The led blinks and the state of sw19 button is returned correctly.

 

Seems that all initialization is correct, at least I didn't spot any problem.

 

Appreciate any hints/pointers on what to check.

 

Thank you

0 Kudos
1 Solution

Accepted Solutions
Scholar hbucher
Scholar
4,142 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman It might even be possible to run something in the ARM without programming the entire FPGA - I never tried.

However, here is my rule of thumb for FPGAs: do not thread outside the paved road. It is a rocky place.

Get Vivado, build the minimum project as in the video, set SW6 to JTAG (all up/ON), power board, program the FPGA, launch SDK, run application.

Even because sometimes the debugger/application gets stuck and you need to redo the entire process again.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
27 Replies
Scholar hbucher
Scholar
3,063 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman In all likelyhood you don't have the interrupt signal properly connected. Can you share a screenshot of your design?

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
3,020 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

@hbucher

Thank you very much for looking into this.

I use an eval. board. I only have the SDK, no Vivado, so not sure where to find the design.

 

Also, digging further, seems that the example makes some assumption that bank0_ctrlx

registers are already properly initialized (x is 0,1,3,4,5 or 6).

 

I am new to Xilinx. So, would appreciate guidance whether this could be the problem and what are the correct values to program

go get pin 22 function as interrupt. Manual says:

 

GPIO (MIO 22-23)
                PS-side pushbutton SW19 is connected to MIO22 (pin U1.AD20). PS-side LED DS50, placed
                next to the pushbutton, is connected to MIO23 (pin U1.AD19).

 

Apparently, no PL logic is needed for this to work, it should work on the eval. board.

 

Thank you very much

0 Kudos
Scholar hbucher
Scholar
3,007 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman You have to have a design, even if it only contains the ZYNQ. You can't work with the SDK alone.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,979 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

Seems that it comes from SDK installation. Probably from this directory:

<install dir>\SDK\2017.3\data\embeddedsw\lib\hwplatform_templates\ZCU102_hw_platform.

 

Attached is the platform (sub project?) that is created during creation of the example "hello world" application.

It has the system.hdf file. Hope this is what you referred to.

 

Thank you

0 Kudos
Scholar hbucher
Scholar
2,960 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Well without a design I cannot really help you much as I don't know what is connected to what.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,959 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

Seems that I am missing what you actually are asking for. Sorry, this is my misunderstanding. Probably because I am new to this.

How would the file be named? What extension? I am willing to provide information, just need to understand what is needed.

 

I can upload the schematics, if this is what you refer to. This is the eval. board.

The schematics show that sw19 push-button is connected to MIO22. So, this is bank 0, pin 22.

 

The code configures this pin as GPIO and sets direction as input.

Then, it sets-up interrupt 48, which is the GPIO IRQ and adds a handler for it.

The interrupt is set to trigger on falling edge.

 

All this uses PS side only, no PL.

 

Thank you

0 Kudos
Scholar hbucher
Scholar
2,951 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Did you program the FPGA before launching SDK? 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,947 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

No, I do not.

0 Kudos
Scholar hbucher
Scholar
2,929 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman  You really need to pick up on a learning path here or you will not get anywhere.

I just made a video with a minimal project for the ZCU102

http://www.vitorian.com/x1/archives/599

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,462 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

@hbucher

Yes, I am at the beginning and am grateful for your time being spent on this.

 

I hope that I now understand your request for design.

As I see it now, several system.hdf files come with SDK. This allows, at the minimum, to run the examples w/o having Vivado installed. These can be found in <install dir>\SDK\2017.3\data\embeddedsw\lib\hwplatform_templates and, for the hw at hand, in ZCU102_hw_platform sub-directory.

 

The example code did not work on my board out-of-the-box. So, after some modifications (set interrupt to be level and active high) I can see now that when I push the sw19 button gpio has interrupt pending, however, somehow, gic cannot not sense it.

 

According to manual, gpio should trigger interrupt 48 at gic, but this does not happen.

I went through gic registers, but did not find an explanation for what happens.

No IRQ/exception/interrupt handler is invoked. I put breakpoints on all of them and added counters to count invocations.

 

Would appreciate any thoughts/advice/pointers.

 

Thank you

0 Kudos
Participant aroytman
Participant
2,446 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

@hbucher

Forgot to mention that system.hdf file is in the .zip file that I've uploaded.

0 Kudos
Scholar hbucher
Scholar
2,442 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Sorry, I really do not have enough information to help you.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,442 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

Thank you very much for trying. I appreciate this.

0 Kudos
Scholar hbucher
Scholar
2,430 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman  I see these files now. I never used them. I could not find any project files related to those though. 

Perhaps you could place another question in the forum to find out how these are built? 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,427 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

OK, I understand.

 

If you will create an application project in SDK (not in Vivado) based on an example that comes with SDK, say,

"hello world", you will get tree parts. One is the "hello world" project, other the "hello world"_bsp and third one

is ZCU102_hw_platform (named after the BSP you choose during project creation).

 

This way you can run some example code provided with SDK while connected via JTAG.

So, to develop software you only need to get some files that HW eng. produces in Vivado w/o another copy of it.

 

Thanks again for you help.

0 Kudos
Scholar hbucher
Scholar
2,413 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Oh you are using GPIO on the PS side!

I was able to run the example (code from your link) with the design created in the video (https://www.youtube.com/watch?v=ZBzcAi7U8WQ).

Mind you, SW19 is the push button by the PCI-express connector!

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
gpiops.png
0 Kudos
Participant aroytman
Participant
2,396 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

Thank you very much for the effort.

 

Yes, this is the button I use. I think that what I am doing is the same as on your video, except the Vivado part.

There could be some difference in board revisions. I have v1.1. If my understanding is correct, not PL logic needs to be used

in this case.

 

Also, I do not see the registers of bank0_ctrlx being initialized. Not sure I put correct values there.

I started to manipulate these registers only after seeing that the code does not work.

Seems that in other zinq SoCs the bits in bank0_ctrlx were in mio_pin_xx registers.

 

Thank you

0 Kudos
Participant aroytman
Participant
2,396 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution
Could you please upload here your project for me to compare with what I have?

Thank you so much
0 Kudos
Scholar hbucher
Scholar
2,389 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Sure. The project TCL is below.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,467 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

Thank you for the script.

 

However, I was referring to your project from the SDK. Since I do not have Vivado, I cannot use this script to reproduce your project.

If I understand the flow, SDK imports some data from Vivado to create its own project. I do not see how can I achieve this w/o installing Vivado.

 

Would it be possible to upload here the SDK projects (I see that it creates 3 directories used for the example. First is the example code, second is some support code, named after the first with "_bsp" added and third is for specific hw platform, where psu_* and

system.hdf files are put). SDK does not generate a .bit file to load. I understand that it is not needed in this case since no PL is used.

 

Thank you

0 Kudos
Scholar hbucher
Scholar
2,464 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman That is false. You need to program the FPGA prior to run with a bit file, even if you don't have any components attached. 

Very likely what is happening to you is that the card is loading whatever image is in the SD card or QSPI. 

As per the project, I just created the "Hello world" for the A53 and replaced the contents of main.c with the file you provided.

 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,462 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution
Thank you for this input. Seems that I've missed that part.
Going back to manuals...
0 Kudos
Scholar hbucher
Scholar
2,456 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman If you just want to run software on the PS, just buy a Raspberry Pi 3. It has one ARM A53 inside.

It costs $15 compared to the $3000 of the ZCU102.

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos
Participant aroytman
Participant
2,450 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution
This is only the beginning. I want to do some part of a larger project.
There will be more, including PL, when a custom board is ready.
The actual hw is now in development. The eval. board is a starting point.
0 Kudos
Scholar hbucher
Scholar
4,143 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman It might even be possible to run something in the ARM without programming the entire FPGA - I never tried.

However, here is my rule of thumb for FPGAs: do not thread outside the paved road. It is a rocky place.

Get Vivado, build the minimum project as in the video, set SW6 to JTAG (all up/ON), power board, program the FPGA, launch SDK, run application.

Even because sometimes the debugger/application gets stuck and you need to redo the entire process again.

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
Participant aroytman
Participant
2,429 Views
Registered: ‎12-07-2017

Re: ZCU102 no interrupt from sw19

Jump to solution

@hbucher

I thank you very much for helping me with this issue.

I now have it working thanks to your hints.

 

Here is what I did (not sure all of this is needed, but for the record..., in no particular order):

 

1. Set sw6 to boot from jtag - all should be ON. (was booting from SD card with pre-built uboot taken from petalinux)

 

2. Switch to earlier release - 2017.2. It includes the design_1_wrapper.bit file in system.hdf. Version 2017.3 does not have it template ZCU102_hw_platform.

 

3. In "run configuration" make sure you have checked the "Reset entire system", "run psu_init" and "PL Powerup".

 

4. Program the FPGA

 

Now the fun (work?) can continue.

 

Again, thank you very much.

Scholar hbucher
Scholar
2,421 Views
Registered: ‎03-22-2016

Re: ZCU102 no interrupt from sw19

Jump to solution

@aroytman Feel free to mark one of my answers as a solution. 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos