Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(heater-shaker): updated dfu locking mechanism #11395

Merged
merged 2 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
updated locking
  • Loading branch information
pmoegenburg committed Aug 24, 2022
commit 6663d5655b6376e6cd90b1af9f897c48845d68b2
7 changes: 3 additions & 4 deletions api/src/opentrons/hardware_control/modules/heater_shaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,9 @@ async def close_labware_latch(self) -> None:

async def prep_for_update(self) -> str:
await self._poller.stop_and_wait()
async with update.protect_dfu_transition():
await self._driver.enter_programming_mode()
dfu_info = await update.find_dfu_device(pid=DFU_PID)
return dfu_info
await self._driver.enter_programming_mode()
dfu_info = await update.find_dfu_device(pid=DFU_PID)
return dfu_info


@dataclass
Expand Down
25 changes: 13 additions & 12 deletions api/src/opentrons/hardware_control/modules/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ async def update_firmware(

raises an UpdateError with the reason for the failure.
"""
flash_port_or_dfu_serial = await module.prep_for_update()
kwargs: Dict[str, Any] = {
"stdout": asyncio.subprocess.PIPE,
"stderr": asyncio.subprocess.PIPE,
"loop": loop,
}
successful, res = await module.bootloader()(
flash_port_or_dfu_serial, str(firmware_file), kwargs
)
if not successful:
log.info(f"Bootloader reponse: {res}")
raise UpdateError(res)
async with protect_dfu_transition():
flash_port_or_dfu_serial = await module.prep_for_update()
kwargs: Dict[str, Any] = {
"stdout": asyncio.subprocess.PIPE,
"stderr": asyncio.subprocess.PIPE,
"loop": loop,
}
successful, res = await module.bootloader()(
flash_port_or_dfu_serial, str(firmware_file), kwargs
)
if not successful:
log.info(f"Bootloader reponse: {res}")
raise UpdateError(res)


async def find_bootloader_port() -> str:
Expand Down