编译ESP8266官方的SDK Demo,下载至ESP-12F模组

一、前言

在参考链接 ESP8266 搭建 开发环境 完成开发环境的搭建后,本文章讲述如何编译ESP8266官方的SDK(ESP8266_RTOS_SDK) Demo,并烧录进ESP-12F模组。

开发环境:

  • Linux下查看PATH环境变量:可以看到环境变量中已经包含/home/lsq/xtensa-lx106-elf/bin
lsq@ubuntu:~$ echo $PATH
/home/lsq/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/lsq/esp32c3/esp-idf:/home/lsq/xtensa-lx106-elf/bin:/home/lsq/xtensa-lx106-elf/bin:/home/lsq/xtensa-lx106-elf/bin:/home/lsq/xtensa-lx106-elf/bin
  • 测试工具链环境
lsq@ubuntu:~$ xtensa-lx106-elf-gcc -v
Using built-in specs.
COLLECT_GCC=xtensa-lx106-elf-gcc
COLLECT_LTO_WRAPPER=/home/lsq/xtensa-lx106-elf/bin/../libexec/gcc/xtensa-lx106-elf/8.4.0/lto-wrapper
Target: xtensa-lx106-elf
Configured with: /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=xtensa-lx106-elf --prefix=/builds/idf/crosstool-NG/builds/xtensa-lx106-elf --with-local-prefix=/builds/idf/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf --with-headers=/builds/idf/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/include --with-newlib --enable-threads=no --disable-shared --with-pkgversion='crosstool-NG esp-2020r3-49-gd5524c1' --disable-__cxa_atexit --enable-cxx-flags=-ffunction-sections --disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp --disable-libquadmath --disable-libquadmath-support --with-gmp=/builds/idf/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpfr=/builds/idf/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-mpc=/builds/idf/crosstool-NG/.build/xtensa-lx106-elf/buildtools --with-isl=/builds/idf/crosstool-NG/.build/xtensa-lx106-elf/buildtools --enable-lto --enable-target-optspace --without-long-double-128 --disable-nls --enable-multiarch --enable-languages=c,c++ --disable-libstdcxx-verbose --enable-threads=posix --enable-libstdcxx-time=yes
Thread model: posix
gcc version 8.4.0 (crosstool-NG esp-2020r3-49-gd5524c1) 

二、拷贝Demo到共享文件夹下

  1. SDK Demo 路径:
/home/lsq/ESP8266_RTOS_SDK/examples/get-started/hello_world
  1. 拷贝到共享文件夹下
cp -r hello_world/ /mnt/hgfs/share/esp8266_project

三、编译Demo

  1. 切换目录
/mnt/hgfs/share/esp8266_project/hello_world
  1. 配置代码工程
lsq@ubuntu:/mnt/hgfs/share/esp8266_project/hello_world$ make menuconfig
Toolchain path: /home/lsq/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc
Toolchain version: esp-2020r3-49-gd5524c1
Compiler version: 8.4.0
Python requirements from /home/lsq/ESP8266_RTOS_SDK/requirements.txt are satisfied.
MENUCONFIG


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

Project is not inside a git repository, or git repository has no commits
will not use 'git describe' to determine PROJECT_VER.
App "hello-world" version: 1

在这里插入图片描述
Serial flasher config -> Flash size (2 MB) -> 修改成4MB -> Save

  1. 编译Demo
lsq@ubuntu:/mnt/hgfs/share/esp8266_project/hello_world$ make all -j4
Toolchain path: /home/lsq/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc
Toolchain version: esp-2020r3-49-gd5524c1
Compiler version: 8.4.0
Python requirements from /home/lsq/ESP8266_RTOS_SDK/requirements.txt are satisfied.
GENCONFIG
Project is not inside a git repository, or git repository has no commits
will not use 'git describe' to determine PROJECT_VER.
App "hello-world" version: 1
Building partitions from /home/lsq/ESP8266_RTOS_SDK/components/partition_table/partitions_singleapp.csv...
Python requirements from /home/lsq/ESP8266_RTOS_SDK/requirements.txt are satisfied.
make[1]: Warning: File '/mnt/hgfs/share/esp8266_project/hello_world/build/bootloader/esp8266/component_project_vars.mk' has modification time 0.028 s in the future
Project is not inside a git repository, or git repository has no commits
will not use 'git describe' to determine PROJECT_VER.
LD build/bootloader/bootloader.elf
App "hello-world" version: 1
CC build/app_update/esp_app_desc.o
AR build/esp8266/libesp8266.a
AR build/app_update/libapp_update.a
esptool.py v2.4.0
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
Generating esp8266.project.ld
LD build/hello-world.elf
esptool.py v2.4.0
To flash all build output, run 'make flash' or:
python /home/lsq/ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x0 /mnt/hgfs/share/esp8266_project/hello_world/build/bootloader/bootloader.bin 0x10000 /mnt/hgfs/share/esp8266_project/hello_world/build/hello-world.bin 0x8000 /mnt/hgfs/share/esp8266_project/hello_world/build/partitions_singleapp.bin

四、下载到ESP-12F

1. 烧录软件 flash_download_tool_3.9.2.exe

选择烧录文件以及Flash烧录地址
请添加图片描述

2. 烧录

ESP-12F进入烧录模式后,选择对应的COM口后,点击【START】。
在这里插入图片描述

五、运行

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值