Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read boot header for better error messages (ESPTOOL-87) #27

Closed
abl opened this issue Apr 12, 2015 · 3 comments
Closed

Read boot header for better error messages (ESPTOOL-87) #27

abl opened this issue Apr 12, 2015 · 3 comments

Comments

@abl
Copy link

abl commented Apr 12, 2015

So the ESP8266 outputs a boot header at 77400 baud containing something like:

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

According to https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process#esp-boot-modes the first value in the boot mode is interesting.

GPIO15 GPIO0 GPIO2 Value Status
0 0 1 1 UART
0 1 1 3 SPI Flash
1 X X >= 4 SDIO

If, after reset, we encounter a boot mode that isn't 1, it's possible to raise an error there and tell the user the board was not put in to flash mode.

@projectgus
Copy link
Contributor

This seems like a really interesting idea, but I'm not sure exactly how it would work.

Do you mean we scan the output for the ROM boot mode string, and then if we see it then we can parse out and give an intelligent "your GPIO0 line is high" type error message?

The only problem I see is that esptool.py doesn't usually operate at the oddball 74800 baud rate, the default is 115200 and most people run even faster than this. In fact only about 30% of the adapters I have at hand can even use that baud rate (FT2232R can but cp2102, ch341 and avr usbserial all can't.)

So I think it would be tricky to parse this out while also trying to operate at a higher rate. Or am I misunderstanding how it would work?

@0x2b3bfa0
Copy link

@projectgus I think that he suggest to open the connection at 74800 and once it gets the bootloader response, change the speed to 115200 (or whatever speed you want)

@radimkarnis
Copy link
Collaborator

I’m closing this issue because it has been inactive for a few months and it seems like it's not relevant anymore. Please reopen if further discussion is needed.

@github-actions github-actions bot changed the title Read boot header for better error messages Read boot header for better error messages (ESPTOOL-87) Dec 8, 2020
Jason2866 referenced this issue in Jason2866/esptool Nov 29, 2023
Fix build with new Pyinstaller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants