• Problem with E.toString in Espruino 1v95 on ESP8266-4MB

    1. Erase flash

    2. Flash the chip (uses DIO)

      :: Flash ESP8288-12 4MB chip with Espruino
      set /p pport=Enter a Com port 
      echo %pport%
      pause
      esptool.py --port %pport% --baud 115200 write_flash --flash_freq 40m --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
      pause
      
    3. Run this program

      var chk=512;
      var tdata=new Uint8Array(chk);
      var i;
      for(i=0;i<chk;i++){
      tdata[i]=0x30;
      }//next i
      
      
      function test(){
      for(i=0;i<100;i++){
      console.log(i);
          console.log(E.toString(tdata));
          process.memory();   //optional
      }//next i
      }
      
      setTimeout( function () {
      console.log("hello");
      test();
      }, 1000);
      

    4 Here's the output

     1v95 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
    >
    =undefined
    hello
    0
    0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­00000000000000000000000000000000
    1    
    

    Skipping some output to save space

    49
    0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­00000000000000000000000000000000
    50
    0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­00000000000000000000000000000000
    51
    0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­0000000000000000000000000000000000000000­000000000000000000000000000000
     ets Jan  8 2013,rst cause:2, boot mode:(3,6)
    load 0x40100000, len 2408, room 16
    tail 8
    chksum 0xe5
    load 0x3ffe8000, len 776, room 0
    tail 8
    chksum 0x84
    load 0x3ffe8310, len 632, room 0
    tail 8
    chksum 0xd8
    csum 0xd8
    2nd boot version : 1.6
      SPI Speed      : 40MHz
      SPI Mode       : DIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    âäoärûg|ìdÄd`Äãr$þ
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v95 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
    > 
    
  • E.toString() is working perfect and is not the root cause.

    It is no a good idea to block the esp with large outputs, because this can cause a reboot :)

    Hint: use tdata.fill(0x30)

  • Is the issue that you got bitten by the watchdog as MaBe suggested?

    Or are you claiming the output of E.toString() is incorrect? (it's not, 0x30 is ascii code for "0" )

  • It were the watchdog timer doing the reset.
    This works.

    var chk=1024;
    var tdata=new Uint8Array(chk);
    var i=0;
    
    tdata.fill(0x30);
    
    function draino(){
    }
    
    D=new draino();
    
    D.on('drain',function(){
     console.log(i);i++;
     console.log(E.toString(tdata));
     process.memory(); //fails if this is commented
    });
    
    setInterval(function (){
     D.emit('drain');
    },100);
    

    The emit and drain are simulating serving data to a socket.
    Code for doing that would obsfucate the issue a bit more.

    Gordon has addressed the problem shown by commenting out the process.memory, but his fix isn't in the published 1v95 code yet.

    Thanks for the tip about the watchdog. The ESP8266 Espruino is a different paradigm from the Pico. Is there a similar watchdog in the ESP32 Espruino?

  • Have you tried this on the cutting edge builds yet to see if it's any different?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Problem with E.toString in Espruino 1v95 on ESP8266-4MB

Posted by Avatar for ClearMemory041063 @ClearMemory041063

Actions