cool tech zone zone
Ooof, bit of a scary moment, first firmware update failed - Printable Version

+- cool tech zone zone (https://forum.cooltech.zone)
+-- Forum: Tangara (https://forum.cooltech.zone/forumdisplay.php?fid=3)
+--- Forum: General (https://forum.cooltech.zone/forumdisplay.php?fid=5)
+--- Thread: Ooof, bit of a scary moment, first firmware update failed (/showthread.php?tid=71)



Ooof, bit of a scary moment, first firmware update failed - halfbyte - 2024-12-14

So, I received my Tangara today (via FedEx, if that interests you) in Hamburg, Germany. Shipping was surprisingly quick, I got my shipping notification just two days ago.

The device is absolutely fantastic, unfortunately I currently lack an SD card (which should arrive today as well) so I thought, well at least I can try to do the 1.0.1 firmware update. After doing the usual access rights dance on my relatively fresh Ubuntu install (Usually adduser $USER dialout should do the trick), the companion app started up, showed the correct version number and after downloading and opening the latest firmware file, it started to update the device - only to fail with a relatively unspecific error message (that I didn't preserve, sorry) and the device appeared bricked after that. The device, when turned on, still did the USB connection thing and the serial device did appear, but the companion app was not having it.

So I downloaded the firmware repo, installed the whole IDF thing and first thing I did was starting the monitor. The ESP32 seemed to have been caught in a boot loop (probably because the actual firmware was simply missing), with output as follows:

Code:
load:0x40080404,len:3700
entry 0x400805c4
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:5128
load:0x40078000,len:15780
load:0x40080400,len:4
--- 0x40080400: _init at ??:?

So it seems to me as if the companion app does not actually handle a case of a bricked ESP32 firmware (Which is fine I guess). What did work in the end (And of course it would) is using idf.py directly for building and flashing the firmware.

I've tried to replicate the issue, but the second time around, the companion app had no problem flashing the firmware (And I don't want to waste more flash cycles by retrying a couple of times)

So, this is, at this point, more or less a heads up and a warning that it seems that the companion app sometimes fails to update the firmware, but that recovery is easy-ish if you're able to install ESP-IDF etc. etc.

In any case, thank you very much for this wonderful device. 

Now if the courier could please turn up with that SD card, that would be great.


RE: Ooof, bit of a scary moment, first firmware update failed - jacqueline - 2024-12-15

Oof that's not ideal at all, thanks for reporting! We should make the companion app a bit more robust against bad flashes. We've also discussed alternate flashing methods (e.g. via esptool) that would also help in this situation by being an alternate way to flash.


RE: Ooof, bit of a scary moment, first firmware update failed - redshift - 2024-12-15

I wonder if it could be related to this issue: https://github.com/haileys/tangara-companion/issues/1


RE: Ooof, bit of a scary moment, first firmware update failed - halfbyte - 2024-12-15

(2024-12-15, 05:01 PM)redshift Wrote: I wonder if it could be related to this issue: https://github.com/haileys/tangara-companion/issues/1

You know what, I looked at that issue and thought "nah, can't be it", because I was relatively sure I didn't try the console on the same session as I tried the update, but now I am not so sure anymore. If I can find the time I'll try to replicate this, which should be fairly straight forward.

Thanks for bringing this up again.


RE: Ooof, bit of a scary moment, first firmware update failed - jacqueline - 2024-12-15

I think the main issue is that 0.4.0 of the companion didn't include this commit: https://github.com/haileys/tangara-companion/commit/4439ed67b21cd0ee0348fcd0b698eed3d3e20d51

Flashing is generally very stable at a 1M baud rate, but works only most of the time at 1.5M. Hailey pushed a new release that includes this + other fixes, so hopefully this won't happen to many others. I'm also working on docs on alternate flashing methods this week.