# eric7.MicroPython.UF2FlashDialog

Module implementing a dialog to flash any UF2 capable device.

### Global Attributes

SupportedUF2Boards

### Classes

UF2FlashDialog | Class implementing a dialog to flash any UF2 capable device.

### Functions

getFoundDevices | Function to get the list of known serial devices supporting UF2.

## UF2FlashDialog

Class implementing a dialog to flash any UF2 capable device.

### Derived from

QDialog, Ui_UF2FlashDialog

### Class Attributes

DeviceTypeRole
DeviceVidPidRole

### Class Methods

None

### Methods

UF2FlashDialog | Constructor
__populate | Private method to (re-)populate the dialog.
__showAllInstructions | Private method to show instructions for resetting devices to bootloader mode.
__showManualInstructions | Private method to show instructions for flashing devices manually.
__showMultipleVolumesInformation | Private method to show information because multiple devices of the same type are ready for flashing.
__showNoVolumeInformation | Private method to show information about the expected boot volume(s).
__showSpecificInstructions | Private method to show instructions for resetting devices to bootloader mode for a list of detected devices.
__showTypedInstructions | Private method to show instructions for resetting devices to bootloader mode for a specific board type.
__updateFlashButton | Private method to update the state of the Flash button and the retest button.
on_bootPicker_textChanged | Private slot handling a change of the boot volume.
on_devicesComboBox_currentIndexChanged | Private slot to handle the selection of a board.
on_firmwarePicker_textChanged | Private slot handling a change of the firmware file.
on_flashButton_clicked | Private slot to flash the selected MicroPython or CircuitPython firmware onto the device.
on_refreshButton_clicked | Private slot to refresh the dialog.
on_searchBootButton_clicked | Private slot to look for all known boot paths and present a list to select from.

### Static Methods

None

#### UF2FlashDialog (Constructor)

UF2FlashDialog(boardType="", parent=None)

Constructor

boardType (str)
  specific board type to show the dialog for
parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### UF2FlashDialog.__populate

__populate()

Private method to (re-)populate the dialog.

#### UF2FlashDialog.__showAllInstructions

__showAllInstructions()

Private method to show instructions for resetting devices to bootloader mode.

#### UF2FlashDialog.__showManualInstructions

__showManualInstructions()

Private method to show instructions for flashing devices manually.

#### UF2FlashDialog.__showMultipleVolumesInformation

__showMultipleVolumesInformation(volumePaths)

Private method to show information because multiple devices of the same type are ready for flashing.

Note: This is a dangerous situation!

volumePaths (list of str)
  list of volume paths

#### UF2FlashDialog.__showNoVolumeInformation

__showNoVolumeInformation(volumes, boardType)

Private method to show information about the expected boot volume(s).

volumes (list of str)
  list of expected volume names
boardType (str)
  type of the board to show instructions for

#### UF2FlashDialog.__showSpecificInstructions

__showSpecificInstructions(devices)

Private method to show instructions for resetting devices to bootloader mode for a list of detected devices.

devices (list of str)
  list of detected devices

#### UF2FlashDialog.__showTypedInstructions

__showTypedInstructions(boardType)

Private method to show instructions for resetting devices to bootloader mode for a specific board type.

boardType (str)
  type of the board to show instructions for

#### UF2FlashDialog.__updateFlashButton

__updateFlashButton()

Private method to update the state of the Flash button and the retest button.

#### UF2FlashDialog.on_bootPicker_textChanged

on_bootPicker_textChanged(text)

Private slot handling a change of the boot volume.

text (str)
  current text of the boot volume edit

#### UF2FlashDialog.on_devicesComboBox_currentIndexChanged

on_devicesComboBox_currentIndexChanged(index)

Private slot to handle the selection of a board.

index (int)
  selected index

#### UF2FlashDialog.on_firmwarePicker_textChanged

on_firmwarePicker_textChanged(text)

Private slot handling a change of the firmware file.

text (str)
  current text of the firmware edit

#### UF2FlashDialog.on_flashButton_clicked

on_flashButton_clicked()

Private slot to flash the selected MicroPython or CircuitPython firmware onto the device.

#### UF2FlashDialog.on_refreshButton_clicked

on_refreshButton_clicked()

Private slot to refresh the dialog.

#### UF2FlashDialog.on_searchBootButton_clicked

on_searchBootButton_clicked()

Private slot to look for all known boot paths and present a list to select from.

Up

## getFoundDevices

getFoundDevices(boardType="")

Function to get the list of known serial devices supporting UF2.

boardType (str)
  specific board type to search for

Return:
  list of tuples with the board type, the port description, the VID and PID

Return Type:
  list of tuple of (str, str, (int, int))

Up