samna.flasher#

Submodules#

Module content#

class samna.flasher.FileType#

Bases: pybind11_object

Members:

none

fx3Firmware

fpgaFirmware

property name#
samna.flasher.erase_board_info(arg0: samna.flasher.DeviceInfo) None#

Erase the board info on a specific board (Fx3 firmware version >= 0.9.11).

Parameters:

devInfo (flasher.DeviceInfo) – The device info of a board.

samna.flasher.erase_fpga_from_flash(arg0: samna.flasher.DeviceInfo) None#

Erases FPGA firmware from the given device.

Parameters:

devInfo (flasher.DeviceInfo) – The device info.

samna.flasher.get_board_serial_num(arg0: samna.flasher.DeviceInfo) str#

Get the serial number of the board.

Returns:

A string represents the serial number of the board.

samna.flasher.get_empty_devices() List[samna.flasher.DeviceInfo]#

Get all empty devices currently connected to the machine.

Returns:

A list of (flasher.DeviceInfo).

samna.flasher.get_programmable_devices() List[samna.flasher.DeviceInfo]#

Read all programmable devices.

Returns:

A list of (flasher.DeviceInfo).

samna.flasher.make_board_empty(dev_info: samna.flasher.DeviceInfo, auto_yes: bool = False) None#

Erase all firmware from the device and make it empty, after called, the product id of this device will change to 0x00F3 after unpluging and plug in.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info object got by samna.flasher.get_programmable_devices.

  • autoYes (bool) – If true, no confirmation. Or it will ask your confirmation to overwrite the on board firmware. Default false.

samna.flasher.print_debug_log(arg0: samna.flasher.DeviceInfo) None#

Erases FPGA firmware from the given device.

Parameters:

devInfo (flasher.DeviceInfo) – The device info.

samna.flasher.print_firmware_from_device(arg0: samna.flasher.DeviceInfo) None#

Prints the firmware info from the given device.

Parameters:

devInfo (flasher.DeviceInfo) – The device info.

samna.flasher.print_firmware_header_from_file(file_name: str, type: samna.flasher.FileType = <FileType.none: 0>) None#

Prints the firmware header from the given file.

Parameters:
  • fileName (str) – The path to the firmware file.

  • type (flasher.FileType) – The file type.

samna.flasher.print_firmware_info_from_device(arg0: samna.flasher.DeviceInfo) None#

Prints the firmware info from the given device.

Parameters:

devInfo (flasher.DeviceInfo) – The device info.

samna.flasher.program_empty_fx3_ram(dev_info: samna.flasher.DeviceInfo, file_name: str, auto_yes: bool = False) None#

Program empty FX3 RAM.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info object got by samna.flasher.get_programmable_devices.

  • fileName (str) – The path to the firmware file.

  • autoYes (bool) – If true, no confirmation. Or it will ask your confirmation to overwrite the on board firmware. Default false.

samna.flasher.program_fpga_flash(dev_info: samna.flasher.DeviceInfo, file_name: str, auto_yes: bool = False) None#

Flash the FPGA firmware to flash then boot it from the flash.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info object got by samna.flasher.get_programmable_devices.

  • fileName (str) – The path to the firmware file.

  • autoYes (bool) – If true, no confirmation. Or it will ask your confirmation to overwrite the on board firmware. Default false.

samna.flasher.program_fpga_from_pc(arg0: samna.flasher.DeviceInfo, arg1: str) None#

Program the FPGA RAM directly.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info object got by samna.flasher.get_programmable_devices.

  • fileName (str) – The path to the firmware file.

samna.flasher.program_fx3_flash(dev_info: samna.flasher.DeviceInfo, file_name: str, auto_yes: bool = False) None#

Program FX3 flash.

After flash, the firmware will take effect after unplug and plug in or press the reset button.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info object got by samna.flasher.get_programmable_devices.

  • fileName (str) – The path to the firmware file.

  • autoYes (bool) – If true, no confirmation. Or it will ask your confirmation to overwrite the on board firmware. Default false.

samna.flasher.read_board_info(arg0: samna.flasher.DeviceInfo) samna.fxtree.BoardInfo | None#

Read info about a specific board (Fx3 firmware version >= 0.9.11).

Parameters:

devInfo (flasher.DeviceInfo) – The device info of a board.

Returns:

An instance of fxtree::BoardInfo or None if failed to read.

samna.flasher.read_daughter_board_info(arg0: samna.flasher.DeviceInfo, arg1: int) samna.fxtree.DaughterBoardInfo | None#

Read info about a specific daughter board on a mother board (Fx3 firmware version >= 0.8.3). The daughter board info is used to specifiy daughter board type.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info of a mother board.

  • id (int) – The daughter board index on mother board.

Returns:

An instance of fxtree::DaughterBoardInfo or None if failed to read.

samna.flasher.remove_firmware_header(arg0: str, arg1: str) None#

Removes the firmware header from the given file.

Parameters:
  • fileName (str) – The path to the firmware file.

  • destFileName (str) – The destination file name, if it is empty, the original file will be overwritten.

samna.flasher.request_gpif(dev_info: samna.flasher.DeviceInfo, stop_gpif: bool) None#

Erases FPGA firmware from the given device.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info.

  • stopGpif (bool) – If true.

samna.flasher.write_board_info(arg0: samna.flasher.DeviceInfo, arg1: samna.fxtree.BoardInfo) None#

Write board info to a specific board or mother board (Fx3 firmware version >= 0.9.11).

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info of a board.

  • boardInfo (fxtree::BoardInfo) – The board info to be written to the board.

samna.flasher.write_daughter_board_info(arg0: samna.flasher.DeviceInfo, arg1: samna.fxtree.DaughterBoardInfo) None#

Write daughter board info to a specific daughter board on a mother board (Fx3 firmware version >= 0.8.3). The daughter board info is used to specifiy daughter board type.

Parameters:
  • devInfo (flasher.DeviceInfo) – The device info of a mother board.

  • daughterBoardInfo (fxtree::DaughterBoardInfo) – The target daughter board info to be written. The board_index in the info should be assigned to the target daughter board index before calling.

samna.flasher.write_firmware_header(arg0: str, arg1: samna.flasher.FileType, arg2: int, arg3: int, arg4: List[int[3]], arg5: str) None#

Writes the firmware header to the given file. If no header in file, add a header. If a header exists, overwrite the old header with new header.

Parameters:
  • fileName (str) – Original firmware path.

  • type (flasher.FileType) – The file type.

  • productId (int) – The product ID. You can look up by lsusb command. e.g. 0x5bc2

  • configurationId (int) – Configuration id corresponding to the device. Please look up configuration id.

  • version (list(int)) – An integer array of a fixed length of 3, e.g. [3,6,9].

  • destFileName (str) – The destination file name, if it is empty, the original file will be overwritten.