# Can't load bitstream: 'NoneType' object has no attribute 'get'

**URL:** <https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491>\
**Category:** Support\
**Created:** [March 30, 2021, 11:27am UTC](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491 "2021-03-30T11:27:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksstms](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/ksstms/32/443_2.png) [@ksstms](https://discuss.pynq.io/u/ksstms)\
**Post date:** [March 30, 2021, 11:27am UTC](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491/1 "2021-03-30T11:27:56Z")

</div>

Hi!

I’m having a hard time loading my design in PYNQ. I’m using PYNQ-Z2 with the v2.6 image, and Vivado 2020.1 on Ubuntu 18.04.

This is my block design. It works fine with my baremetal application.  
[bd.pdf](https://discuss.pynq.io/uploads/short-url/a4UGS82jcIBQvrhwgZiBgZgcPF1.pdf) (47.7 KB)

I have copied the BIT file, and the HWH from the hw\_handoff folder. I tried using the TCL from the hw\_handoff folder and from the Export Block Design utility, but both give the same results. (Which one should I use?)

My load code:

```auto
from pynq import Overlay
overlay = Overlay("hw/hdmi.bit")
```

Gives this output:

```auto
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-eec68108e766> in <module>()
      1 from pynq import Overlay
----> 2 overlay = Overlay("hw/hdmi.bit")

/usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __init__ (self, bitfile_name, dtbo, download, ignore_version, device)
    339 self._register_drivers()
    340 
--> 341 self.parser = self.device.get_bitfile_metadata(self.bitfile_name)
    342 
    343 self.ip_dict = self.gpio_dict = self.interrupt_controllers = \

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in get_bitfile_metadata(self, bitfile_name)
    777 hwh_path = get_hwh_name(bitfile_name)
    778 if os.path.exists(hwh_path):
--> 779 return HWH(hwh_path)
    780 else:
    781 raise ValueError("Cannot find HWH file for {}.".format(

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/hwh_parser.py in __init__ (self, hwh_name)
    197 self.match_ports()
    198 self.match_pins()
--> 199 self.add_gpio()
    200 self.init_interrupts()
    201 self.init_mem_dict()

/usr/local/lib/python3.6/dist-packages/pynq/pl_server/hwh_parser.py in add_gpio(self)
    444 self.ps_name, self.family_gpio))
    445 if mod is not None:
--> 446 din = int(mod.find(".//*[@NAME='DIN_FROM']").get('VALUE'))
    447 for p in mod.iter("PORT"):
    448 if p.get('DIR') == 'O':

AttributeError: 'NoneType' object has no attribute 'get'
```

I have also tried to make a basic design like this: [simple\_bd.png](https://discuss.pynq.io/uploads/short-url/8PIzLbhSwFguqSl8LWioYwk7sAg.png)  
This one loads fine, but for some reason I can’t flash the leds using MMIO. The board\_btns\_leds example works though, so the board shouldn’t be faulty.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [March 30, 2021, 12:25pm UTC](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491/2 "2021-03-30T12:25:45Z")

</div>

For the first problem, could you post the HWH?

@rock this seems to be a problem parsing the HWH. Do you know if this is related to the GPIO or maybe the interrupt and can you see anything wrong in the block diagram?

For the second problem (simple\_bd.png), did you check LEDs are connected properly in Vivado?  
Could you post the Python code you are using to change the GPIO?

Cathal

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [March 30, 2021, 1:28pm UTC](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491/3 "2021-03-30T13:28:22Z")

</div>

Hi @ksstms,

For the first problem, it seems that the interrupt is the issue.

PYNQ does not support more that one interrupt connected to IRQ\_F2P, you need to use an AXI Interrupt Controller

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/4/431da05560a2d47d030a7b8e2ceb3dac17849a36.png)

You can concatenate the interrupts to the intr pin in the AXI Interrupt Controller

Mario

---

<div class="post-metadata">

**Author:** ![ksstms](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/ksstms/32/443_2.png) [@ksstms](https://discuss.pynq.io/u/ksstms)\
**Post date:** [March 30, 2021, 2:35pm UTC](https://discuss.pynq.io/t/cant-load-bitstream-nonetype-object-has-no-attribute-get/2491/4 "2021-03-30T14:35:00Z")

</div>

@marioruiz Thank you very much. Now it works.

@cathalmccabe The second problem. Never mind, I checked it with an ILA, and realized that I have messed up the tristate config. 🤦‍♂️

Thanks for the fast replies guys! You are great!
