一、译文

Adafruit 提供了非常好的固件烧写教程 。下面你会发现两个流行的基本工具esptool和NodeMCU Flasher。
注意:记住ESP8266在烧写新固件前需要放入烧写模块。

1、esptool

一个用于连接Espressif ESP8266 ROM引导装载程序的工具。它的目的是替代XTCOM成为一个简单的、跨平台的开源项目。
源码:https://github.com/themadinventor/esptool 
支持平台有:OS X, Linux, Windows等支持运行Python的平台
运行 esptool.py
运行以下命令来烧写云端构建服务或者Docker镜像中产生的二进制文件。
esptool.py --port <USB-port-with-ESP8266> write_flash -fm <mode> -fs <size> 0x00000 <nodemcu-firmware>.bin

(PS:笔者用的是nodemcu_flasher,所以对esptool的mode和size参数不甚了解)

更详细的说明和其他设置请查看 esptool flash modes documentation

2、NodeMCU Flasher

一个NodeMCU固件烧写工具。我们正在开发下一个版本并且将使用QT框架。它将支持跨平台和开源。

源码:https://github.com/nodemcu/nodemcu-flasher
支持平台:Windows

3、将烧写模块放入设备

为了能够支持ESP8266固件烧写,在设备复位前GPIO0引脚电平必须下拉。相反,正常启动GPIO0引脚电平必须上拉或浮空。

如果你有一个NodeMCU开发套件,那么你不需要做任何事,因为USB连接能够通过中断DTR引脚把GPIO0拉低,并通过中断RTS引脚复位你的开发板。
如果你有一个ESP-01或者不带USB接口的其他设备,你将需要自己拉低GPIO0或按"flash"开关。

4、烧写哪些文件

如果你是通过云端服务或Docker镜像来构建你的固件,或者其他方法产生的整合二进制文件,那么你可以直接把文件烧写到0x00000地址。
否则,如果你是自己通过源码来构建的固件:
  • bin/0x00000.bin 文件烧写到地址 0x00000
  • bin/0x10000.bin 文件烧写到地址 0x10000

(PS:下面的资料用得较少在此不作翻译,有需要的朋友可参阅原文)

【转载请注明出处:http://blog.csdn.net/leytton/article/details/51722700

二、原文

摘自https://nodemcu.readthedocs.io/en/master/en/flash/

Adafruit provides a really nice firmware flashing tutorial. Below you'll find just the basics for the two popular tools esptool and NodeMCU Flasher.

Note:

Keep in mind that the ESP8266 needs to be put into flash modebefore you can flash a new firmware!

esptool

A cute Python utility to communicate with the ROM bootloader in Espressif ESP8266. It is intended to be a simple, platform independent, open source replacement for XTCOM.

Source: https://github.com/themadinventor/esptool

Supported platforms: OS X, Linux, Windows, anything that runs Python

Running esptool.py

Run the following command to flash an aggregated binary as is produced for example by the cloud build service or the Docker image.

esptool.py --port <USB-port-with-ESP8266> write_flash -fm <mode> -fs <size> 0x00000 <nodemcu-firmware>.bin

  • mode is qio for 512 kByte modules and dio for 4 MByte modules (qio might work as well, YMMV).
  • size is given in bits. Specify 4m for 512 kByte and 32m for 4 MByte.

Check the esptool flash modes documentation for details and other options.

NodeMCU Flasher

A firmware Flash tool for NodeMCU...We are working on next version and will use QT framework. It will be cross platform and open-source.

Source: https://github.com/nodemcu/nodemcu-flasher

Supported platforms: Windows

Putting Device Into Flash Mode

To enable ESP8266 firmware flashing GPIO0 pin must be pulled low before the device is reset. Conversely, for a normal boot, GPIO0 must be pulled high or floating.

If you have a NodeMCU dev kit then you don't need to do anything, as the USB connection can pull GPIO0 low by asserting DTR and reset your board by asserting RTS.

If you have an ESP-01 or other device without built-in USB, you will need to enable flashing yourself by pulling GPIO0 low or pressing a "flash" switch.

Which Files To Flash

If you build your firmware with the cloud builder or the Docker image, or any other method that produces a combined binary, then you can flash that file directly to address 0x00000.

Otherwise, if you built your own firmware from source code:

  • bin/0x00000.bin to 0x00000
  • bin/0x10000.bin to 0x10000

Also, in some special circumstances, you may need to flash blank.binor esp_init_data_default.bin to various addresses on the flash (depending on flash size and type), see below.

If upgrading from SPIFFS version 0.3.2 to 0.3.3 or later, or after flashing any new firmware (particularly one with a much different size), you may need to run file.format() to re-format your flash filesystem. You will know if you need to do this if your flash files disappeared, or if they exist but seem empty, or if data cannot be written to new files.

Upgrading from SDK 0.9.x Firmware

If you flash a recent NodeMCU firmware for the first time, it's advisable that you get all accompanying files right. A typical case that often fails is when a module is upgraded from a 0.9.x firmware to the latest version built from the NodeMCU build service. It might look like the brand new firmware is broken, but the reason for the missing Lua prompt is related to the big jump in SDK versions: Espressif changed the esp_init_data_default.bin for their devices along the way with the SDK 1.4.0 release. So things break when a NodeMCU firmware with SDK 1.4.0 or above is flashed to a module which contains old init data from a previous SDK.

Download a recent SDK release, e.g. esp_iot_sdk_v1.4.0_15_09_18.zipor later and extract esp_init_data_default.bin from there. Use this file together with the new firmware during flashing.

