'Program a chip with the given flash data.'

def programChip(self, flash_data):

    self.cur_ext_addr = (-1)
    self.chip = chipDB.getChipFromDB(self.getSignature())
    if (not self.chip):
        raise IspError((('Chip    with    signature:    ' + str(self.getSignature())) + 'not    found'))
    self.chipErase()
    Logger.log('d', 'Flashing    %i    bytes', len(flash_data))
    self.writeFlash(flash_data)
    Logger.log('d', 'Verifying    %i    bytes', len(flash_data))
    self.verifyFlash(flash_data)
    Logger.log('d', 'Completed')
