Dear all,
Due to the upgrade of '*casperfpga*' library from python 2.7 to 3.8, I have
tried to upgrade my software to a newer version. But still got stuck on
problems that I still can't properly install and use it as I have followed
the information on
https://casper-toolflow.readthedocs.io/en/latest/src/How-to-install-casperfpga.html.
I have pulled '*casperfpga*' repository from
https://github.com/casper-astro/casperfpga.git on *py38* branch
During installation, I have found error, "*katcp==0.9.1 required tornado <5
>=4.3*". So, I have re-install it by define "*tornado<5*" in
requirements.txt and do pip install. Later, it shows another error,
"*circus==0.18.0
required tornado>5*", which circus is defined in *setup.py *
Later, when finish the installation procedure, I am able to import '
*casperfpga*' library, connect with my SKARAB hardware port. But I am
unable to upload and program firmware file (.fpg) to hardware with error
occured as UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in
position 33033: invalid start byte as detailed belows
Python 3.8.10 (default, Mar 13 2023, 10:26:41)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.
*In [1]: import casperfpgaIn [2]: fpga =
casperfpga.CasperFpga('192.168.91.121')In [3]: fpga.is_connected()Out[3]:
True*
*In [4]:
fpga.upload_to_ram_and_program('Data_streaming_2ps_40gbe_2022-10-26_2143.fpg')*
2023-05-29 14:26:02.83 ERROR 192.168.91.121 transport_skarab.py:715 -
Failed to program.
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
Cell In[4], line 1
----> 1
fpga.upload_to_ram_and_program('Data_streaming_2ps_40gbe_2022-10-26_2143.fpg')
File
~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/casperfpga.py:348,
in CasperFpga.upload_to_ram_and_program(self, filename, wait_complete,
initialise_objects, **kwargs)
345 else:
346 filename = self.bitstream
--> 348 rv = self.transport.upload_to_ram_and_program(
349 filename=filename, wait_complete=wait_complete, **kwargs)
351 if not wait_complete:
352 return True
File
~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/transport_skarab.py:712,
in SkarabTransport.upload_to_ram_and_program(self, filename, port, timeout,
wait_complete, skip_verification, **kwargs)
709 chunk_size = 1988
711 try:
--> 712 upload_time = self.upload_to_ram(filename, not
skip_verification, chunk_size)
714 except:
715 self.logger.error('Failed to program.')
File
~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/transport_skarab.py:641,
in SkarabTransport.upload_to_ram(self, filename, verify, chunk_size)
638 raise ValueError(errmsg)
639 # else: Continue!
--> 641 upload_time = skfops.upload_to_ram_progska(filename, [self.parent],
chunk_size)
642 self.logger.debug('Uploaded bitstream in %.1f seconds.' %
upload_time)
643 return upload_time
File
~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/skarab_fileops.py:252,
in upload_to_ram_progska(filename, fpga_list, chunk_size)
250 processor = choose_processor(filename)
251 processor = processor(filename, binname)
--> 252 binname = processor.make_bin()[1]
253 fpga_hosts = [fpga.host for fpga in fpga_list]
255 # clear sdram of all fpgas before uploading
File
~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/skarab_fileops.py:75,
in FpgProcessor.make_bin(self)
71 """
72 :return: the name of a produced .bin file
73 """
74 fpg_file = open(self.image_file, 'r')
---> 75 fpg_contents = fpg_file.read()
76 fpg_file.close()
78 # scan for the end of the fpg header
File /usr/lib/python3.8/codecs.py:322, in
BufferedIncrementalDecoder.decode(self, input, final)
319 def decode(self, input, final=False):
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
--> 322 (result, consumed) = self._buffer_decode(data, self.errors,
final)
323 # keep undecoded input until the next call
324 self.buffer = data[consumed:]
*UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position
33033: invalid start byte*
>From my opinion, I think the error might be occurred by the python library
installation, e.g. tornado version conflict with katcp and circus in
different direction. But I have already tried on install "tornado<5" and
"circus==0.16.0" (which the error of tornado version would not shown.) But
still got *'utf-8' codec can't decode byte 0x8b in position 33033: invalid
start byte* error with the casperfpga version shown as "casperfpga-3.4.....
.*dirty*."
As an unexpert, I really don't know what is the root cause for this
problem. So, anyone please do suggest me about it.
Thanks and regards,
June
------------------------------------------------------------------------------------------------------------------------------
National Astronomical Research Institute of Thailand (NARIT)
260, Moo 4, Donkaew, Maerim, Chiang mai, 50180
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CABKTCqET74QWjnNhKMAHMC%2BLq6-h_vgUaisw0i5ngro5Pb%2BzpA%40mail.gmail.com.