Avatar for Polypod

Polypod

Member since Jul 2017 • Last active Jan 2018
  • 6 conversations
  • 40 comments

Most recent activity

  • in ESP8266
    Avatar for Polypod

    Thanks a lot Mabe for all your replies. I learned a few things, but honestly, I still feel a bit lost between builds, flash maps, etc.
    My context, my current project actually run on my esp12-4mb with the basic 512/512 build. I use 8 modules, executed from flash, with FlashString (http://forum.espruino.com/conversations/­290975/) and it's homemade IDE plugin (http://forum.espruino.com/conversations/­313069/). I was trying to figure out if I can run it also on other configurations/builds of esp8266, and how to save and execute code from flash in these.

    It seems there is 1700 blocks no graphics in the 4mb combined build from http://www.espruino.com/binaries/espruin­o_1v95_esp8266_4mb_combined_4096.bin.

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016
    >process.memory()
    ={ "free": 1672, "usage": 28, "total": 1700, "history": 0,
      "gc": 0, "gctime": 1.357 }
    >var g = Graphics.createArrayBuffer(8,8,8);
    Uncaught ReferenceError: "Graphics" is not defined
     at line 1 col 17
    var g = Graphics.createArrayBuffer(8,8,8);
                    ^
    > 
    
  • in ESP8266
    Avatar for Polypod

    It was 16kb of minified code I uploaded and tried to save.

    This is the output I get from the "4mb combined", 1700 blocks and no graphics:

    _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016
    >process.memory()
    ={ "free": 1677, "usage": 23, "total": 1700, "history": 0,
      "gc": 0, "gctime": 1.352 }
    >require("ESP8266").getState();
    ={
      "sdkVersion": "2.0.0(5a875ba)",
      "cpuFrequency": 160, "freeHeap": 9728, "maxCon": 10,
      "flashMap": "4MB:1024/1024",
      "flashKB": 4096,
      "flashChip": "0xc8 0x4016"
     }
    >Graphics
    Uncaught ReferenceError: "Graphics" is not defined
    >require("Flash").getFree()
    =[
      { "addr": 2097152, "length": 1048576 },
      { "addr": 3145728, "length": 262144 },
      { "addr": 3407872, "length": 262144 },
      { "addr": 3670016, "length": 262144 },
      { "addr": 3932160, "length": 262144 }
     ]
    
  • in ESP8266
    Avatar for Polypod

    Thanks again Mabe, for your reply. I made a copy/paste mistake earlier, now it's updated.

    The esp8266 4mb not combined version (found here) get me :

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xef chip 0x4016
    >
    

    It says 512/512. Is it the first or the second build ?

    Using the 4mb combined, from the WebIDE, I managed to upload 16kb of code, 4kb by 4kb, and the total took 1300 blocks, and it can't be saved with save(), too big :

    > _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016
    > process.memory()
    ={ "free": 360, "usage": 1340, "total": 1700, "history": 358,
      "gc": 0, "gctime": 1.351 }
    >save()
    =undefined
    Erasing Flash.....
    Writing..................
    ERROR: Too big to save to flash (15900 vs 12284 bytes)
    Deleting command history and trying again...
    Erasing Flash.....
    Writing..................
    

    I fail to grasp the rationale behind these 16 pages for saved code and how are we supposed to fill them. Ok, I can fill 12kb of the 64kb reserved for saving code. Is there a way to use the resting 52kb ? is there a way to execute them from flash (like with save-on-send/E.memoryArea) ?

  • in ESP8266
    Avatar for Polypod

    Thanks @MaBe for your reply, Things are ... more confusing now :P
    Do I understand correctly, there is 3 different builds for esp8266 ?

    1 / build 8266
    found here : http://www.espruino.com/binaries/espruin­o_1v95_esp8266/. I guess it's the one decribed by this file : https://github.com/espruino/Espruino/blo­b/master/boards/ESP8266_BOARD.py. Has a 1700 vars and no Graphics. Available free flash total is 3mb+40kb, the 40kb are under 1mb usable to run modules from flash with E.memoryArea(). This is the build I usually use, with no problem. I install it with :

    python esptool.py --port COM20 --baud 115200 erase_flash
    python esptool.py --port COM20 --baud 115200 write_flash --flash_freq 40m --flash_mode dio --flash_size 32m 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
    

    and get

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xef chip 0x4016
    >process.memory()
    ={ "free": 1677, "usage": 23, "total": 1700, "history": 0,
      "gc": 0, "gctime": 1.352 }
    >require("Flash").getFree()
    =[
      { "addr": 487424, "length": 4096 },
      { "addr": 524288, "length": 4096 },
      { "addr": 1011712, "length": 36864 },
      { "addr": 1048576, "length": 3129344 }
     ]
    

    2 / build 8266 4mb
    found here : http://www.espruino.com/binaries/espruin­o_1v95_esp8266_4mb/. I guess it's the one decribed by this file : https://github.com/espruino/Espruino/blo­b/master/boards/ESP8266_4MB.py. Has a 1600 vars and Graphics.
    I install it with the exact same command line, maybe it is not correct ? I get a very similar result, except that when I store something in the 6 first flash pages, it get erased on save(). Any idea why ?

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xef chip 0x4016
    >process.memory()
    ={ "free": 1572, "usage": 28, "total": 1600, "history": 0,
      "gc": 0, "gctime": 1.726 }
    >require("Flash").getFree()
    =[
      { "addr": 487424, "length": 4096 },
      { "addr": 524288, "length": 4096 },
      { "addr": 1011712, "length": 36864 },
      { "addr": 1048576, "length": 3129344 }
     ]
    >Graphics
    =function () { [native code] }
    

    3 / build 8266 4mb combined found here : http://www.espruino.com/binaries/espruin­o_1v95_esp8266_4mb_combined_4096.bin. I think it's the one you are referring to. is it described somewhere ? It has 1700 vars, no Graphics. I used the "4mb-c1" you posted in the other thread, and it worked perfectly. I understand the flash available is only the last 2MB, so not possible to have modules running from flash.

    python esptool.py --port COM20 --baud 115200 write_flash --flash_freq 80m  --flash_mode dio --flash_size 4MB-c1  0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin  0x3FC000  esp_init_data_default.bin 0x3FE000 blank.bin
    

    (updated following)

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016
    >process.memory()
    ={ "free": 1672, "usage": 28, "total": 1700, "history": 0,
      "gc": 0, "gctime": 1.358 }
    >require("Flash").getFree()
    =[
      { "addr": 2097152, "length": 1048576 },
      { "addr": 3145728, "length": 262144 },
      { "addr": 3407872, "length": 262144 },
      { "addr": 3670016, "length": 262144 },
      { "addr": 3932160, "length": 262144 }
     ]
    

    For this version, you mention 16 pages of saved code available, that's 64kb. How is it possible to store as much code in them ? If I use the WebIDE, the board throw a UNFINISHED STRING when the transfer reach 10kb. I guess there is no memory for larger transfer. Is there another way ?

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95.20 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:1024/1024, manuf 0xc8 chip 0x4016
    >Uncaught SyntaxError: Got UNFINISHED STRING expected EOF
     at line 1 col 15
    E.setBootCode("Modules.removeAllCached()­,Modules.addCached('...
                  ^
    New interpreter error: LOW_MEMORY,MEMORY
    >
    
  • in ESP8266
    Avatar for Polypod

    I see no reason why it doesn't work. Maybe the adapter. I use a nodemcu version with a different adapter (http://img.dxcdn.com/productimages/sku_4­06735_1.jpg)

  • in ESP8266
    Avatar for Polypod

    @tempos, that's strange for the normal version, mine is also an e12. Which command line did you use for flashing the separate files ? It happens only with the v1.95 or also v1.94 or c1.93?

  • in ESP8266
    Avatar for Polypod

    Hi, I tried with the same file and command line. I got the same problem: after I save wifi and replug, the led is continuously lit and the board only say garbage. The combined version 512 don't work at all, at least on my esp8266 4mb.
    I didn't even know about this combined release, before this post. The normal not "combined" version, i.e with separate files, works much better, and I am still using it. Not a solution, but a workaround.

  • in ESP8266
    Avatar for Polypod

    Hi,
    Where did you find command line addresses for the 4mb_combined ? I wanted to try it too, but didn't find the instructions.

    On my esp--12E, esp8266 4mb, I uses this image http://www.espruino.com/binaries/travis/­master/espruino_1v95.13_esp8266.tgz, installed with

    python esptool.py --port COM18 --baud 115200 write_flash --flash_freq 80m --flash_mode dio --flash_size 32m 0x0000 boot_v1.6.bin 0x1000 espruino_esp8266_user1.bin 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin
    

    No problem saving code or saving wifi. Works perfectly, or almost, sometimes It freeze when I reset.

  • in ESP8266
    Avatar for Polypod

    Hi,
    I have a esp8266 board with 4mb. I can safely run both of these versions right ?
    I know there is a difference between these two configurations of firmware. The 4MB version has additional graphics library, but only 1600 jsvars (and not 1700). This is defined by these files :
    https://github.com/espruino/Espruino/blo­b/master/boards/ESP8266_BOARD.py
    https://github.com/espruino/Espruino/blo­b/master/boards/ESP8266_4MB.py

    But why does the code save at a different place ? The 4MB version saved code use 16 pages of flash (64kb) instead of 3 (kb), but the board still cannot take more than 10kb at once, when I use the WebIDE. Is there a way to use these pages in the _4mb firmware ?

    In the 4MB version, save() erase the 6 first pages returned by require("Flash").getFree(), I use for my custom modules to run from flash. Possibly caused by the 16pages of flash erased. But I don't understand, are they free to use or not ?

Actions