greatscottgadgets / apollo

microcontroller-based FPGA / JTAG programmer
BSD 3-Clause "New" or "Revised" License
61 stars 29 forks source link

Enhance error message on bitstream mismatch #14

Open NetSpida opened 1 year ago

NetSpida commented 1 year ago

In case of a bitstream for a wrong FPGA I get the error message OSError: Configuration failed: part ID mismatch / (04a00e10) It seems to be generated here

The message could be a little more clear:

I would suggest an error message similar to the following: configuration failed: trying to load a bitstream generated for FPGA Lattice ECP5 LFE5U-12 partid 04a00e10 onto an incompatible FPGA Lattice ECP5 LFE5U-25 partid 0x41111043

martinling commented 1 year ago

To clarify, 04a00e10 is not either of the part IDs - it's a status code returned to the host.

We'll need to rearrange the code a bit to display a better error message, since we don't have the necessary context in _validate_status and we may need to send additional requests to the board.