esptool

For esptool you specify another file to download at the command line.

esptool.py write_flash <flash options> 0x00000 <nodemcu-firmware>.bin 0x7c000 esp_init_data_default.bin

Note:

The address for esp_init_data_default.bin depends on the size of your module's flash. ESP-01, -03, -07 etc. with 512 kByte flash require 0x7c000. Init data goes to 0x3fc000 on an ESP-12E with 4 MByte flash.

NodeMCU Flasher

The NodeMCU Flasher will download init data using a special path:

INTERNAL://DEFAULT

Replace the provided (old) esp_init_data_default.bin with the one extracted above and use the flasher like you're used to.

References

  • 2A-ESP8266IOT_SDK_User_ManualEN_v1.5.pdf, Chapter 6
  • SPI Flash ROM Layout (without OTA upgrades)

NodeMCU文档中文翻译 4 烧写固件相关推荐

  1. NodeMCU文档中文翻译 5 上传代码

    一.译文 与烧写一样,这里有好几种方法来从计算机上传代码到设备当中. 注意NodeMCU串口接口在启动时使用115200波特率,为了在启动后改变速率,可以使用uart.setup(0,9600,8,0 ...

  2. NodeMCU文档中文翻译 7 DHT温湿度传感器模块

    [转载请注明出处:http://blog.csdn.net/leytton/article/details/76178661] 一.序言 DHT11 温湿度模块传感器 资料下载:http://pan. ...

  3. Pushy入门文档中文翻译

    本文为博主原创,允许转载,但请声明原文地址:http://www.coselding.cn/article/2016/12/01/Pushy入门文档中文翻译/ pushy 这是我自己的翻译版本,原文地 ...

  4. ReactiveX文档中文翻译

    ReactiveX/RxJava文档中文版 项目地址:https://github.com/mcxiaoke/RxDocs,欢迎Star和帮忙改进. 有任何意见或建议,到这里提出 Create New ...

  5. Word文档中文翻译成英文的方法

    将Word文档在线翻译,有的时候我们在一些文档中放一些重要的内容,将这些内容放在文档中,然后通过在浏览器上进行搜索进入到在线翻译中,下面就让小编给大家简单介绍一下. 步骤一:首先我们需要在浏览器上进行 ...

  6. Next.js v4.1.4 文档中文翻译

    最近想稍稍看下 React的 SSR框架 Next.js,因为不想看二手资料, 所以自己跑到 Github上看,Next.js的文档是英文的,看倒是大概也能看得懂, 但有些地方不太确定,而且英文看着毕 ...

  7. RFC文档(中文翻译版本)

    RFC文档官方在线阅读地址:https://tools.ietf.org/rfc/index 以下是部分中文翻译的文档连接 RFC文档目录 RFC1 主机软件 RFC2 主机软件 RFC3 文档规范 ...

  8. axios 文档中文翻译

    axios中文文档(完全中文翻译) 由于使用网上一些翻译文档时发现,内容多被广告隔离成小块.用起来有点不方便同时夹杂部分英文.于是索性把 axios 自己翻译了一遍,贡献给大家便查. 原文档地址-- ...

  9. Surround360 README文档——中文翻译

    该文档位于Surround360项目根目录下 翻译正文: #Surround360 系统 Surround360是用于捕获和渲染3D(立体声)360视频和照片的硬件和软件系统,适合在VR中浏览.我们将 ...

最新文章

  1. C语言生成一个随机的九行九列数独,一个随机生成数独的C++程序
  2. Spark Streaming Backpressure分析
  3. 1.11 实例:字符串替换
  4. Qt (5.10.0)for android
  5. AI当下要破局,不能没有知识图谱!
  6. 【jQuery笔记】新浪微博案例笔记
  7. HTML特殊字符显示
  8. 剑指offer——面试题38:数字在排序数组中出现的次数
  9. python入门之排序,文件操作
  10. MATLAB显示中文乱码问题 MATLAB2016
  11. activiti7(三):Activiti7简介与HelloWorld
  12. T9 PDF如何转存为高清图片
  13. WIN10在服务器上找不到共享打印机,win10搜索不到共享打印机怎么办
  14. java多种货币的相互转换_使用java将不同的国家货币转换为双倍
  15. selenium 中 get_attribute 的几种用法
  16. 关于 android 平台上的 usb 投屏
  17. python搭建邮件服务器_手把手教你使用Python轻松搞定发邮件
  18. VM 将宿主机文件夹 映射至 虚拟机以及vm tools【共享文件夹、复制粘贴、拖动上传下载】
  19. 王茂斋拳架_王茂斋太极功(接近传奇,从读懂原著开始;吴式太极拳北派宗师王茂斋,门人杨禹廷、刘晚苍、王培生等名家辈出;《太极功源流支派论》《三十二目》)...
  20. 大数据学习之路-Hadoop

热门文章

  1. 如何在VMware里安装windows server 2003
  2. 组图:1896年雅典奥运会
  3. 【机器学习|数学基础】Mathematics for Machine Learning系列之矩阵理论(19):不定积分(补充知识)
  4. 随笔——Docker学习笔记
  5. opencv学习(二十五)之开运算、闭运算、形态梯度、顶帽、黑帽
  6. 365赚钱宝养猫小程序程序源码下载
  7. PCB散热之过孔的作用
  8. 因为我梦见了热情的梦
  9. MT8665芯片处理器,MT8665模块方案开发
  10. DBA组件---ADO数据库编程利器