diff --git a/litex/build/efinix/programmer.py b/litex/build/efinix/programmer.py index 1981b5fa3..10a3eaff4 100644 --- a/litex/build/efinix/programmer.py +++ b/litex/build/efinix/programmer.py @@ -6,6 +6,7 @@ import os import sys +import subprocess from litex.build.generic_programmer import GenericProgrammer @@ -21,7 +22,11 @@ class EfinixProgrammer(GenericProgrammer): def load_bitstream(self, bitstream_file, cable_suffix=""): os.environ['EFXPGM_HOME'] = self.efinity_path + '/pgm' - self.call([self.efinity_path + '/bin/python3', self.efinity_path + - 'pgm/bin/efx_pgm/ftdi_program.py', bitstream_file, - "-m", "jtag" - ]) + if (subprocess.call([self.efinity_path + '/bin/python3', self.efinity_path + + '/pgm/bin/efx_pgm/ftdi_program.py', bitstream_file, + "-m", "jtag"], env=os.environ.copy()) != 0): + msg = f"Error occured during {self.__class__.__name__}'s call, please check:\n" + msg += f"- {self.__class__.__name__} installation.\n" + msg += f"- access permissions.\n" + msg += f"- hardware and cable." + raise OSError(msg)