How to load some code from specific location from EEprom? #562
Replies: 13 comments
-
Posted at 2016-04-30 by @allObjects I do not exactly understand what you what to achieve. After a successful upload followed by a In case you plan something different, like a remote update of the saved code in form of a second version and you want to load it into the FlashEEPROM and switch over with a reset... that may be something else. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by ceremcem I'm making a plan for such a scenario:
My plan as a precaution is the following:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by Wilberforce Have you seen this? https://www.npmjs.com/package/node-espruino Also, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by ceremcem @wilberforce Yes, I've seen that module but it was too late because I've written my own toolset way before I've met Espruino (during which I was dealing with micropython). But the node-espruino doesn't offer such a fallback mechanism anyway. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by @allObjects @ceremcem, I see where you're going.
I'm thinking of a VM concept where there is a Host and a Guest... the Host is rock solid, always there and a minimal (communiction) environment to host Guests... and the Guests are the actual applications. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by ceremcem @allObjects This is exactly my plan. I think I can implement such a "Host" (a On second thoughts: I can use FlashEEPROM. Then, I could write a code that will behave like a console (like Only difference is, I can save to and load from exactly where I want. Hmm. Let me try something out. I'll get back to you. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-30 by @allObjects ...modifying the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-02 by @gfwilliams You might be able to use If Espruino doesn't get back to the idle loop within some time period it'll crash, so your code would look like:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-02 by ceremcem There was a near-miss of RTFM issue :) I found this in the documentation: http://www.espruino.com/run_code_from_eeprom#line=8 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-04 by @gfwilliams You can also do |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-05 by tve On the esp8266 the built-in telnet console and the web-server used by wiflash come up immediately at boot independently of any JS code execution. If you can delay the start-up of your JS code that can give you a window to "get in". Also, since the port 88 web server is independent if JS you have a good chance at hitting it even if JS code is messed-up, as long as the Espressif SDK still receives packets and can make a callback. All this isn't exactly what you're looking for but it gets pretty close. In my experience things get really hosed if save()'ed code in flash is no longer compatible with a newer version of Espruino that just got loaded or if the esp8266 crashes and the WDT doesn't reboot it (yup, happens to me but hard to repro intentionally). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-05 by Wilberforce @tve could the ota server for firmware updates get extended to allow for the save() code to be be replaced for these lock up situations? There would also be another benefit - could new code be sent along with the .bin files, to get interpreted on restart after the firmware update? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-05-06 by tve It's all doable... The OTA update code is kept as small and simple as possible for obvious reasons. Also, the protocol is really simple to allow a bash script with a couple of curl invocations to do the upgrade. I.e., no extra binary to build or locate. (It would not be all that difficult for someone versed in powershell to write the equivalent for Windows.) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-04-29 by ceremcem
Hi,
I want to add an option to my espruino toolset that will support a fallback app code mechanism when uploading code by both wifi and uart interfaces.
I know there is Wifi Remote Console code available already, so there is only a fallback mechanism left to implement.
When I upload a new code, my
bootloader
will boot from newly uploaded code. If some kind of heartbeat is not found for a while, it will reboot and load the last known good code.So the question is, how can I save/load a code to/from from a specific location of EEprom?
Beta Was this translation helpful? Give feedback.
All reactions