• 0

PMODGPIO build on Zybo (2016.4)


I am attempting to build upon the hdmi demo, here is what I want to accomplish:

Take over PMOD_C port as a general purpose digital output (8 pins)

Here is what I have done (aside from debugging for hours)

I dropped down and wired a PmodGPIO_0 block in my design and connected it to PMOD_C (JC), used the auto-connection automation function in Vivado.

The build seems to work just fine, exported hardware, etc as normal.

In SDK I get a drivers/ directory in hw_patform_1 with PmodGPIO_v1_0 and everything looks fine.  

Here are the exact steps I followed from here to where I am now:

copied PmodGPIO.h down to hdmi/src (build project directory)

copied code (functions) from PmodGPIO.c into video_demo.c (build main .c)

copied code (init, main, close) from output_demo.c into appropriate places in video_demo.c

Question 1) The code would not execute, because it appears the XPAR_ for PMODGPIO does not feed correctly into xparameters.h.  Is this normal?  

I tried to workaround by checking system.hdf and found the base address for my PMODGPIO 0x40000000 and hard-coded it.  This would allow the code to compile, but it does not run correctly, it hangs in GPIO_begin on the statement Xil_Out32(InstancePtr->GPIO_addr+4, bitmap);.  This is the first statement where it attempts to write to the mapped memory.

I have a feeling that something with the PmodGPIO IP is not building correctly for me, but I don't know how to correct it.  I have tried several times to clean and rebuild the project, but again I don't know if I am taking the right steps.  

Question 2) Is there some type of 'build' that I need to do in SDK or somewhere else to initialize the IP correctly and be able to write to the PmodGPIO ?


Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You will need to regenerate the BSP for the SDK project. Start by deleting the BSP in you project workspace in SDK. Create a new BSP with the exact same name as the old one through the File -> New menu, targeting your hardware platform. Keeping the old name means that your application project should target the new BSP just how it was previously using the old one. This new BSP should contain the PmodGPIO driver source code in it's libsrc directory, as well as a new version xparameters.h file in it's include directory. Since your application project should now target the new BSP, it will be able to automatically pull in those files when you include them. The XPAR_PMODGPIO_* macros should exist in the new xparameters.h file.



Share this post

Link to post
Share on other sites
  • 0

Awesome, this is what I needed.  SDK seems to have a lot of 'hold your tongue just right...' things.

It's a bit of learning curve and I would not consider myself a novice programmer.

Share this post

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