• The Anniversary Update (64 bit only) has a developer mode add on that allows Ubuntu code to run in a windows subsystem.

    This means Espruino can be compiled without running in a VM!

    The update has not been rolled out - here are the instructions to update manually...

    http://www.howtogeek.com/248177/whats-ne­w-in-windows-10s-anniversary-update/

    Then turn on developer mode - reboot and add the Linux on windows system:
    http://www.howtogeek.com/249966/how-to-i­nstall-and-use-the-linux-bash-shell-on-w­indows-10/

    On my system - in the cmd prompt, I had this error message:
    Unsupported console settings. In order to use this feature the legacy console must be disabled.

    https://github.com/Microsoft/BashOnWindo­ws/issues/319
    Open cmd.exe
    Right click title bar -> Properties -> Uncheck Use legacy console
    Click OK

    Then on first run of bash.exe, the sub system is installed.

    Then:

    cd /mnt/c
    mkdir ubuntu
    cd ubuntu
    sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
    sudo apt-get update
    sudo apt-get install gcc-arm-none-eabi git build-essential
    git clone https://github.com/espruino/Espruino.git­
    cd Espruino
    make
    

    Then:

    root@OFFICE-PC:/mnt/c/ubuntu/Espruino# ./espruino
    Interactive mode.
    Size of JsVar is now 32 bytes
    Size of JsVarRef is now 4 bytes
    Added SIGINT hook
    Added SIGHUP hook
    Added SIGTERM hook
    
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v86.113 Copyright 2016 G.Williams
    
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    
    >console.log('hi from windows 10!');
    hi from windows 10!
    =undefined
    

    Yay!

    Will try a cross compile soon!

  • make clean
    ESPRUINO_1V3=1 RELEASE=1 make
    
    LD espruino_1v86.113_espruino_1r3.elf
    GEN espruino_1v86.113_espruino_1r3.lst
    GEN espruino_1v86.113_espruino_1r3.bin
    bash scripts/check_size.sh espruino_1v86.113_espruino_1r3.bin
    PASS - size of 229496 is under 231424 bytes
    GEN espruino_1v86.113_espruino_1r3.hex
    

    Seems to work!

  • Ok. Got the Esp8266 build working on windows 10!

    You need to build the SDK as a standard user. This locked up the first time, however worked after a reboot.

    To build the SDK there needs:

    cd /mnt/c/ubuntu/
    git clone https://github.com/pfalcon/esp-open-sdk
    sudo apt-get install autotools-dev autoconf
    sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf     flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial     sed git unzip bash help2man wget bzip2
    ln -s /usr/bin/aclocal-1.14 /usr/bin/aclocal-1.15
    ln -s /usr/bin/automake-1.14  /usr/bin/automake-1.15
    cd esp-open-sdk/
    make STANDALONE=n
    

    this takes a while to compile!

    then:

    wget 'http://bbs.espressif.com/download/file.­php?id=1021&sid=6e2aef8d5d8e700aca4a7b44­4c985e10' -O liblwip_536_for_ESP8266_NONOS_SDK_V1.5.0­.zip
    unzip liblwip_536_for_ESP8266_NONOS_SDK_V1.5.0­.zip
    cp liblwip_536.a ../esp-open-sdk/ESP8266_NONOS_SDK_V1.5.4­_16_05_20/lib
    
    cd ../Espruino
    
    In the Makefile this needs to be updated to: 
    boot_v1.4(b1).bin -> boot_v1.5.bin
    
    cat ./build-esp-4mb.sh
    
    
    #! /bin/bash
    export ESP8266_BOARD=1
    export FLASH_4MB=1
    export ESP8266_SDK_ROOT=/mnt/c/ubuntu/esp-open-­sdk/sdk
    export PATH=$PATH:/mnt/c/ubuntu/esp-open-sdk/xt­ensa-lx106-elf/bin/
    export ESPHOSTNAME=espruino:88
    make $*
    
    chmod +x ./build-esp-4mb.sh
    ./build-esp-4mb.sh
    

    flash over the air from the bash shell:

    ./build-esp-4mb.sh wiflash

    and then we have:

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v86.113 Copyright 2016 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 0xe0 chip 0x4016
    > 
    
  • Does this update just let you use Bash inside the command prompt? If so, I think you could also install Git and select "Use Git and optional Unix tools from the windows command prompt" during the installation which will allow them to run this bash script just like in Linux.

  • No it is much more than this. It is running Ubuntu, so you can apt-get packages. What I have shown above, installs perl, python, gcc and runs them natively. This is incredibly powerful!

  • WilberFORCE... forcefully done! ...notches up from powerful! - Nomen est omen...

  • @Wilberforce I don't think the 2nd "install" in sudo apt-get install gcc-arm-none-eabi git install build-essential should be there should it?

  • @Ducky

    Correct - I've edited the post.

  • This sounds great - thanks for posting up!

    It'll definitely make the whole compile a lot easier for those not using Linux systems.

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

Windows 10 Anniversary Update - compile Espruino from a bash/Ubuntu console natively!

Posted by Avatar for Wilberforce @Wilberforce

Actions