How can I talk to the rom bootloader

anakyr
Posts: 22
Joined: Fri Jun 15, 2018 12:09 pm

How can I talk to the rom bootloader

Postby anakyr » Wed Sep 19, 2018 1:07 pm

I found this information for the serial protocol --> attached file.
Does anyone know then how can I talk to the ROM bootloader?
Attachments
Capture.JPG
Capture.JPG (50.95 KiB) Viewed 11761 times

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: How can I talk to the rom bootloader

Postby kolban » Wed Sep 19, 2018 2:27 pm

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: How can I talk to the rom bootloader

Postby ESP_Angus » Thu Sep 20, 2018 5:56 am

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.

anakyr
Posts: 22
Joined: Fri Jun 15, 2018 12:09 pm

Re: How can I talk to the rom bootloader

Postby anakyr » Thu Sep 20, 2018 7:01 am

Thanks a lot guys for your replies!
Now it's time to put them into implementation. Wish me luck :D

anakyr
Posts: 22
Joined: Fri Jun 15, 2018 12:09 pm

Re: How can I talk to the rom bootloader

Postby anakyr » Thu Sep 20, 2018 11:19 am

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.
Attachments
Capture2.JPG
Capture2.JPG (59.61 KiB) Viewed 11698 times
Capture.JPG
Capture.JPG (50.54 KiB) Viewed 11698 times

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: How can I talk to the rom bootloader

Postby ESP_Angus » Mon Sep 24, 2018 5:18 am

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.

Who is online

Users browsing this forum: No registered users and 139 guests