Repository navigation
Fix TX v7 to v8 config upgrades / double reboot on reboot - #3396
Merged
Merged
Conversation
pkendall64
approved these changes
Nov 13, 2025
pkendall64
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Not seen any issues whilst updating.
mha1
approved these changes
Nov 15, 2025
mha1
left a comment
Contributor
There was a problem hiding this comment.
Updating a 3.x.x-maintenance module to V4 went smoothly. All settings transferred ok. No double boot flashing via WiFi.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates the TX config's 3.x.x (config v7) to 4.0 (config v8) to work properly and not jumble the model settings on every reboot. Also fix double reboots from occurring on the TX when restarted via
ESP.restart()Config upgrade
When updating from 3.x to 4.0, most model config settings (tlm ratio, switch mode, power, etc) would be jumbled up. This would keep happening across every module restart until a value was changed via the lua, which would lock in all the model settings at whatever they were at that time. All 64 models were jumbled repeatedly so this would be a nightmare for the users to discover. Even flashing back to 3.x the config wasn't reset, now reinterpreting v8's config values as being proper v7. Steps to reproduce:
This was due to the version number in the config not being committed as there was no "modified" flag in the config for updating all the models. To fix this I've added a
EVENT_CONFIG_VERSION_CHANGEDthat will be set.Double Reboot
I've noticed over the last few months that when doing a wifi update, the module will reboot, run for about half a second, then reboot again. I thought this was some sort of desired behavior but was quite surprised last night when PK didn't know this was happening.
The real issue here was that the reboot was happening right in the middle of the config update procedure, leaving some models updated but not getting to the point where the version was saved. It is interesting to note that
nvs_set_u32()does make changes despite not callingnvs_commit(). It is possible that due to the software reset, the actual NVS RAM cache still exists, allowing double changes to take place.The issue here was the device manager starting all core 0 tasks while setup() was still taking place, which caused the RGBLED device to skip the startup rainbow (it doesn't do this on SW reset boot), which needed to know the current
ExpressLRS_currAirRate_Modparamsto display the right color. This was still nullptr so the core would panic, reboot with PANIC reset boot, causing the rainbow to avoid the issue on the second boot. Wow, right?Core 0 devices were running due to a
EVENT_MODEL_SELECTEDimproperly unblocking the interlocking multicore devices startup procedure. I've changed the event handler to only unblock core 0 if startup has completed, as well as better documenting the startup procedure.ESP-based TX config upgrades
ESP-based TXes (generally only RX-as-TX) have broken config updates. I've updated the v7 to v8 to be correct now, and the v6 to v7 to be better, but going from anything other than v7 to v8 (e.g. v5 to v8) will result in improper defaults for new fields. The issue being the earlier upgrades do not know what defaults to use for their older config structures for these new fields. Someone could edit their update procedures to fill in the proper defaults for each stage but I don't want to do it as I'm very tired.