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

Prevent update from bricking goggle #495

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

pitts-mo
Copy link
Contributor

@pitts-mo pitts-mo commented Mar 7, 2025

This PR changes both the update_goggle.sh and write_flashes.sh scripts to prevent writing a bin into an /dev/mtd8-10 of unexpected size.

Notes:
-prevents soft bricking of goggle VA or RXs
-needs formal testing on fully working goggles (neither of the RX in my goggle are currently mounting to /dev/mtd8/9)
-beeps a quick double chirp on success finding the expected size of each /dev/mtd*
-beeps two long and a chirp on failure to find the expected size /dev/mtd*
-does not automatically recover the google however commented lines in write_flashes can allow for easy recovery of erroneously flashed VA and RX.

To recover a broken VA or RX place these files on SD card to :
HDZGOGGLE_VA.bin # from Recovery if VA is failing (no video on goggle)
HDZGOGGLE_RX.bin # from Recovery if one or more RX are failing (two or four HDZero signal indicators stuck)
develop.sh # copy of write_flashes.sh and uncomment check_mtd_write for HDZGOGGLE_RX/HDZGOGGLE_VA as needed

Other SD card files that may help while trying to recover:
self_test.txt # empty file to dump diagnostic logging into
DONOTREMOVE.txt # empty file -write_flashes will leave .bin files on SD card. However, after goggle display returns remove the HDZGOGGLE_VA.bin file from SD card. When both HDZero RXs have been verified remove the HDZGOGGLE_RX.bin from SD card.

pitts-mo added 3 commits March 6, 2025 19:49
Moved setting of gpio direction out of export condition to clear potentially conflicting prior states.
Moved setting of gpio direction out of export condition to clear potentially conflicting prior states.
@nerdCopter
Copy link
Contributor

attempted to test, but did not get results i expected.
i checkout out PR 495, and merged main into it, compiled, added empty mtd.log to root, flashed, rebooted twice.
no "4 beeps", no data in mtd.log file.
goggles still work.

-fixed the .bin paths
-count 1 VA update before removal of VA.bin
-count 2 RX updates before removal of RX.bin
-Added notes for normal VA / RX mount points
@pitts-mo
Copy link
Contributor Author

Needs testing on working goggle.
-Restored file .bin preservation in write flashes if fails to flash the expected number of devices (1 for VA.bin or 2 RX.bin).
-Cosmetics

@pitts-mo
Copy link
Contributor Author

pitts-mo commented Mar 10, 2025

Sorry @nerdCopter,
These files need to be installed then a new update run.
I have also made some enhancements since your last attempt. Please pull and re-build with the new changes to test. When you update your goggle this time you should hear the beeps from the scripts of the prior build you already installed.
-p

@pitts-mo
Copy link
Contributor Author

To help test:
-update your goggle to a build that includes this PR.

Testing update_goggle.sh:
-from goggle firmware menu update your goggle again (preferably to a build that includes this PR)
-a successful flash should beep quick double chirps when the status bar reaches 5% (RX1) 10% (RX2) and 45% (VA).

Testing write_flashes.sh:
-place VA and RX bin on the root of SD card and boot goggle.
HDZGOGGLE_RX.bin # from Recovery or rename current HDZGOGGLE_RX-xx.bin
HDZGOGGLE_VA.bin # from Recovery or rename current HDZGOGGLE_VA-xxx.bin
-a successful flash should provide three beep instances of quick double chirp followed by a long beep to indicate completion before booting into normal goggle usage.
-after a successful update the RX and/or VA files should be removed from the SD card unless the DONOTREMOVE.txt file is in the root of the SD card.

Error beeps:
If you hear two long beeps followed by a chirp during any of the above tests it means the update failed to find the expected flash size for the current .bin file and aborted writing an update to the associated /dev/mtd* to prevent making things worse.

@nerdCopter
Copy link
Contributor

Flashing PR495 @ 4699dab with main merged in (over cbcace8 with main merged in):

  • started with "beep beep", "beep beep".
  • update seemed slow to start, no progress bar, slightly unnerving.
  • "beep beep" at about 40% then showed GRAY progress bar and continued as normal. (i thought progress bar was supposed to be RED.)
  • normal completion beeps.
  • rebooted, analog tested good.
  • mtd.log empty (zero bytes, does reboot clear it?).

Flashing _VA and _RX bins (from HDZEROGOGGLE_Rev20240816.zip):

  • after about 42 seconds, "beep beep", fan off, fan on, "beep", "beep beep", "beep", fan off, "beeeeep", Menu displayed.
  • analog tested good.
  • _VA and _RX were auto-deleted.
  • mtd.log still empty.

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.

2 participants