How to use setBootCode? #597
Replies: 7 comments
-
Posted at 2016-07-06 by @gfwilliams
The issue is that if you save
In reality you want a little more fudging, as for some modules you need the global variable 'module'. I guess it might make sense for the Web IDE to automatically do that instead. Even without saving to flash it's actually more efficient, as the module code can be loaded straight from the input string (so needs less memory and time during the upload). To be honest I'm not sure why it didn't do that from the beginning.
Yes,
Could you not just change the location used for saved code to one that was bigger? That would be by far the easiest way. I mean, sure, you could add some kind of filesystem, but it's probably not worth the effort. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-06 by Wilberforce Is the 512k version of the esp8266 still usable ( @jumjum) reported issues on gitter. (I've cooked my esp01 so I can't test). If longer supported, there is a 20k block of flash that could be used:
Perhaps this area could be used for E.setBootCode, or to store modules? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-06 by tve The 512KB versions still work fine. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-06 by @gfwilliams I guess so... Not sure exactly where that #define is used, but I'd be happy if you wanted to turn it into |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-07 by JumJum @wilberforce ,tested new version on ESP8266 512KB
So, there is a problem with my flashing, any idea ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-07 by Wilberforce @jumjum - it's good to know the release ones work... Now, I wonder what is up with your versions? Have you got the math lib .o file that was introduced a while back - I guess you must have otherwise it would not build? The other thing to try would be an erase first, then a flash. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-07 by Wilberforce Rather than joining two bits..... @tve If the EPROM is larger, use the current save code location, but extend from 12k to 16k, and keep the compressed code. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-07-06 by tve
I'm probably a bit dense today, but I'm not quite seeing how to use E.setBootCode. What I'd like to do is save some low-level modules that are stable to make more space for my own code. For example, I'd like to save the MCP_23008 module, which I have in a file MCP23008.js. And then I'd like to be able to iterate uploading my_project.js which uses the MCP23008 module. How do I do this?
I suppose I start loading MCP23008.js into the IDE, check the Save on send flag, and hit the upload button. Now the module is saved. I can reset() for good measure. But it's not really loaded as a module, right? And when I now upload my_project.js the module registry gets cleared anyway, right? Or do I need to add something like
var mcp = require("MCP23008")
at the end of the MCP23008.js file to get a reference into a variable? Or...NB: have you thought about how a target like the esp8266 could use a different bigger flash area for the setBootCode?
Beta Was this translation helpful? Give feedback.
All reactions