Hi all,
We have been working through a persistent OTA flash issue with some Electrons over the past couple of days. We've looked through a lot of the topics here and most seem to suggest that issues with user code that can be solved by putting the device into Safe Mode and then flashing OTA. In our case, we are still not able to flash OTA successfully in Safe Mode, or when running tinker, unless the app we are flashing is Tinker, suggesting perhaps some kind of problem with the incoming new firmware app rather than the one running already on the Electron.
Failure looks like: we flash from the CLI and get back a "Flash Device OK: Update Started", we see the device blink magenta for a few moments, then it will hang on either magenta or off for about 2 minutes, then reset, running the old user firmware. After reset it publishes a "spark/device/last_reset" - "update_timeout" event.
More details, same for both devices we have tried:
Electron 2G - running 0.6.4 - using third party SIM - part of a Product on the console
SYSTEM_MODE(MANUAL) - Located in Nigeria (though we have another product that flashes OTA just fine here, different code but same Electron models, same system fw, same 3rd party SIM)
Flashing orders we have tried:
Running User FW -> Flash User FW -> Fails
Running User FW -> Enter Safe Mode -> Flash User FW -> Fails
Running User FW -> Enter Safe Mode -> Flash Tinker -> Succeeds
Running Tinker -> Flash User FW -> Fails
Running Tinker -> Flash Tinker -> Succeeds
During a couple of our attempts when flashing directly to our user firmware, we caught this warning in the Serial log outputs (repeated 7 times):
0000574030 [comm] WARN: handle received message failed - aborting transfer
We've tried all of these with SYSTEM_THREAD(ENABLED) and without.
We've tried catching the device in a tight loop with Particle.process() as suggested in this post: Particle-CLI OTA Electron flashing timed out - #6 by ScruffR
And we've also tried using the firmware_update system interrupt callback to set a flag fwUpdating = true and then placed this at the start of loop:
if (fwUpdating) { Particle.procress(); return;}
We also used 'particle serial inspect' (suggested here: Flash via Serial or OTA fails but OK via DFU - #20 by ScruffR) are received the output posted below. Looks like our dependencies are ok, not sure if someone has insight on the specific versions of either the bootloader or our user module that could be problematic?
Any advice/ideas are extremely appreciated, we're running out of ideas for how to fix this!
particle serial inspect output:
Platform: 10 - Electron
Modules
Bootloader module #0 - version 11, main location, 16384 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #1 - version 110, main location, 131072 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #3 - version 110
System module #2 - version 110, main location, 131072 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #1 - version 110
System module #3 - version 110, main location, 131072 bytes max size
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
User module #1 - version 4, main location, 131072 bytes max size
UUID: E09E5577FBCF6BA881E85FD5660CB694A8F8C35121016E00A024027957201CF5
Integrity: PASS
Address Range: PASS
Platform: PASS
Dependencies: PASS
System module #2 - version 110
empty - factory location, 131072 bytes max size