Page 1 of 1

How can I talk to the rom bootloader

Posted: Wed Sep 19, 2018 1:07 pm
by anakyr
I found this information for the serial protocol --> attached file.
Does anyone know then how can I talk to the ROM bootloader?

Re: How can I talk to the rom bootloader

Posted: Wed Sep 19, 2018 2:27 pm
by kolban
Think of the ESP32 as having a ROM hosted application that gets control when you boot the ESP32 in "Download" mode. This application then listens on the serial port for incoming protocol which is described in the document you found. There is a rich set of commands. However, as you realize, the application is in ROM and hence can't be changed. However, Espressif solved this problem by "optionally" allowing a replacement that can be loaded into RAM and executed. Think of this as a super-set of the same functions as found in ROM. This RAM based application provides additional commands that can be read by serial above and beyond those in ROM and these are what are documented here. The RAM based download application is built into esptool and when you use THAT tool, the RAM application is implicitly loaded.

Re: How can I talk to the rom bootloader

Posted: Thu Sep 20, 2018 5:56 am
by ESP_Angus
The document that you found seems to be this wiki page:
https://github.com/espressif/esptool/wi ... l-Protocol

You can take a look at esptool.py to see how it works, as a reference.

If you run "esptool.py --no-stub --trace ..." then you'll get a full dump of each command which is sent to the ROM bootloader and each response which comes back.

Re: How can I talk to the rom bootloader

Posted: Thu Sep 20, 2018 7:01 am
by anakyr
Thanks a lot guys for your replies!
Now it's time to put them into implementation. Wish me luck :D

Re: How can I talk to the rom bootloader

Posted: Thu Sep 20, 2018 11:19 am
by anakyr
Actually I disoldered the module WROOM from the devkitc and I only connected the UART pins, VCC, ground and EN and GPIO0 to gnd with buttons the last two of them. So if I don't press the button ENABLE and GPIO0 are floating if I press the button the go low.
I wanted to verify that I can program the chip through UART without using the dev board.
No I try to talk to the ROM bootloader through esptool.py through UART but it is trying by default to use SPI.
Is it possible to use UART instead somehow?
Thank you in advance.

Re: How can I talk to the rom bootloader

Posted: Mon Sep 24, 2018 5:18 am
by ESP_Angus
Hi anakyr,

The error message "ESP32 ROM does not support command erase_flash" suggests that esptool.py is talking to the ESP32 ROM bootloader.

The error message is because some commands are not supported in "--no-stub" mode, because they rely on uploading a software "stub bootloader" to IRAM and then running this loader program. You can either remove the "--no-stub" argument, or try a different command.