-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFTP update failed #60
Comments
I've never got tftp working inside a telnet session. Last famous words: "Committing update in 2 seconds" Rewriting the flash via esptool works - so it doesn't look like esp On 03/24/2015 06:46 PM, DarkByte wrote:
|
Hm... I think I know why it doesn't work over telnet. It's easy to fix, but you won't get any progress report whatsoever when synchronising data. |
@nekromant, I use serial to communicate with esp. |
@darkbyte-ru Got it, hold on will fetch the board and see if it works for me. |
I know that progress bar isn't possible because of blocked wdog and INTs. On 03/24/2015 07:10 PM, Andrew wrote:
|
Bad news. tftp updates crash as well as spi_wipe command. Looks like some spi flash code is now calling something that's NOT in RAM. Looks like we're in deep trouble with 1.0 SDK. |
That's what I see when trying the tftp via serial:
The latter one repeats until the module hangs... Module must be reflashed afterwards... By reordering the "ets_wdt_disable()" / "ets_wdt_enable()" and commenting out the hash printout |
@susisstrolch I already tried running os_intr_lock() before doing the actual update, doesn't help much, things are the same. What's ever weirder, epc1 addresses of exception appear to be random on my board. |
Also, encapsulating in doesn't work. Exactly same - only differenc is, that wdt reset shows up I'll ask Espressif... On 03/27/2015 02:45 PM, Andrew wrote:
|
@susisstrolch Thanks! Hope they can give us some insight of what's happening inside the blobs. For I don't feel like spending a romantic evening with a disassembler right now. |
The SDK docu about "system_upgrade_flag_set" is completely misleading, On 03/27/2015 03:06 PM, Andrew wrote:
|
And what's about the idea to go the same route than Espressif - using the bootloader-blob 1.3 and providing two different roms (f.e. antares.rom1, antares.rom2), linked for the two (by Espressif) supported flash areas? Maybe the os_intr_lock() should go into the loop body, just in case one of those funcs will reenable ints.. |
@susisstrolch I thought about that. However it all looks pretty nasty. If those things didn't change since first versions of SDK (and we still have a flash split, where one application updates the other mirror and reboots to it) we'll be limiting ourselves to 256KiB flash (for rom1 and rom2) not saying about complicating the build process. If we manage to bring tftp update back to life, with heatshrink compression we can get ~300-400KiB of flash without sacrificing OTA update functionality. |
Had a quick look with "objdump -dtr libmain.a"... |
@susisstrolch Looks like someone has been doing some profiling and forgot to remove portions of that profiling code. Do you think you can ask Espressif to kindly fix that in further SDK releases? |
Just verifying against 0.96... |
Hmm... strange - sure it worked with 0.96? |
Previous version of SDK was 0.9.6? I thought 0.9.5. |
So it was introduced with the 0.9.6 beta... On 03/28/2015 12:52 PM, DarkByte wrote:
|
Hmm... an unsane workaround would be to remove system_get_time out of libmain and provide an own one, until SDK is fixed... |
Maybe simple nop system_get_time calls in libmain? |
Jep - 'cause it only contains code w/o relocation: 40218250 <system_get_time>: On 03/28/2015 01:19 PM, DarkByte wrote:
|
these are the bytepos in libmain to patch with a nop (0x0020f0 -> f0 20 00):
ensure, that those locations contain "c0 00 00" before patching... |
@susisstrolch, seems not working
|
Are you using the proper libmain.a?
If not, you've patched the wrong libmain.a...
./esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libmain.a is the right one to patch... |
Seems the same, but "callx0 a0" it is call system_get_time. Must be "0020f0 nop". I'm really patch wrong file. At first I patch "/esp-open-sdk/esp_iot_sdk_v1.0.0/lib/libmain.a", but for linking was used "/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libmain.a". |
Now update commits okay, but module does not starts after that.
|
So it's bricked? Does it work after a pwr cycle? |
@susisstrolch, yep, bricked, after reset it send only
at baud 74880. |
Hmm, here it doesn't work also..
and got a pretty strange result:
Any idea how to read the whole flash with esptool? Trying to read from 0x00 doesn't work... |
@susisstrolch Something tells me they might be using system_get_time() there for a reason. Perhaps swapped busy-wait for a system_get_time(). This way if you replace system_get_time with a nop it might misbehave, e.g. timeout immediately and therefore garble the flash contents in weird way. |
Crosschecked again and compared spi_flash-0.9.5 vs spi_flash-1.0. Other variant - instead of patching: Will try to call system_restart() instead of ets_wdt_enable();... On 03/29/2015 01:35 PM, Andrew wrote:
|
Answer from espressif team:
|
Got exactly the same one with addition On 03/31/2015 08:46 AM, DarkByte wrote:
|
The problem seems to be the system restart.
So, for me it looks like the bootloader assumes a given structure, which Unfortunately, the update related functions from SDK are based in irom, so, at least without elf patching, we can't use the suggested methods "system_upgrade_flag_set()", "system_upgrade_reboot()" On 03/31/2015 08:46 AM, DarkByte wrote:
|
@susisstrolch Bad news. I didn't expect Espressif to really fix the problem - they don't look like the people who care about anything but their own weird approach. I'll give their bootloader thingie a spin, may be with heatshrink it won't be a huge overhead. Basically we need a basic app to jump to that will only do the syncronisation. |
@nekromant, some good news:
"This not a bug, but we will fix it" :D |
Don't go directly to "Start"... :) On 03/31/2015 10:17 AM, DarkByte wrote:
|
I think this is time to make own bootloader with blackjack and tftp support. Or, maybe arduino like for a first time. |
@darkbyte-ru o_O Either they are reading this very thread or I'm just paranoid. Nevertheless - good it will be fixed. Maybe I was even wrong to bash them like that.
Any comments? |
So we're at the same point than now:
All others (system_reboot(), system_upgrade_*) can't be run because we In fact, we have to find out what the rom-based loader does after On 03/31/2015 11:53 AM, Andrew wrote:
|
@susisstrolch Let me try it again next weekend. I don't think the ROM loader does any super-special magic there. |
Ok - found the reason... |
My bad, looks like I've left some hardcode after I've implemented the end-of-firware marker. |
New sdk is out: esp_iot_sdk_v1.0.1_b1 |
Am trying to get 1.0.1 wired in to see if that resolves the issue (getting a hang similar to above on UART). Pulling in this version seems to require two changes; moving the rom0 segment back to 0B00 and changing the include path. That makes things compile without ado -- but on flash & reboot (though UART) a hang is observed just after it prints out the Memory map on reset/reboot. Any suggestions as to what I may be missing ? Or where to look. Dw.
|
After updating antares and SDK make a new firmware and write it to esp via tftp, all was ok, esp bootup.
Then run tftp upgrade from new firmware and it's failed:
Last message repeated N times before esp stop responding.
The same firmware successfully flushed via XTCOM.
The text was updated successfully, but these errors were encountered: