Avatar for FStech

FStech

Member since Mar 2018 • Last active Dec 2018
  • 1 conversations
  • 9 comments

Most recent activity

  • in ESP8266
    Avatar for FStech

    This output still looks like a baud rate problem. Did you reflash the firmware with 115200? If you open a putty on 460800 does the output change?

  • in ESP8266
    Avatar for FStech

    Okay, so the error here appears to be on the baud rate. Set it 115200 instead of 460800. The espruino IDE can't recognize such a high baud rate, and won't be able to communicate with the board. This is what the command should look like:

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

    By the way, you can install esptool using the pip manager for python. For me it's just a little bit more convenient.

    EDIT: grammar.

  • in ESP8266
    Avatar for FStech

    @Joshua_Sturmvogel If you flash only with 4m, the flash map will be set to 512/512, and the firmware will be too big to fit on the ESP memory, which will make it crash and printout a lot of errors. Try what Willberforce suggested, or updating your esptool.py to a more recent one. Just don't flash with the single 4m for it will not work.

  • in ESP8266
    Avatar for FStech

    Hello @Joshua_Sturmvogel, sorry for the delay in the response. I can share the firmware with you. Attached is my compiled version, based on the v1.96 release. This version is compiled with the following modules:

    NET
    TELNET
    CRYPTO
    NEOPIXEL
    FILESYSTEM
    

    Note that it will only work in a 4mb ESP8266. Mine specifically is a NodeMCU V3.

    Best Regards.

    EDIT:

    To be able to flash it without problems, you have to use the 1024/1024 flash map. Here is the esptool.py command for that:

    esptool.py --port [/dev/ttyUSB0|COM1] --baud 115200 write_flash 
      --flash_freq 80m --flash_mode qio --flash_size 4MB-c1 
      0x0000 "boot_v1.6.bin" 0x1000 espruino_esp8266_user1.bin 
      0x3FC000  esp_init_data_default.bin 0x3FE000 blank.bin
    

    EDIT 2: Corrected the baud rate for the flashing command.

  • in ESP8266
    Avatar for FStech

    I have tried the SD card and it didn't work, now I know why.

    I have just asked about turning off those boot messages because I didn't recall them appearing on the stock Espruino firmware.

    I will recompile it turning flashfs off, and since the messages aren't really doing anything negative, I'll just leave them there.

    Thanks again for all the help.

  • in ESP8266
    Avatar for FStech

    Thanks @Wilberforce, that worked. I can now use the save() and on reboot everything work fine.

    To be clear on the process, this is my modified python script:

    import os;
    import pinutils;
    info = {
     'name'            : "ESP8266",
     'espruino_page_link' : 'EspruinoESP8266',
     'default_console' : "EV_SERIAL1",
     'default_console_baudrate' : "115200",
     'variables'       : 1600,
     'binary_name'     : 'espruino_%v_esp8266_4mb',
     'build' : {
       'libraries' : [
         'NET',
         'TELNET',
         #'GRAPHICS',
         'CRYPTO',
         'NEOPIXEL',
         'FILESYSTEM',
         'FLASHFS'
       ],
       'makefile' : [
         'FLASH_4MB=1',
         'ESP_FLASH_MAX=962560',
         'FLASH_BAUD=460800'
        ]
     }
    ...
    

    This is my compile.sh

     #!/bin/bash
    export FAMILY=ESP8266
    export BOARD=ESP8266_4MB
    export FLASH_4MB=1
    export ESP8266_SDK_ROOT=/espruino/ESP8266_NONOS­_SDK-1.5.4
    export PATH=$PATH:/espruino/esp-open-sdk/xtensa­-lx106-elf/bin/
    export COMPORT=/dev/ttyS2
    export USE_ESP8266=1
    export RELEASE=1
    make clean && make $*
    

    And this is my flashing command using 1024/1024:

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

    There is only one question remaining, I've added the RELEASE=1 again to compress a little bit more the binary, and upon restarting if I'm connected do espruino IDE I get the following output

    >s$l<dà|lä#|ìÛsbcÄò'oß$g'ãäcpìÇdsdsdxóoàd[#g](http://forum.espruino.com/search/?q­=%23g)ã|#Äónoï$l Ø'o$`g{ol`pò'à{Üâàcoã|ìcûo'çl Ø'o$`gso$pò'à{Üâàälcoã|cûo'çl Ø'o$`gsol`rÛgl`{loû'oã{no'Äd#$älìl$l~;lìddlgâ$$l$äloàÇgä'dlàÀcäÄllxccx#{cpÄcc$lo'Äãgd|$l`{lãäoì;ûg|ìll`ã;ddþLoading 3627 bytes from flash...
    Running onInit()...
    

    If I open a PuTTY session, with a baud rate of 75600, I can read the printed message:

     ets Jan  8 2013,rst cause:2, boot mode:(3,7)
    
    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      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(1024KB+1024KB)
    jump to run user1 @ 1000
    
    rf cal sector: 128
    

    Is there any way to remove that from startup?

    Thanks again.

  • in ESP8266
    Avatar for FStech

    Hello @MaBe, I've also tried building with export RELEASE=1, and got the same error.

    @Wilberforce Thanks for the insight, I may tweak a little on the packages. So far I don't need the graphics, do you know a way to omit it from the build?

  • in ESP8266
    Avatar for FStech

    Beyond what I posted earlier, here is a web IDE console output whenever I upload a code:

    My code:

    var wifi = require("Wifi");
    wifi.setHostname("Espruino");
    wifi.stopAP();
    wifi.setIP({ip:"192.168.1.20",gw:"192.16­8.0.1",netmask:"255.255.255.0"},function­(err){});
    wifi.connect("SSID",{password:"PASS"},fu­nction(err){
        console.log("connected? err=",err,"info=", wifi.getIP());
      
        wifi.save();
    });
    
    SPI1.setup({mosi:D7,miso:D6,sck:D5});
    E.connectSDCard(SPI1,D8);
    
    var files = require('fs').readdirSync();
    for (var i in files)
      console.log("Found File" + files[i]);
    

    Console Output:

    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     1v96 (c) 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 0x20 chip 0x4016
    >ASSERT(jsvGetLocks(var)>0) FAILED AT src/jsvar.c:674
      #1[r1,l2] Object {
        #2[r1,l2] Name String [1 blocks] "\xFF"      #3[r1,l2] Object {
            #6[r1,l2] Name String [2 blocks] "timers"          #8[r2,l1] Array(0) [ ]
            #9[r1,l2] Name String [2 blocks] "watches"          #11[r2,l1] Array(0) [ ]
            #13[r1,l2] Name String [1 blocks] "net"          #14[r1,l2] String [1 blocks] "\x04\x00\x00\x00\x00\xFF\xFF\xFF"
            #21[r1,l2] Name String [2 blocks] "modules"          #23[r1,l1] Object {
                #25[r1,l2] Name String [1 blocks] "Wifi"              #24[r5,l3] ...
     
              }
            #15[r1,l2] Name String [2 blocks] "history"          #26[r1,l1] Array(3) [
                #27[r1,l2] Name Integer 0              #17[r1,l1] String [3 blocks] "var wifi = require(\"Wifi\");"
                #29[r1,l2] Name Integer 1              #30[r1,l1] String [3 blocks] "wifi.setHostname(\"Espruino\");"
                #28[r1,l2] Name Integer 2              #34[r1,l1] String [2 blocks] "wifi.stopAP();"
              ]
          }
        #16[r1,l2] Name String [1 blocks] "wifi"      #24[r5,l3] NativeFunction 0x4021bc6c (0) { }
      }
    ---console end---
     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      : 80MHz
      SPI Mode       : QIO
      SPI Flash Size & Map: 32Mbit(512KB+512KB)
    jump to run user1 @ 1000
    sp 0x3ffffcb0
    epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0xffffffef, depc=0x00000000
    Fatal exception (28):
    epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0xffffffef, depc=0x00000000
    Fatal exception (28):
    epc1=0x40001800, epc2=0x00000000, epc3=0x00000000, excvaddr=0xffffffef, depc=0x00000000
    Fatal exception (28):
    ...
    

    this last 2 lines repeat indefinetly, no matter if I hard reset the device. The only way out of this loop is to erase the flash and reupload the firmware

  • in ESP8266
    Avatar for FStech

    Hello, I'm fairly new to Espruino and recently bought a NodeMCUv3(esp8266). I've downloaded the latest releases and tested a few codes. I was developing a simple web server that would serve an html/css/js page, and the plan was to store them on an SD card.

    The problem is that ESP8266 doesn't have FS by default, so I've set to build my own firmware with fs enabled. While I can build and get all my binaries, if i ever type save() on the web IDE and hard reset the board, it prints like crazy "fatal exception(3)"

    Here are my codes:

    compile.sh

     #!/bin/bash
    export FAMILY=ESP8266
    export BOARD=ESP8266_BOARD
    export FLASH_4MB=1
    export ESP8266_SDK_ROOT=/espruino/ESP8266_NONOS­_SDK-1.5.4
    export PATH=$PATH:/espruino/esp-open-sdk/xtensa­-lx106-elf/bin/
    export COMPORT=/dev/ttyS2
    export USE_FILESYSTEM=1
    export USE_NET=1
    export USE_ESP8266=1
    export DEBUG=1
    make clean && make $*
    

    flashing command:

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

    I am running ubuntu on windows for compiling, and had to modify the ESP8266_NONOS_SDK c_types.h lines:

    //typedef unsigned long       uint32_t;
    typedef unsigned int       uint32_t;
    //typedef signed long         int32_t;
    typedef signed int         int32_t;
    

    Beyond that, I couldn't find how to not use a certain module, for example neopixel, which made me modify the c_types.h

    I'm also uploading my binaries if anyone wants to test them

    Any help on this matter is greatly appreciated.

    Thanks!

Actions