"Hot-Reload" options

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

"Hot-Reload" options

Postby Gfast2 » Fri Dec 29, 2017 7:40 pm

Hi ESP-IDF,

Thanks again for all peoples here. You let me have even more fun here then from facebook. ;)

My question today is another "Holiday Question" - (question that has a answer which won't solve some "real problem" or bring productivity instently)

I've heard from some older colleagues when they made some developments on very expensive Dev-Kits about 10 years before, they didn't burn the actual code into that chip directly, instead they really let their Dev-Kits access the binary from their computer directly. Since ESP32 and the SPI Flash are physically two chips, it shouldn't be that hard to make a "virtual SPI Flash" interface and do the same trick. I believe these days no one would really care about the lifetime of a SPI Flash chip on a Dev Board. But this approach would make the whole development "Hot-Reloadable". Which is a pretty neat feature when I write Javascript (Webpack+React...). It does boost the workflow.

I hope I'm not asking something that exist in the documentation right now. But if it is so, please don't only laugh at this post and do nothing. Please complain me!! (as less as "RTFM") :lol:

Cheers

Su

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: "Hot-Reload" options

Postby WiFive » Sat Dec 30, 2017 12:36 am

For chips where the program is copied from flash to ram before running and then flash is basically unneeded this makes sense but esp32 is executing code from flash through cache throughout program runtime and at up to 80mhz spi speed.

https://github.com/Ebiroll/qemu_esp32

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: "Hot-Reload" options

Postby loboris » Sat Dec 30, 2017 8:49 am

Gfast2 wrote:... But this approach would make the whole development "Hot-Reloadable"...
Isn't it what OTA update does? You can have a small "factory" partition which can contain the small application to download the main application to OTA partition and run it...

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: "Hot-Reload" options

Postby ESP_Sprite » Sat Dec 30, 2017 9:33 am

Actually, I think your colleagues were referring to 'ROM emulators', a device which usually is implemented as a SRAM chip with some logic attached that makes it possible to program it from a computer in-circuit. Back then, these were usually used because flash wasn't available yet, and erasing an EPROM meant waiting for a few minutes; pushing a new binary to the SRAM would be much faster.

While in theory you could also do this for an ESP32 (built using an FPGA to emulate the SPI flash and an USB3 interface or something to upload new data), I'm not sure how much speed you'd get for the extra effort.

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

Re: "Hot-Reload" options

Postby Gfast2 » Sun Dec 31, 2017 7:35 pm

Hi WiFive, Loboris & ESP_Sprite,

Thanks for your awesome hints! Becasue just I described, I don't have to use this in the near future. So I won't spent much time to try your answers in real code. But if I did, I will jump back to this thread.

Right now the "Hot-Reload" is something in my day job(Javascript):
Wenn I hit the save button (or short cut "Ctrl + S"), The Javascript Transcompiler will detect my recent change and (only) retranscompile this javascript module (Transcompile here means: From more modern Javascript (ES6) to more widly adopted javascript (ES5), later on can be even with features like "Tree-Shaking", replace variable name from "ThisIsMyVariableName" with "a" and remove all unnessesary carriage return co.), and refresh the instance of this javascript based website in my webbrowser automatically with this new changes.

Say its pretty a "what you see is what you changed by single click".

P.S.
Happy 2018!

Cheers

Gfast2

Who is online

Users browsing this forum: No registered users and 139 guests