Help with decompresion of FPGA bitstream

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
goran.mahovlic
Posts: 1
Joined: Sun Nov 10, 2019 8:46 pm

Help with decompresion of FPGA bitstream

Post by goran.mahovlic » Sun Nov 10, 2019 8:55 pm

Hi to all,

we have FPGA board that have ESP32 on the board.
https://radiona.org/ulx3s/

EMARD - author of the board just used micropython for bitstream loading to FPGA and it is working great!
Next thing we would need is to decompress gzip or zip or anything that we can pack on linux machine
https://github.com/emard/esp32ecp5
I did try to use uzlib but did not get thing running.
Maybe someone here have some clues?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Help with decompresion of FPGA bitstream

Post by dhylands » Sun Nov 10, 2019 10:24 pm

uzlib only deals with compressing/uncompressing the data portion of a file contained within a zipfile. It doesn't know how to actually parse a zip file.

I wrote some C code to add a uzipfile module as part of a larger commit which never got merged. You can see the code here:
https://github.com/dhylands/micropython ... f256f83f8d

You'll probably need to expand the uzipfile.c as github considers it to be a "large diff".

Parsing the zipfile file format is fairly straight forward, and you should be able to do it in Python using struct.

Post Reply