ESP8266_RTOS_SDK-2.0.0 compilation environment construction and program burning step guide, and print out HelloWorld test

Table of contents

1. Hardware composition

2. Build the compilation environment

1. Compilation environment selection:

2. Environment construction steps

 3. Modify the file configuration path

1. Add libhal function library [two days of stepping on the pit]

 2. Confirm and modify the ESP8266_RTOS_SDK/Makefile file path

4. Create a HelloWorld test routine

1. Create a new HelloWorld routine file

2. Modify the Makefile compilation path in the HelloWorld routine file

3. Modify the SDK and BIN path of the HelloWorld routine file

4. Compile the HelloWorld routine file

5. HelloWorld routine file burning verification

1. Burn the HelloWorld routine file 


1. Hardware composition

The NodeMCU based on Anxinke's [ESP-12Ewifi module] is shown in the figure below:

2. Build the compilation environment

1. Compilation environment selection:

        The latest version of Vmware virtual machine + the latest version of Linux operating system + cross-compilation tool chain xtensa-lx106-elf version 5.2.0

2. Environment construction steps

        Refer to my previous article, just some places need to be modified [the current 2.0.0 version is relatively old], the link is as follows: (​​​​​​56 messages) Espressif esp8266 environment construction guide (VMware 16.4 Ubuntu 20.04) _The blog that horses can run all the time-CSDN blog_esp8266 running linux

The basic environment configuration is as follows:

 

 3. Modify the file configuration path

1. Add libhal function library [two days of stepping on the pit]

        After configuring and compiling, it always prompts that the lhal.a file cannot be found. At first, I always thought it was a problem with the toolchain version. After swimming in Du Niang for two days, I finally found the reason [a function library is missing] (solved)

①Download the function library libhal missing in ESP8266_RTOS_SDK 2.0.0, the download link is as follows:

https://github.com/esp8266/esp8266-wiki/blob/master/libs/libhal.a

②Copy the libhal.a file to the lib directory of ESP8266_RTOS_SDK 2.0.0        

 2. Confirm and modify the ESP8266_RTOS_SDK/Makefile file path

4. Create a HelloWorld test routine

1. Create a new HelloWorld routine file

//SDK文件下新建HelloWorld文件
root@ddd:/mnt/hgfs/ESP12/ESP8266_RTOS_SDK# mkdir HelloWorld

//将examples文件下smart_config里的文件复制到HelloWorld中
root@ddd:/mnt/hgfs/ESP12/ESP8266_RTOS_SDK/examples# cp -rf smart_config/* /ESP8266_RTOS_SDK/HelloWorld

2. Modify the Makefile compilation path in the HelloWorld routine file

//打开HelloWorld文件内的Makefile文件
root@ddd-virtual:/mnt/hgfs/ESP12/ESP8266_RTOS_SDK/HelloWorld# vim Makefile

添加代码如下:
parent_dir:=$(abspath $(shell pwd)/$(lastword $(MAKEFILE_LIST)))
parent_dir:=$(shell dirname $(parent_dir))
parent_dir:=$(shell dirname $(parent_dir))

SDK_PATH= $(parent_dir)
BIN_PATH=$(SDK_PATH)/bin

3. Modify the SDK and BIN path of the HelloWorld routine file

//修改SDK_PATH为当前SDK路径(绝对)     修改BIN_PATH为当前BIN路径(绝对)
root@ddd:ESP8266_RTOS_SDK/HelloWorld# vim gen_misc.sh

添加代码如下:
export SDK_PATH=$/mnt/hgfs/ESP12/ESP8266_RTOS_SDK
export BIN_PATH=$/mnt/hgfs/ESP12/ESP8266_RTOS_SDK/bin

4. Compile the HelloWorld routine file

//运行gen_misc脚本进行编译
root@ddd-virtual:/mnt/hgfs/ESP8266_RTOS_SDK/HelloWorld# ./gen_misc.sh

Y
1
2
3
4

5. HelloWorld routine file burning verification

1. Burn the HelloWorld routine file 

Guess you like

Origin blog.csdn.net/m0_56769186/article/details/124959603