Jump to content
  • 0

Zybo Custom IP Tutorial didn't work


Wilton

Question

I just completed the Zybo custom IP tutorial and everything appeared to be fine until I ran the application (last step).  It did nothing.  I tried running in debugger and eventually concluded that it was stuck at memory address 0x10, not in the source code.

I previously did the getting started tutorial just fine, so I know the hardware is working and presume I have a basic understanding.  The custom IP tutorial was preparatory to creating some custom IP of my own for a custom board, so I need to understand the process.

My initial guess is that there should have been some initialization function called from main, like there was in the getting started tutorial.  I even tried copying the function call from getting started, but the function didn't exist.  Given how many things happen automatically behind the scenes in Vivado/SDK and my lack of experience with ARM, I don't quite know where to go.  I don't even know if the issue is in Vivado or in SDK.  I could blow the project away and start over.  Maybe I wouldn't make the same mistake a second time.  I don't know.

(I'm an experienced programmer, but new to Vivado and SDK and Arm, and relatively new to gnu).

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Thanks for the quick response.  Unfortunately I'm still not at the end of the tunnel.

I copied the project to my system and tried to open it in SDK.  The only way I know to open SDK is from Vivado.  SDK isn't even on my desktop.

So I had to open it in Vivado, which immediately complained about the xdc file, so I gave it a valid file location on my system.

Then it complained things were out of date, so I had to generate a new bit stream and all that entails.

Then I tried to launch SDK, but it couldn't match up anything, so refused to launch, so I had to remove the sdk directory and export it, which meant rebuilding stuff in the SDK.  The end result was no pulsing LEDs!

I did see some differences that might be worth noting.  Your sdk source file had helloworld.c and platform.c and h and platform_config.h in it that mine did not.  The resulting elf file included them.

I guess my main goal here is to understand the process more.  I didn't end up with the same outcome you did.  I need to know how to open and run your version without changing it, which will probably help me to know how to maintain designs in general.

Link to comment
Share on other sites

Hi Wilton,

Unfortunately, I missed adding the ip_repo. I just downloaded the zipped project moved the unzipped ip_repo folded into the project folder and had no issues with generating bitstream or with SDK. I'm using Vivado 2016.2. I would suggest re-doing the tutorial from scratch to get more familar with the tools and navigation. I usually launch sdk from Vivado to ensure i have the correct hw files. 

cheers,

Jon

ip_repo.zip

Link to comment
Share on other sites

Hi Wilton,

Update, I tried it again and had an issue with path but i hit ok and it still loaded the project in sdk and i had no issues programming the fpga or launch on hardware. If other issues occur I think you might be better off re-doing the tutorial than working on fixing paths for the tools.

 

Jon

Link to comment
Share on other sites

I've made a little progress.  I downloaded the second zip.  I found sdk in the start menu and launched it and opened the project, downloaded the bitstream and ran the code--and it worked as intended.  (other than the fact the when running SDK from the start menu it couldn't figure out how to edit main.c--there's some link to the editor missing).

So I will go back a third time and try to build this more carefully myself.  My guess is that I may not have absorbed enough of the first demo.  The IP demo is rather brief on the generic starting instructions and I may have overlooked something important.

Thanks for the help.  I will post a resolution (or further questions) later.

Link to comment
Share on other sites

OK.  I finally succeeded on my own.  For anyone else who might fall into a trap, my issue was at step 8.2.  It says click next and finish, which is a bit too abbreviated.  I probably missed the part about next (there isn't a picture of the screen after that).  Clicking finish uses the default project (that will be seen if you click next).  In my case it was Hello World.  Exactly why it didn't give me a conflict on a duplicate copy of main() I don't know.  When I built this for the third or fourth time, it did give me a conflict.  As Jon pointed out early in this exchange, you have to select "Empty Application" for a template.  Once I did that I built something that worked as intended.

It is also fairly easy to get the board in an uncontrollable state.  Failure to download the bitstream or downloading an inappropriate project (such as a conglomerate of Hello World and this project.  It can get to the point that the SDK can't communicate with the board.  Fortunately, unplugging the USB (at least if it is USB powered) and plugging it back in rather painlessly puts it back in a known and blank state.  The bitstream has to be downloaded again and then the project can be run.

Jon, thanks for hanging in there with me through this one.  Now I get to try packaging my own IP and seeing if I can put all the pieces together.  I think I have enough information from this tutorial to do so.  The major new step for me at present is interfacing my Verilog to AXI, and I think this has given me what I need.

So this issue is resolved and closed.  I don't know if there is a formal process for that.

Link to comment
Share on other sites

Here's an interesting post-solution addition.  The design is less than compelling as created due to the fact that it increases the PWM linearly whereas the eye observes the LED logarithmically.  I made a small change to the program that causes it to increase exponentially, creating a more visually pleasing effect.  The key is to scale the variable by 256 so integer truncation is not a problem.  Then multiply it each time by 257 and divide by 256.  The step increase is 1 initially, but as the value grows larger, the step grows with it.  The result is that the observer can see the LEDs essentially off and growing dimly, whereas the original appeared to start well up on the brightness curve and grow very slowly at the end.  Here is the modified code:

#include "xparameters.h"
#include "xil_io.h"
//#define MY_PWM XPAR_MY_PWM_CORE_0_S00_AXI_BASEADDR //Because of a bug in Vivado 2015.3 and 2015.4, this value is not correct.
#define MY_PWM 0x43C00000 //This value is found in the Address editor tab in Vivado (next to Diagram tab)
int main(){
    int num=0;
    int i;
    while(1){
        if (num >= 262144) {
         num = 0;
        }
        else if (num == 0) {
            num = 256;
        }
        else {
         num = (num * 257) / 256;
        }
        i = num / 256;
        Xil_Out32(MY_PWM, i);
        Xil_Out32((MY_PWM+4), i);
        Xil_Out32((MY_PWM+8), i);
        Xil_Out32((MY_PWM+12), i);
        for(i=0;i<100000; i++);
    }
}

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...