FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
cmake \
xz-utils \
bsdmainutils \
python3 \
git
WORKDIR /tmp
RUN git clone --depth 1 https://github.com/zylin/zpugcc.git \
&& tar -xvJf /tmp/zpugcc/releases/20150428/zpu-gcc-g++-multilib-linux64-20150428.tar.xz -C /usr/local \
&& export PATH="/usr/local/zpu-gcc-g++-multilib-linux64-20150428/bin:$PATH" \
&& git clone --depth 1 https://github.com/EttusResearch/uhd.git \
&& cd /tmp/uhd/firmware/usrp3 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make
Note: I am running this on Apple Silicon, but the bug is irrespective of that.
Expected Behavior
the COE file generation to complete properly so my pipeline can pass. The binary file needs to be read and formatted into the COE format.
Actual Behaviour
'utf-8' codec can't decode byte
The file is being read as ascii instead of binary ('rb'), which causes failure due to non-utf-8 characters in binary file
Steps to reproduce the problem
Run the provided docker file above docker build --no-cache --platform=linux/amd64 .
Additional Information
Suggestions for fixes of firmware/usrp3/utils/bin_to_coe.py
specify read binary flags to read the .bin file.
h = binascii.hexlify(open(bin_file, 'rb').read()) + b'0'*7
cast result of len(h)/8 to int (causes range error due to float specified in range)
out.write(',\n'.join([h[i*8:(i+1)*8].decode('ascii') for i in range(int(len(h)/8))]) + ';')
Delete the line for variable d assignment, its not used
Issue Description
When building from source the X300 reference firmware with the ZPU (via zpugcc) the final
make
step runsbin_to_coe.py
While running
make
the python file fails to read the binary file properly since the 'rb' flag isn't specified.Setup Details
Here is a dockerfile to run this test
docker build --no-cache --platform=linux/amd64 .
Expected Behavior
the COE file generation to complete properly so my pipeline can pass. The binary file needs to be read and formatted into the COE format.
Actual Behaviour
'utf-8' codec can't decode byte
The file is being read as ascii instead of binary ('rb'), which causes failure due to non-utf-8 characters in binary fileSteps to reproduce the problem
Run the provided docker file above
docker build --no-cache --platform=linux/amd64 .
Additional Information
Suggestions for fixes of
firmware/usrp3/utils/bin_to_coe.py
len(h)/8
to int (causes range error due to float specified in range)d
assignment, its not usedd = [h[i*8:(i+1)*8] for i in range(len(h)/8)]