• You need to compile the espruino firmware locally on your own PC. I did my compilation on:

    $ uname -a
    Linux kaki5 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

    One this we need to change in user_main.c under Espruino/targets/esp8266
    $ diff user_main.c user_main.c-ORIG
    353,382d352
    < void ICACHE_FLASH_ATTR user_pre_init(void)
    < {
    < bool rc = false;
    < static const partition_item_t part_table[] =
    < {
    < {SYSTEM_PARTITION_RF_CAL,
    < 0x3fb000,
    < 0x1000},
    < {SYSTEM_PARTITION_PHY_DATA,
    < 0x3fc000,
    < 0x1000},
    < {SYSTEM_PARTITION_SYSTEM_PARAMETER,
    < 0x3fd000,
    < 0x3000},
    < };
    <
    < // This isn't an ideal approach but there's not much point moving on unless
    < // or until this has succeeded cos otherwise the SDK will just barf and
    < // refuse to call user_init()
    < while (!rc)
    < {
    < rc = system_partition_table_regist(part_table­,
    < sizeof(part_table)/sizeof(part_table[0])­,
    < 4);
    < }
    <
    < return;
    < }
    <
    <
    388d357
    < user_pre_init();

    The firmware would not compile without the user_pre_init(). Insert this block of code

    void ICACHE_FLASH_ATTR user_pre_init(void)
    {
    bool rc = false;
    static const partition_item_t part_table[] =
    {

    {SYSTEM_PARTITION_RF_CAL,
     0x3fb000,
     0x1000},
    {SYSTEM_PARTITION_PHY_DATA,
     0x3fc000,
     0x1000},
    {SYSTEM_PARTITION_SYSTEM_PARAMETER,
     0x3fd000,
     0x3000},
    

    };

    // This isn't an ideal approach but there's not much point moving on unless
    // or until this has succeeded cos otherwise the SDK will just barf and
    // refuse to call user_init()
    while (!rc)
    {

    rc = system_partition_table_regist(part_table­,
                                       sizeof(part_table)/sizeof(part_table[0])­,
                                       4);
    

    }

    return;
    }

    Above the void user_init() function. Insert user_pre_init() as the first statement in the user_init() function

    void user_init() {

      user_pre_init();
      system_timer_reinit(); // use microsecond os_timer_*
      ....
    

    I do not use the Espruino/scripts/provision.sh to build, but my own simple script:

    #!/usr/bin/sh
    echo "---------------------------------------­-------------------"
    echo "Building Espruino for ESP8266 4MB Flash"
    export ESP8266_SDK_ROOT=/home/sharil/MJ/ESP8266­_NONOS_SDK
    export PATH=/usr/local/sbin:/usr/local/bin:/usr­/sbin:/usr/bin:/sbin:pwd/xtensa-lx106-elf/bin/
    echo GCC is $(which xtensa-lx106-elf-gcc)
    rm espruinoesp8266
    make clean

    make V=1 RELEASE=1 BOARD=ESP8266_4MB

    make V=1 RELEASE=1 BOARD=ESP8266_ME
    echo "ESP8266 (4MB Flash) build done"
    echo "---------------------------------------­-------------------"

    Note that used ESP8266_ME board which is a copy of ESP8266_4MB.py with 'FILESYSTEM', 'FLASHFS' included in the libraries.

    Please give it a try.

About

Avatar for stumin @stumin started