ESP8266 Introduction to the Alios-things Development Guide (i) development environment and HelloWorld firmware

Source: Internet
Author: User
Tags windows download git clone docker run

One, the development environment constructs

At present, most developers in China are using winxp/win7/windows xx to do MCU development. Accustomed to the development of Windows environment friends, if once a contact to the MCU need to be a Linux environment for the development of compiling, the first response is, of necessity, "concubine can not do." For example, our protagonist ESP8266 this chip, the original supply is based on Linux development (the early Le Xin also provides a VM development environment mirroring). Therefore, in order to develop this chip, we can not avoid dealing with Linux.

Install virtual machines on Windows, and then chip development, which is currently a more common way. But if you are developing a Linux development environment based on the Vistualstudiocode plug-in Alios-studio, I would recommend this way: using Docker

So we are now starting to build a Docker-based ESP8266 alios-things development environment under Windows.

system Environment : WINDOWS10

Application Environment : Docker installed (the way to install Docker under Windows can check on the Internet)

Visualstudiocode (hereinafter referred to as Vscode)

1, Vscode install Alios-studio plug-in, operation as shown in Figure 1

Figure 1

Note: Remember to install the C + + plug-in as well, Alios-studio to its dependence.

2, installation of alios-things Docker mirror

Method A:

The ability of students can refer to my github given in the Dockerfile file (of course, can not refer to), build a Docker mirror

Https://github.com/lanjackg2003/alios-things-docker.git

Method B:

Get my compiled mirrors directly from the Dockerhub server by pull way, as shown in Figure 2

Https://hub.docker.com/r/jacklan/alios-things-docker

Figure 2

Open the command line and execute the following command

Docker Pulljacklan/alios-things-docker

At this point, windows to support the Docker way of the compilation environment has been built.


second, cloning alios-things warehouse code

can be downloaded by installing the Git tool and using the GIT clone directive

git clone https://github.com/alibaba/AliOS-Things

As shown in Figure 3:

Figure 3

Of course, you can also use the tools you know to download alios-things code from GitHub.

Iii. compiling Esp8266 HelloWorld firmware

1, with Vscode open alios-things code Warehouse, as shown in Figure 4

Figure 4

2, modify the Alios-things HELLOWORLD.C code

As shown in Figure 5, add a sentence code:

printf ("Esp8266hellowrold example by jack!\r\n");

Figure 5

3, through the shortcut key ctrl+shift+ ' three buttons, opens the terminal


Figure 6

As we can see, the PowerShell path is already the Alios-things code warehouse directory, so we're going to mount this directory in the working directory of Docker's container.

Execute cmd switch to command line in PowerShell

Docker run-v%cd%:/home/alios/alios-things--name alios-things-build-it--rm

Tip: If you want to PowerShell the Docker container directly, you can turn the command line script to the City bat file and run it.


Figure 7

I will also put this win_build.bat into the GitHub in the future.


4, Next, use Alios-things Cube tool to compile just our HelloWorld code

Execute the following command in the Docker container

AOS make helloworld@esp8266


Figure 8


Figure 9

Tips:




 

Iv. Burn the firmware to the ESP8266 Development Board

to Le Xin website download burning tool: Flash download tool (ESP8266 & ESP32)

Https://www.espressif.com/zh-hans/support/download/other-tools

Using the Le Xin Windows download tool, download at the following address:

Filename

Burn Address

Boot_v1.7_921600.bin

0x0

Esp_init_data_default.bin

0x3fc000

Blank.bin

0x3fe000

Helloworld@esp8266-0x1000.bin

0x1000

"Boot_v1.7_921600.bin" "Esp_init_data_default.bin" "Blank.bin" these three files can be

"xxx\alios-things\platform\mcu\esp8266\bsp" directory found.

Open the burning writing tool, according to the address of the table to fill out, the ESP8266 board for burning write can.

Currently I am using NODEMCU this development board, so my burning configuration parameters are as follows


Figure 10

v. Results of verification


Figure 11

From the serial printing can see "esp8266 hellowrold example by jack!" output information.

Attention:

Serial parameters:

baud rate : 921600

Stop bit : 1

Data bits : 8

parity : None







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.