Skip to content

Conversation

@jaguilar
Copy link

Flash the EV3 all in one go rather than sector-by-sector. This appears to resolve issues we had with flashing (some?) EV3s, and mirrors what we do in pybricksdev.

Fixes pybricks/support#2375.

@laurensvalk
Copy link
Member

laurensvalk commented Dec 20, 2025

Fixes pybricks/support#2375.

This looks like a useful change, but it's a fix for a different problem 😄 In pybricks/support#2375 it never gets to flashing. It fails right away on getting the bad response to the get version command.

EDIT: I'll collect some notes in the issue thread instead.

@dlech
Copy link
Member

dlech commented Dec 23, 2025

It seems like this is fixing at least 3 different things. So would be better to split it up into 3 commits.

  1. Fix not adding extra padding for non-existent checksum.
  2. Change to erase all then flash all instead erase/flash one sector at a time.
  3. Verify that the firmware blob size is exactly aligned to sector size.

This fixes an issue where the EV3 firmware had checksums appended to
it that made its size not align to the sector size, causing flashing
to fail.
We don't use this datum for anything, and the rest of the flashing
process apparently proceeds fine even if this fails. This could use
further investigation, though.
Research in pybricks/support#2375 (comment)
and below shows that erasing the firmware and writing it sector by
sector causes hangs during the flashing process. Instead, we should
erase the whole firmware at once, and flash it at once. This
successfully loads new EV3 firmware without hangs.
@jaguilar
Copy link
Author

As requested, broke the change into separate commits.

When we try to upload a firmware with the wrong size, we show this alert now, rather than asserting:

Screenshot 2025-12-24 102622

If the EV3 firmware size is not a multiple of the sector size,
the flashing process will hang. Raise an error if this happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] EV3 firmware installation sends bad status values

3 participants