Git Product home page Git Product logo

esp8266_rtos_toolchain_setup_wsl's Introduction

ESP8266 RTOS SDK Toolchain Setup

Toolchain for development of RTOS applications for ESP8266 using WSL 1 (Windows Subsystem for Linux) and programming using USB-UART converter. Using WSL makes it portable across multiple Windows devices.

Why WSL 1?

  • WSL 1 directly maps connected COMX devices to /dev/ttySX files
  • WSL 2 works using usbipd, but:
    • After disconnecting the device you have to attach it manually again
    • Interacting with files that are being stored on Windows filesystem is slow (stackoverflow)
  • Oracle VirtualBox provide COM ports mapping for virtual machines, but:
    • After testing it using AntiX 23.1 Core virtual machine, there is a significant delay that made it impossible to program an ESP
    • While receiving longer messages by UART (using monitor tool), part of the message is being lost
  • Docker cannot be used on Windows, because as of today (15.07.2024) it doesn't support mapping USB devices to containers

1. WSL Setup

1.1 Create a folder to store new WSL machine somewhere.

For example Documents/WSL_Distros/

You can use this folder or create another one to manage multiple toolchain WSL's.

1.2 Open CMD in newly created folder

You can open command line in given folder by typing cmd in file explorer url tab. CMD tip

1.3 Install Debian WSL image

It can be achieved by using command below or by installing it using Windows Store.

wsl --install -d Debian

Go through installation steps, newly created account doesn't matter as is the next step the machine is going to be exported and it will lose all users accounts.

1.4 Export Debian image

Export Debian image to debianExport file.

wsl --export Debian debianExport

Import previously exported image here to machine named Debian_ESP8266 using WSL 1.

wsl --import Debian_ESP8266 . debianExport --version 1

(Optional) You can delete debianExport file.

del debianExport

2. Debian setup

Espressif provides Get Started guide where every configuration step is done manually, but there are installation scripts inside of ESP8266 RTOS SDK repository which are going to be used in this guide.

2.1 Login to WSL and get repository updates

Open WSL in current folder.

wsl -d Debian_ESP8266

Get updates and install them.

sudo apt-get update
sudo apt-get upgrade

2.2 Download packages and SDK

Slightly modified prompt from here.

sudo apt-get install gcc git wget make libncurses-dev flex bison gperf python3 python3-pip virtualenv python-is-python3

Now you can download ESP8266 RTOS SDK.

git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git
cd ESP8266_RTOS_SDK

2.3 Execute installation script

sudo ./install.sh

And then export environmental variables using export.sh script. It has to be sourced.

source export.sh

They will persist until you close current login session.

2.4 Modify .bashrc

Modify .bashrc file to execute export script everytime you login into WSL.

sudo nano ~/.bashrc

Add following lines to the end of the file. IDF_PATH is a path to previously cloned repository on your machine.

export IDF_PATH="$HOME/ESP8266_RTOS_SDK"
source $IDF_PATH/export.sh > /dev/null

Source command output is redirected to /dev/null as export.sh would print some information everytime you login to the system.

All done!

esp8266_rtos_toolchain_setup_wsl's People

Contributors

olewojt avatar

Stargazers

Michał Komsa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.