A graphic Web-IDE plugin to use modules on your flash (using tve FlashString.js) #5904
Replies: 1 comment
-
Posted at 2017-11-09 by @allObjects Cool... tried it out - on Espruino-Wifi... tried to try it out... :( Screenshots attached... What I did:
Looks like I'm missing something... And there are some unexpected things happening:
Attachments: Posted at 2017-11-09 by Polypod Thanks very much allObjects for trying, obviously I forgot to mention about the options, but you found it, yes you have to set a folder. Once you have the window from puzzle button to open, it will still say "no flashstring found", that mean you need to transfer to the board with the button top right from flash or module tab. Attachments: Posted at 2017-11-09 by @allObjects @Polypod, thanks... sometimes it is so frustrating that a little, non-essential details just crashes a success experience and prevents the great work from showing! Here my last results of setup:
Attachments: Posted at 2017-11-09 by @allObjects ...usage is though still a bit unclear... as you can see from the logs... was unable to upload to a Pico. Copied then the FlashString.js as well to the FlashViewTest/modules folder. Upload to memory worked, but not to flash... but I'm not sure about the sequence and what would have to go when and where. Please provide a few lines of mode d'emploi...
Posted at 2017-11-09 by Polypod You are almost there. I never noticed that it ignores files ending with .min.js, it must be the way the project plugin was made. I'll have a look at that as well. If you try plain .js files, you have a 2 step left, to place the FlashString.js file in the modules directory, and to upload it to the board with the button with two arrows. Posted at 2017-11-10 by @allObjects I had FlashString.js in place... BUT: NEVER MIND... looking closer into the code, I noticed that it is ESP8266 oriented... So my Espruino-Wifi and Pico would anyway not be able to do... last but not least what @tve mentioned: page size (and total memory) of STMs are prohibitive to this simple, straight forward approach - post #6 in origin conversation. Posted at 2017-11-10 by Polypod Thanks again allObjects for all your tries, I appreciate. I think it is not working because you didn't upload the FlashString.js module to the board yet. I can see it is not there in your log. The buttons to upload to flash are not supposed to show yet until he finds this module on the board, but for some reason they show up on yours, just a glitch. So when you use them, he complain about the absence of this module. (Uncaught Error: Module "FlashString" not found) If it is not an ESP8266, you may also need to change the default address/size in FlashString.js to match your flash setup (line 28-31 and remove the 2 extra pages use line 48). The sequence of action is : Here is the log :
step2 :
step3 :
In case it was not clear, to communicate with the flash, the plugin uses the FlashString.js module he find ON the board memory, not the one on the hard drive. Therefore, you need to upload it there first by placing it in the module folder of the hard drive and use the button. The plugin just minify and transfer the file to FlashString.js on board, that take care of the rest. Yes, the plugin was made using tve module that is esp8266 oriented as you mention. That's why I posted in this section of the forum. But the plugin can work with any flash module that works the same way with save/load/(json)list, I was planning to extend it with another tab using FlashStore.js (I mentioned in first post), but this is still Esp8266. Anyone made a similar module yet for other platforms flash ? For me, it is worth have a unified plugin for flash, SD and so on, but, I have no SD, and truth is, I never got to understand completely the Project plugin code I made my plugin from, hence the little bugs here and there. Honestly, I am quite surprised by the difficulty you meet to make it run. I realize it is one thing to use it on my setup, and another to make it run in other people's setup. I would sure appreciate to see it run somewhere else, but if that doesn't help you forget it. If it is not an ESP8266, the benefit is quite limited, I understand if you give up :) I can fix the bugs that you already found, if that really helps. Some days, I don't understand how people can program on esp8266 without using this plugin, memory is so small and javascript is so gluttonous. Other days, I realize I am the crazy one for wanting to use 44kb of modules, plus the rest 3mb for storing files and logs, and have free memory. Attachments: Posted at 2017-11-10 by @allObjects @Polypod, thanks for the details... and also the obvious enhancements that show in your new screenshots. I attribute these to the differences I notice. I will return some time later to 'play again'. May be I can then also pull a new version of the IDE with the enhanced *Flash Viewer / Flash Manager * plug-in. For now I would like to talk about the folder structure to the point I understand. The attachment shows the directory structure and files I was working with yesterday. The sandbox folder - light blue box - is
Said that, some files are just in too many places... ;). But I assume - when Attachments: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-11-09 by Polypod
Hi all,
I made this small WebIDE plug-in to use the plenty of flash pages of the ESP8266 and upload then execute easily modules there, and have more memory free for other use. I use it every day, as my programs always need more memory and getting bigger than the default space of 10kb. You can minify and transfer modules into pages, in one click, and then link them to be executed from flash, in another. As extra you can also load/unload modules direct to memory, etc. It mainly allows to use tve FlashString.js, without the hassle of manual commands and minification (mentioned in http://forum.espruino.com/conversations/290975/). Be careful, the execution from flash and use of E.memoryArea is restricted to the first mb, so you can use it only on the 44kb(11 pages) under 1mb. I use Wilberforce FlashStore module for the 3mb left (http://forum.espruino.com/conversations/283045/).
My code is based on the Project plug-in, here is it (messily programmed I am afraid but works well).
https://github.com/popok75/Espruinuity/blob/master/Espruino-WebIDE/js/plugins/flashView.js
It uses a modified version of tve FlashString.js . Here is this version : https://github.com/popok75/Espruinuity/blob/master/EspCode/project/modules/FlashString.js
also you may want the stand-alone loader : https://github.com/popok75/Espruinuity/blob/master/EspCode/project/modules/FlashStringLoader.js
You want FlashString.js to be in modules directory when you start, so that you can transfer it to memory and start using your flash.
For installation, you can get my version of WebIDE from the github (fetched 2 month ago) or you just need the source of WebIDE, add the source of espruino-tools in the right directory, flashview.js in plugin directory, and insert the following statements at the right place (not sure they are all needed) : https://github.com/popok75/Espruinuity/search?utf8=%E2%9C%93&q=flashview&type=
Here is how I load them in the final program :
I hope you'll try it and tell me what you think.
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions