# Downloading the bitstream freezes everything

**URL:** <https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204>\
**Category:** Support\
**Created:** [February 8, 2023, 5:10pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204 "2023-02-08T17:10:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 8, 2023, 5:10pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/1 "2023-02-08T17:10:21Z")

</div>

Hi, for some reason downloading my bitstream on the board freezes it. The SFTP and SSH connection dies as well and I have to manually restart the board and reconnect. I’m running the simple following code.

> from pynq import Bitstream  
> myDesign = Bitstream(path)  
> myDesign.download()

The block design is given below.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/0/09560223f2fe9bf1598c30fc71adc5ae77e8618a.png)

I understand the problem is something from my overlay and not the setup, but any pointers to what may be causing it will be a great help. My board is ZC706 and I’m using Vivado 2018.2.  
Thanks!

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 9, 2023, 6:00am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/2 "2023-02-09T06:00:14Z")

</div>

@aspaul20

What PYNQ image version you are using?

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 9, 2023, 6:30am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/3 "2023-02-09T06:30:38Z")

</div>

I believe it is version 2.4

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 9, 2023, 6:34am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/4 "2023-02-09T06:34:29Z")

</div>

@aspaul20

Could you open the Jupyter notebook terminal and confirm?

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 9, 2023, 8:47am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/5 "2023-02-09T08:47:24Z")

</div>

@briansune I checked, it is version 2.4

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 9, 2023, 9:05am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/6 "2023-02-09T09:05:17Z")

</div>

@aspaul20

Then it is sure you need to alignment both the Vivado and the PYNQ image.  
See the [PYNQ SD Card image — Python productivity for Zynq (Pynq)](https://pynq.readthedocs.io/en/latest/pynq_sd_card.html)  
2018.2 is targeted for PYNQ 2.3.

Double check if this is the reason

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 9, 2023, 10:30am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/7 "2023-02-09T10:30:43Z")

</div>

So I need PYNQ 2.3 for bitstreams generated by Vivado 2018.2, but I have 2.4. Would a bitstream from Vivado 2018.3 work on PYNQ 2.4?

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 9, 2023, 10:44am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/8 "2023-02-09T10:44:08Z")

</div>

@aspaul20

Not only bitstream, you need both hwh and bitstream.  
I forgot the old format of the hwh but you should get the meaning.  
Both files are required in the same folder, while the Vivado alignment is to prevent the PYNQ loading wrong hwh information and casing the freeze of overlay load.

See:  
[https://pynq.readthedocs.io/en/v2.4/pynq\_overlays/loading\_an\_overlay.html](https://pynq.readthedocs.io/en/v2.4/pynq_overlays/loading_an_overlay.html)

- A bitstream to configure the FPGA fabric
- A Vivado design Tcl file to determine the available IP

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 9, 2023, 4:32pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/9 "2023-02-09T16:32:39Z")

</div>

Yes, I understand that both a bitstream and hwh/tcl file is needed. Thank you for the clarification, I will work on fixing the version clash.

---

<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:** [February 9, 2023, 5:45pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/10 "2023-02-09T17:45:55Z")

</div>

If the board hangs when downloading an Overlay it may be down to reconfiguring the board while a PS-PL AXI transaction is in progress. i.e. the transaction never completes.  
Do you think this could be happening in your design? For example, if you have a design that is constantly accessing memory, reconfiguring the PL could happen while an AXI transaction is in progress.  
This could happen with some of the early pynq _base_ designs. We added decoupling logic (e.g. DFX AXI Shutdown Manager) to the PS-PL interfaces on more recent designs to protect against this.

Cathal

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 10, 2023, 6:12am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/11 "2023-02-10T06:12:34Z")

</div>

@cathalmccabe

Cath do you mean old PYNQ will auto insert LEs as decoupling?  
Such decoupling logic will consume how much amount of LEs?  
Or this is a hard decoupling controller between ARM PS and the PL?

---

<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:** [February 10, 2023, 2:03pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/12 "2023-02-10T14:03:45Z")

</div>

No, this logic is not inserted automatically. When creating a PL design you need to add this yourself if required.  
There are different ways to do this. The IP I mentioned above:

