栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ESP32 WIN10开发环境

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ESP32 WIN10开发环境

隔一段时间再想玩一玩ESP32,发现又忘记的一干二净,还是写一下比较好。

下载ESP32 SDK

        github上面的最新工程https://github.com/espressif/esp-idf

开发环境配置

        使用官方https://dl.espressif.com/dl/esp-idf-tools-setup-2.3.exe设置基础环境

安装时会提示是否使用现有的esp-idf,如果没下载可通过提示下载

安装好环境后会弹出控制台

尝试新的跨平台 PowerShell https://aka.ms/pscore6

Using Python in F:/ESP32/ESP-IDF-Tool/.espressif/python_env/idf4.0_py3.8_env/scripts
Python 3.8.7
Using Git in F:/ESP32/ESP-IDF-Tool/.espressif/tools/idf-git/2.30.1/cmd
git version 2.30.1.windows.1
IDF version does not include export.ps1. Using the fallback version.
Setting IDF_PATH: F:ESP32esp-idf-v4.0
Adding ESP-IDF tools to PATH...
F:ESP32ESP-IDF-Tool.espressiftoolsxtensa-esp32-elfesp-2019r2-8.2.0xtensa-esp32-elfbin
F:ESP32ESP-IDF-Tool.espressiftoolsesp32ulp-elf2.28.51.20170517esp32ulp-elf-binutilsbin
F:ESP32ESP-IDF-Tool.espressiftoolscmake3.13.4bin
F:ESP32ESP-IDF-Tool.espressiftoolsopenocd-esp32v0.10.0-esp32-20190313openocd-esp32bin
F:ESP32ESP-IDF-Tool.espressiftoolsmconfv4.6.0.0-idf-20190628
F:ESP32ESP-IDF-Tool.espressiftoolsninja1.9.0
F:ESP32ESP-IDF-Tool.espressiftoolsidf-exe1.0.1
F:ESP32ESP-IDF-Tool.espressiftoolsccache3.7
F:ESP32ESP-IDF-Tool.espressifpython_envidf4.0_py3.8_envscripts
F:ESP32esp-idf-v4.0tools
Checking if Python packages are up to date...
Python requirements from F:ESP32esp-idf-v4.0requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
    idf.py build

编译工程

        移动到工程工作路径,执行如下命令执行编译。

         idf.py build 

编译结束:

[62/62] Generating binary image from built executable
esptool.py v2.8
Generated F:/ESP32/esp-idf-v4.0/examples/get-started/hello_world/build/bootloader/bootloader.bin
[820/820] Generating binary image from built executable
esptool.py v2.8
Generated F:/ESP32/esp-idf-v4.0/examples/get-started/hello_world/build/hello-world.bin

Project build complete. To flash, run this command:
F:ESP32ESP-IDF-Tool.espressifpython_envidf4.0_py3.8_envscriptspython.exe ......componentsesptool_pyesptoolesptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 buildbootloaderbootloader.bin 0x8000 buildpartition_tablepartition-table.bin 0x10000 buildhello-world.bin
or run 'idf.py -p (PORT) flash'
 固件下载

 执行如下命令开始下载,执行如下命令,一直按住FLASH按钮,在单击复位按键,进入下载状态后释放按键等待下载结束。COM3为连接的端口。

idf.py -p COM3 flash
or run 'idf.py -p (PORT) flash'

F:ESP32esp-idf-v4.0examplesget-startedhello_world>idf.py -p COM3 flash
Checking Python dependencies...
Python requirements from F:ESP32esp-idf-v4.0requirements.txt are satisfied.
Adding flash's dependency "all" to list of actions
Executing action: all (aliases: build)
Running ninja in directory f:esp32esp-idf-v4.0examplesget-startedhello_worldbuild
Executing "ninja all"...
[1/3] Performing build step for 'bootloader'
ninja: no work to do.
Executing action: flash
Running esptool.py in directory f:esp32esp-idf-v4.0examplesget-startedhello_worldbuild
Executing "F:ESP32ESP-IDF-Tool.espressifpython_envidf4.0_py3.8_envscriptspython.exe F:ESP32esp-idf-v4.0components/esptool_py/esptool/esptool.py -p COM3 -b 460800 --before default_reset --after hard_reset write_flash @flash_project_args"...
esptool.py -p COM3 -b 460800 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 hello-world.bin
esptool.py v2.8
Serial port COM3
Connecting........_____....._
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 24:62:ab:ca:96:a8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 4753.0 kbit/s)...
Hash of data verified.
Compressed 25328 bytes to 14943...
Wrote 25328 bytes (14943 compressed) at 0x00001000 in 0.3 seconds (effective 602.8 kbit/s)...
Hash of data verified.
Compressed 147152 bytes to 76531...
Wrote 147152 bytes (76531 compressed) at 0x00010000 in 1.7 seconds (effective 682.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
Done

F:ESP32esp-idf-v4.0examplesget-startedhello_world>
运行日志

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/326953.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号