Espressif2Arduino icon indicating copy to clipboard operation
Espressif2Arduino copied to clipboard

Issues when flashing ROM3

Open StSimmons opened this issue 8 years ago • 8 comments

As raised in https://github.com/mirko/SonOTA/issues/11

I think i know what may be wrong - i was testing a slightly different configuration and noticed that sometimes the buffer downloading the new images doesn't fill up - and when it doesn't fill up in multiples of 4 bytes bad things happen (the flash doesn't write correctly). I have a fix in the works but for now you will have to flash it with serial cable sorry.

StSimmons avatar Jul 11 '17 11:07 StSimmons

Should be fixed..

khcnz avatar Jul 11 '17 13:07 khcnz

Some interesting findings after I tried to flash a new device:

  • The new device got the E2A firmware as expected
  • It attempted to download the new firmware (not 100% sure if it completed, I did see an error on the host, but python didn't tell me what the error was - I suspect timeout)
  • The device is now just flashing (unlike the previous version where it just fails to boot)
  • It fails to connect to my network.

Is it possible that the new version somehow loses the wifi credentials?

StSimmons avatar Jul 11 '17 14:07 StSimmons

Are you sure it didn't actually flash Tasmota? The wifi credentials don't carry over to tasmota. If you push the button does it turn the relay on and off?

khcnz avatar Jul 11 '17 20:07 khcnz

Pressing the button does nothing. No relay firing, nor any other press combo triggering other tasmota functionality.

StSimmons avatar Jul 11 '17 22:07 StSimmons

If it's still flashing then probably still running e2a. I didn't make any changes that specifically effect the wifi credentials - however whereas previously a failed flash would have corrupted the bootloader (and prevented booting) now the bootloader is written last only once the entire rest of new rom is flashed in place. Which E2A image did it download last (before trying the tasmota one)?

khcnz avatar Jul 12 '17 06:07 khcnz

I read wifi creds from 0x79000 -> 0x79066.

However when flashing to rom slot 1 first it erases/wipes 0x01000->0x80000 - so yes if it fails wifi creds will be gone.. I'll think about how to solve this (store to rtc? store at end of flash?)- i'd also like the wifi creds to migrate over to tasmota.

khcnz avatar Jul 12 '17 06:07 khcnz

It didn’t download any - I installed the E2A user2 (0x08100) image first using SonOTA. E2A then successfully booted and grabbed the Tasmota image.

Note: these are all manual builds for the Sonoff Touch. E2A was built off of HEAD for Sonoff Touch, and I build Tasmota 5.x.x with the No SPIFFS option (as they suggest for v5 images)

One thing to note - it did try to grab the 8266 image - which I assume means that it was trying to flash a Touch in QIO. I did think it should use DOUT, no?

StSimmons avatar Jul 12 '17 06:07 StSimmons

DIO normally (but I think DOUT also works?). If its flashing (but its not running tasmota) then I would think it must still be E2A. I'd wager its as per above, I wiped the rom including the wifi creds. It should try 3 times to install - if all three times fail it will reboot (and therefore no wifi creds anymore..)

khcnz avatar Jul 12 '17 06:07 khcnz