> **[DFX AXI Shutdown Manager](https://www.xilinx.com/products/intellectual-property/dfx-axi-shutdown-manager.html#documentation)**
>
> The Dynamic Function eXchange (DFX) AXI Shutdown Manager can be used to make the AXI interfaces between a Reconfigurable Partition and the static logic safe during dynamic reconfiguration.

[https://www.xilinx.com/htmldocs/ip\_docs/pru\_files/dfx-axi-shutdown-manager.html](https://www.xilinx.com/htmldocs/ip_docs/pru_files/dfx-axi-shutdown-manager.html)

Cathal

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 10, 2023, 2:29pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/13 "2023-02-10T14:29:52Z")

</div>

@cathalmccabe In my design, I simply want to send some data from the PS to the PL, and have the PL write the results back after processing. After your comment, I changed some things in my design and started using a DMA for the transfers (design attached). However this bitfile also freezes the board. I don’t have the resources to build the PYNQ 2.3 image for my board so I haven’t tried the other solution yet  
[axis\_design.pdf](https://discuss.pynq.io/uploads/short-url/iYYdlcdrgWpommQX7IOom13TKtL.pdf) (92.2 KB)  
.

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 10, 2023, 6:49pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/14 "2023-02-10T18:49:13Z")

</div>

@cathalmccabe

You had make the topic very confusing.  
@aspaul20 design do consist of partial reconfiguration or not?  
If not, why DFX decoupling would required?  
If DFX do required in old PYNQ revision, no matter how simple it is (i.e. GPIO toggle),  
any guide he can follow to do so?

@aspaul20 can is simplest GPIO control overlay work?  
If this is working add a simple PL AND OR logic on EMIO GPIO to see it is working.  
If they above do show no issue, this can simply remove all confusions.

Do try and should takes minimum of effort to debug and break through such situation.

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [February 13, 2023, 10:52am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/15 "2023-02-13T10:52:08Z")

</div>

@briansune I made the following simple design for a gain block and tried running its bitstream. It also resulted in the system freezing.

Source:

> #include “core.h”
> 
> void doGain(hls::stream &inStream, hls::stream &outStream, int gain){
> 
> #pragma HLS INTERFACE axis port=outStream  
> #pragma HLS INTERFACE axis port=inStream  
> #pragma HLS INTERFACE s\_axilite port=gain bundle=CTRL\_BUS  
> #pragma HLS INTERFACE s\_axilite port=return bundle=CTRL\_BUS
> 
> for(int idx=0; idx\<(5); idx++){  
> #pragma HLS PIPELINE  
> intSdCh valIn = inStream.read();  
> intSdCh valOut;  
> valOut.data = valIn.data\*gain;  
> valOut.keep = valIn.keep;  
> valOut.strb = valIn.strb;  
> valOut.user = valIn.user;  
> valOut.last = valIn.last;  
> valOut.id = valIn.id;  
> valOut.dest = valIn.dest;  
> outStream.write(valOut);  
> }  
> }

Header:

> #include \<hls\_stream.h\>  
> #include \<ap\_axi\_sdata.h\>
> 
> typedef ap\_axis\<32,2,5,6\> intSdCh;
> 
> void doGain(hls::stream &inStream, hls::stream &outStream, int gain);

TB:

> #include “core.h”
> 
> int main(){  
> hls::stream inputStream;  
> hls::stream outputStream;
> 
> for (int idx = 0; idx\<(5); idx++){  
> intSdCh valIn;  
> valIn.data = idx;  
> valIn.keep = 1; valIn.strb=1; valIn.user=1; valIn.id=0; valIn.dest=0;  
> inputStream \<\< valIn;  
> }
> 
> doGain(inputStream, outputStream, 2);
> 
> for(int idxOut = 0; idxOut \< (5) ; idxOut++){
> 
> ```
> intSdCh valOut;
> outputStream.read(valOut);
> printf("Value is %d\n", (int)valOut.data);
> 
> ```
> 
> }  
> return 0;
> 
> }

The block design is attached as well.  
[doGain.pdf](https://discuss.pynq.io/uploads/short-url/sQy9SPjl660lboL6OgUFMPjoTdn.pdf) (89.5 KB)

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [February 13, 2023, 10:55am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/16 "2023-02-13T10:55:40Z")

</div>

@aspaul20

Can you first eliminates the HLS. Could a simplest MIO controllable via PYNQ Jupyter notebook?  
The python code can simplest as toggle.  
Invoke the ZYNQ block and just couples of MIOs.

Enjoy~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [May 6, 2023, 11:32pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/17 "2023-05-06T23:32:36Z")

</div>

@cathalmccabe How can I figure out whether or not an AXI transaction is in progress while the PL is being configured? My design is fairly straightforward, I don’t think this should happen. Also, is the DFX shutdown manager IP usable with older versions, say 2018.3?

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [May 6, 2023, 11:33pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/18 "2023-05-06T23:33:24Z")

</div>

@briansune Yes, I did. A simple design works fine, but nothing else does. Everything else leads to a freeze.

---

<div class="post-metadata">

**Author:** ![briansune](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/briansune/32/3087_2.png) [@briansune](https://discuss.pynq.io/u/briansune)\
**Post date:** [May 7, 2023, 12:44am UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/19 "2023-05-07T00:44:50Z")

</div>

@aspaul20

Post the hwh xsa and bitt here if possible.  
I will highly suspect the device and the board is not aligned.  
Meanwhile If the AXI IP crossed the ARM address heap or stack it will crash very sure.  
Address map table screen capture will debug easily if possible.

ENJOY~

---

<div class="post-metadata">

**Author:** ![aspaul20](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/aspaul20/32/4194_2.png) [@aspaul20](https://discuss.pynq.io/u/aspaul20)\
**Post date:** [May 7, 2023, 12:17pm UTC](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204/20 "2023-05-07T12:17:54Z")

</div>

@briansune Please find the bit, hwh, and hdf file attached [here](https://drive.google.com/drive/folders/14GVnfGqk-HtACZkBGnS1VzRvGH0QXqMY?usp=share_link).

I could not provide the XSA file for some reason the CPU option is not available in the new BSP project dialog box. Let me know if there is anything else you need. Thank you for the help, I am stuck at a crucial point and your help is appreciated.

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

[Next page](https://discuss.pynq.io/t/downloading-the-bitstream-freezes-everything/5204.md?page=2)
