PYNQ: PYTHON PRODUCTIVITY FOR ZYNQ

Error message when tried to use MicroblazeLibrary

Hi, I’m not using pynq for about 2 months, and today when I tried to execute some programs I got the message below.
The overlay is the same as base overlay, the difference is that the SPI is slave.
There is another thing, I have always opened .py files on pynq’s jupyter notebook, today it opens a new empty blank tab (google chrome).

Error message:

RuntimeError                              Traceback (most recent call last)
<ipython-input-1-0ca9f4277a4d> in <module>()
  4 from pynq.lib import MicroblazeLibrary
  5 import time
----> 6 lib = MicroblazeLibrary(base.iop_arduino, ['gpio'])
  7 
  8 pulse_unit = lib.gpio_open(7)

/usr/local/lib/python3.6/dist-packages/pynq/lib/pynqmicroblaze/rpc.py in __init__(self, iop, libraries)
885         source_text = "\n".join(['#include <{}.h>'.format(lib)
886                                  for lib in libraries])
--> 887         super().__init__(iop, source_text)

/usr/local/lib/python3.6/dist-packages/pynq/lib/pynqmicroblaze/rpc.py in __init__(self, iop, program_text)
807                                          visitor.functions.keys())
808         typedef_classes = _create_typedef_classes(visitor.typedefs)
--> 809         self._mb = MicroblazeProgram(iop, main_text)
810         self._rpc_stream = InterruptMBStream(
811             self._mb, read_offset=0xFC00, write_offset=0xF800)

/usr/local/lib/python3.6/dist-packages/pynq/lib/pynqmicroblaze/compile.py in __init__(self, mb_info, program_text, bsp)
150             result = run(args + files + lib_args, stdout=PIPE, stderr=PIPE)
151             if result.returncode:
--> 152                 raise RuntimeError(result.stderr.decode())
153             _ = run(['size', path.join(tempdir, 'a.out')],
154                     stdout=PIPE, stderr=PIPE)

RuntimeError: cc1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Pynq z1 Image v2.4
Boot from SD card, I turned pynq on, pluged the ethernet cable on my pc and tried to execute the program:

from pynq import Overlay
base = Overlay("new_base_2.bit")

from pynq.lib import MicroblazeLibrary
import time
lib = MicroblazeLibrary(base.iop_arduino, ['gpio'])

pulse_unit = lib.gpio_open(7)
lib.gpio_set_direction(pulse_unit,lib.GPIO_OUT)

That is interesting. Especially since, as you mention (if I understood correctly), it seems this issue popped out of nowhere with code that was working previously.

First thing is: would you be willing to try and use the recetly released v2.5 and see if you get the same behavior?
You can grab it here

Also, for .py files, I’d reccommend using jupyter lab instead of notebook.
When you are on jupyter notebook, just change your browser address to
<ip_address>/lab
It should allow you to edit .py files and is by all means a more complete IDE, which I bet is what you are looking for.

Hi,

Thank you for the tip about python’s IDE. About the error that I got it was solved after I rewrite the SD card, I think it was corrupted.

2 Likes