ESP-micropython 建立IDF环境,编译自己的固件

Posted pocean2012

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ESP-micropython 建立IDF环境,编译自己的固件相关的知识,希望对你有一定的参考价值。

注意,以下操作都在ubuntu环境下运行。 

1. 下载配置ESP32-IDF编译环境

To install the ESP-IDF the full instructions can be found at the Espressif Getting Started guide.

下载开发环境

 git clone -b v4.0.2 --recursive https://github.com/espressif/esp-idf.git

  或者是在已有环境下更新到micropython兼容的版本,并更新子模块

$ cd esp-idf
$ git checkout v4.2
$ git submodule update --init --recursive

运行配置安装脚本

$ cd esp-idf
$ ./install.sh       # (or install.bat on Windows)
$ source export.sh   # (or export.bat on Windows)

新版本的esp32注意

Note: If you are building MicroPython for the ESP32-S2, ESP32-C3 or ESP32-S3, please ensure you are using the following required IDF versions:

  • ESP32-S3 currently requires latest master, but eventually v4.4 or later when it's available.
  • ESP32-S2 and ESP32-C3 require v4.3.1 or later.

 2. 下载编译micropython固件

The MicroPython cross-compiler must be built to pre-compile some of the built-in scripts to bytecode. This can be done by (from the root of this repository):

$ make -C mpy-cross

Then to build MicroPython for the ESP32 run:

$ cd ports/esp32
$ make submodules
$ make

This will produce a combined firmware.bin image in the build-GENERIC/ subdirectory (this firmware image is made up of: bootloader.bin, partitions.bin and micropython.bin).

然后调用烧录bin文件,好像有点问题,可能是板子?

要编译spisram版本,编译指令指定板子类型

make BOARD=GENERIC_SPIRAM

编译好的文件用esptool烧录

esptool.py --chip esp32 --port com10 --baud 460800 write_flash -z 0x1000 myfirmware.bin

以上是关于ESP-micropython 建立IDF环境,编译自己的固件的主要内容,如果未能解决你的问题,请参考以下文章

ESP32c3开发环境搭建 IDF V4.4离线版安装使用

ESP32c3开发环境搭建 IDF V4.4离线版安装使用

ESP-C3入门1. VSCode+IDF 开发环境

ESP-C3入门1. VSCode+IDF 开发环境

ESP-IDF环境构建

ESP32 ESP-IDF开发环境搭建,Windows下基于ESP-IDF | Cmake | VScode插件的 ESP32 开发环境搭建