I'm new to these devices and even if they are very cheap, I don't unnecessarily want to brick them.
I've used esptool to flash the NodeMCU firmware onto my modules. When doing so, I need to specify the address where the file(s) get written, which usually is 0x00000. Does that mean that the firmware actually contains the bootloader? Or is it located in a separate region on the flash?
If the bootloader itself is contained in the firmware file, an interrupted flashing process would render the module useless, I suppose?
Thanks for clarification!
You can't damage the module this way. I probably did a hundred flashes, some of which failed (e.g. due to a too high baud rate). The firmware itself does contain the bootloader at
0x000000
, but that's a second-stage bootloader which can be exchanged arbitrarily. You shouldn't be able to overwrite the first-stage bootloader. Quoting from the man who createdrBoot
, an open-source alternative for the properitary Espressif booatloader at http://richard.burtons.org/:In short: You cannot damage your module by writing nonsense to
0x00000
. It will maybe execute some arbitrary code before it finds an invalid opcode, but that's not enough to make the CPU explode or the module to be damaged. Reflashing the firmware is enough to recover from a damaged second-stage bootloader.So where is that first-stage bootloader exactly? From the comments at richard.burtons.org/2015/05/17/esp8266-boot-process, the creator answered this himself as: