Skip to content

Prevent update from bricking goggle#495

Merged
ligenxxxx merged 7 commits intohd-zero:mainfrom
pitts-mo:main
Apr 17, 2025
Merged

Prevent update from bricking goggle#495
ligenxxxx merged 7 commits intohd-zero:mainfrom
pitts-mo:main

Conversation

@pitts-mo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@nerdCopter
Copy link
Copy Markdown
Contributor

  • Tried to fly analog of 4699dab plus git merge main, but analog had pink-artifacts that were already fixed in main. had to flash main @ 9926265 in order to fly.
  • may need to rebase on main? 🤷‍♂️

@pitts-mo
Copy link
Copy Markdown
Contributor Author

No conflicts require rebase and none of the recent commits appear directly related to analog (PR #493?). Regardless, I have sync/merged recent commits from master my branch.

@nerdCopter
Copy link
Copy Markdown
Contributor

Regardless, I have sync/merged recent commits from master my branch.

same as i did locally. i suppose i will retest when i am able. i may also test a rebase. will not be soon.

@nerdCopter
Copy link
Copy Markdown
Contributor

nerdCopter commented Mar 23, 2025

b924ab6 analog receive flight-tested -- no issues.

edit : 2025-Mar-30: Flew HD , same commit/build -- no issues.

@nerdCopter
Copy link
Copy Markdown
Contributor

as additional test, i put March release's _VA and _RX files onto SD and booted my running b924ab6. same successful beeps as prior testing.

AFAICT, this is ready for merge @pitts-mo , @ligenxxxx

@ligenxxxx ligenxxxx merged commit 3bf6177 into hd-zero:main Apr 17, 2025
1 check passed
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.

3 participants