Pynq 2.5 having issues with GPIO

Having issues using the PS GPIO, it doesn’t appear to be mapping things correctly.

I’m trying to run the PYNQ_workshop examples with the following:

from pynq import GPIO
button0 = GPIO(GPIO.get_gpio_pin(0), ‘in’)
button0.read()

Button 0 does not respond. Later in the example it maps the swicthes using:

button1 = GPIO(GPIO.get_gpio_pin(1), ‘in’)
button2 = GPIO(GPIO.get_gpio_pin(2), ‘in’)
button3 = GPIO(GPIO.get_gpio_pin(3), ‘in’)
switch0 = GPIO(GPIO.get_gpio_pin(4), ‘in’)
switch1 = GPIO(GPIO.get_gpio_pin(5), ‘in’)

These also do now map correctly. It appears it not taking into account of GPIO offsets for the board perhaps?

Any ideas?

Sorry, I noticed a mistake with the constraints used to build the bitstreams. XDC and bitstream shoudl be updated now. If you try download again from the workshop repo it should work.

Cathal

2 Likes

Awesome, thank you Cathal for the quick response and fix. These workshops are really helping to expedite my learning of the PYNQ project. I’ll try them out again and confirm everything is working.

Works like a charm, thank you again.