ESP-IDF开发

5年前买过一块ESP32的板子,当时费了半天劲用windows的msys搞出C语言编译环境,但后来也没有继续使用,现在又捡起来这块板子,前段时间在Win7下建立了Thonny的开发环境用python可以在ESP32板子上编写程序,但后来测试发现代码运行速度慢的不能忍受,micropython的GPIO函数执行速度竟然>1ms,本来还想用python读取OV2640的图片,这个IO速度还是不用想了。
前天开始搞ESP的C语言环境,开始想在Win7下建立ESP-IDF环境,浪费了1天时间发现无解,因为IDF需要python 3.11,而Win7最高支持python 3.10,还是在Win10建立了开发环境,过程很顺利,参考以下网址
https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/establish-serial-connection.html

这个是下载ESP-IDF的网址
https://dl.espressif.cn/dl/esp-idf/?idf=4.4

在这里插入图片描述
这个安装包在Win10下会把合适版本的Git/python都自动安装,硬盘需要大约不到5GB空间,安装过程中会有写文件报错,直接忽略跳过,最后能不能用估计得看运气了。

安装之后每次启动这个cmd窗口来编译烧写,这个窗口会自动配置好环境变量
在这里插入图片描述
安装后例子代码在如下目录
X:\Espressif\frameworks\esp-idf-v5.1.2\examples
自行复制到其它目录修改测试,一般是切换到main目录的上级目录,
第一次需要执行以下命令设置芯片型号
idf.py set-target esp32
idf.py menuconfig
个人觉得menuconfig 不需要,set-target后的esp32需要看你的板子的芯片型号,也可能是esp32-c2或者esp32-s3

之后执行idf.py build即可编译,第一次编译速度慢,大约3分钟,之后就会很快。idf.py fullclean可以彻底清理。
编译如果没有

  • 28
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
esp32-freertos-sdk 工具包 See the Getting Started guide links above for a detailed setup guide. This is a quick reference for common commands when working with ESP-IDF projects: Setup Build Environment (See Getting Started guide for a full list of required steps with details.) Install host build dependencies mentioned in Getting Started guide. Add tools/ directory to the PATH Run python -m pip install -r requirements.txt to install Python dependencies Configuring the Project idf.py menuconfig Opens a text-based configuration menu for the project. Use up & down arrow keys to navigate the menu. Use Enter key to go into a submenu, Escape key to go out or to exit. Type ? to see a help screen. Enter key exits the help screen. Use Space key, or Y and N keys to enable (Yes) and disable (No) configuration items with checkboxes "[*]" Pressing ? while highlighting a configuration item displays help about that item. Type / to search the configuration items. Once done configuring, press Escape multiple times to exit and say "Yes" to save the new configuration when prompted. Compiling the Project idf.py build ... will compile app, bootloader and generate a partition table based on the config. Flashing the Project When the build finishes, it will print a command line to use esptool.py to flash the chip. However you can also do this automatically by running: idf.py -p PORT flash Replace PORT with the name of your serial port (like COM3 on Windows, /dev/ttyUSB0 on Linux, or /dev/cu.usbserial-X on MacOS. If the -p option is left out, idf.py flash will try to flash the first available serial port. This will flash the entire project (app, bootloader and partition table) to a new chip. The settings for serial port flashing can be configured with idf.py menuconfig. You don't need to run idf.py build before running idf.py flash, idf.py flash will automatically rebuild anything which needs it. Viewing Serial Output The idf.py monitor target uses the idf_monitor tool to display se
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值