esp8266 Ubuntu SDK Development Environment Setup

Source: Internet
Author: User
Tags true true using git

Recently in the WiFi module, found that the Web SDK development of little information, found a set of video tutorials, but the presenter of the lecture style is unbearable. Students interested in SDK-based development can build a development environment through eclipes on Ubuntu systems through this post.

The process can be divided into two steps:
1. Download and compile the SDK
2, Configuration Eclipes

First, download and compile the SDK

The esp8266 SDK has two types, esp8266_rtos_sdk and ESP8266_NONOS_SDK, the difference being that RTOS_SDK is based on NONOS_SDK and has an operating system called an RTOS, while Nonos_ The SDK is the same as the name without operating system (none OS). Because RTOS_SDK is added on the nonos_sdk above the operating system, so nonos_sdk inside the interface inside the RTOS_SDK can be used.
See:Q:What is the difference between RTOS and the Non-os SDK?

Here we use NONOS_SDK,:esp-open-sdk

The NONOS_SDK compiler and the burn tool are integrated inside, and the compiler can be used to compile the project in ESP_RTOS_SDK.

We operate directly on the command line:

    # Install some dependent tools    $ sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf         Flex Bison texinfo gawk N Curses-dev libexpat-dev python-dev python python-serial         sed git unzip bash help2man wget    bzip2 # if Ubuntu version above 14.04 may also need this tool    $ sudo apt-get install libtool-bin    # using Git to clone the project to the local, this assumes the project is cloned to the/home/mmmmar/ ESP-OPEN-SDK    $ git clone--recursive https://github.com/pfalcon/esp-open-sdk.git    #进入项目文件夹    $ cd/home/ MMMMAR/ESP-OPEN-SDK    #编译    $ make Standalone=y

Note: In the process of compiling the SDK, we need to download some dependent libraries and compile them, and the download process is easy to fail.
If compilation fails, you can view Esp-open-sdk/crosstool-ng/build.log to see the crash information, which is generally a download failure.

Successful compilation will appear in the Esp-open-sdk folder xtensa-lx106-elf esptool esp8266_nonos_sdk three folders, respectively, is the compiler, the burning tool, NONOS_SDK the latest version.
You need to add the compiler path to the system path and execute:

    # This command only works on the current console    export path=/home/mmmmar/esp-open-sdk/xtensa-lx106-elf/bin: $PATH

You can then compile the example project in esp-open-sdk/esp8266_nonos_sdk/examples .
Be aware that to copy the esp8266_nonos_sdk folder to the outside of the esp-open-sdk folder, if we want to compile the at item in the examples folder, We need to copy the at folder to the esp8266_nonos_sdk directory, or the compilation will fail.
After the copy is complete, the following paths are:

    /home/mmmmar    ├──esp8266_nonos_sdk    │   ├──at    │   ├──examples    └──esp-open-sdk


After copying it, you can compile the at (our initial at command is the project, but we can only add new at commands) to the project.
Execute the gen_misc.shunder the At folder, where you need to enter some parameters.
For those parameters I am not particularly clear, my esp-01 (black) selected is:
Boot Version = None
SPI size and map = 1024KB (512kb+ 512KB)

The rest defaults. The black version of the esp-01 has 1MB of storage space, and the blue version is only 512KB and cannot use the latest version of the at firmware.

The following output is available after the compilation is complete:

    !!!    No boot needed.    Generate Eagle.flash.bin and Eagle.irom0text.bin successully in folder bin.    Eagle.flash.bin-------->0x00000    eagle.irom0text.bin---->0x10000    !!!

You can now burn the firmware generated in the esp8266_nonos_sdk/bin directory to the Development Board, and you can use esp-open-sdk/esptool/esptool.py.
But I use a button on the Windows Burning tool, you can search Baidu a bit.

In the configuration column, you need to fill in the respective binary files of the burning address, here is attached to the official document description:

See:2a-esp8266-sdk_getting_started_guide_en.pdf
At this point, the entire Compilation tool burn tool can be used, followed by how to configure the Eclipes

Second, the configuration eclipes
In fact, the direct use of vim+ycm, but the integration of the development environment is a bit more comfortable. The eclipes used here is ECLIPSE-CPP-NEON-2-LINUX-GTK.

1. File-new-makefile Project from Existing Code
2, enter the project name, path, language type C, compiler select None

3. Add header File search path, project-properties-c/c++ general-preprocessor Include Paths,macros etc

Add two include folder paths in the diagram
Note When adding esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/include , tick [Treat as build-in] [Contains system Headers]

4, add environment variables, project-properties-c/c++ build-environment, click Add

5, create the compilation target, Project-build targets-create

Where the command filled in with Build commands equals us to execute gen_misc.sh and input parameters, see!!! In the example Project Readme!!!. TXT file

6, compile the target, Project-build targets-build

Above, completed the Eclipes all the configuration, a picture of the drawings

Additional:

/****************************************    esp8266_nonos_sdk/include/c_types.h    #define True True    # Define FALSE flase    These two macro definitions in Eclipes code hints will be an error, you can modify    ****************************************/    #define TRUE   1    #define FALSE  0

Reference:
Official documents
Free and open (as much-possible) integrated SDK for esp8266/esp8285 chips
Latest ESP8266 SDK based on FreeRTOS

esp8266 Ubuntu SDK Development Environment Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.