How to reset ESP01-S after converting TX to GPIO

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
kwiley
Posts: 67
Joined: Wed May 16, 2018 5:53 pm
Contact:

How to reset ESP01-S after converting TX to GPIO

Post by kwiley » Thu Jun 06, 2019 7:15 am

I knew doing this would be difficult to back out of, but I didn't think it would be impossible. I didn't expect it to permanently brick the board, so I suspect I haven't figured out the solution yet. I wrote a main.py that initializes pin 1 (TX) to an output pin. So, now, whenever the board boots up, it starts using pin 1 as GPIO instead of for serial comms. This was on purpose, but like I said, I thought there was *some* way to get back to an interactive/programming/debugging/REPL session later.

I'm surprised that rebooting in program mode has not worked. Neither esptool nor ampy seem to be able to access the board. Shouldn't the program switch on the USB programmer (which I believe simply pulls GPIO-0 low) have converted TX back to a serial line?

If not, how does one regain control of the board? There's got to some way to do it, right?

Thanks.

User avatar
Roberthh
Posts: 1422
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: How to reset ESP01-S after converting TX to GPIO

Post by Roberthh » Thu Jun 06, 2019 7:47 am

You should check the wiring. Pulling GPIO0 low at reset time activates the RMO based bootloader, which is always present and not affected at all by the content of the flash, like a Python firmware or main.py. You can check that by having a terminal connected and pulling reset low with GPIO0 low. Then you'll see the bootloader promt at 74880 (!) baud, like " ets Jan 8 2013,rst cause:2, boot mode:(1,6)"
At 1152900 baud you just see some gibberish

kwiley
Posts: 67
Joined: Wed May 16, 2018 5:53 pm
Contact:

Re: How to reset ESP01-S after converting TX to GPIO

Post by kwiley » Thu Jun 06, 2019 7:53 am

Okay. Thanks. I realize a lot of folks manually wire GPIO0 to ground, but I'm using one of those USB programmers with a physical switch between UART and PROG mode, so that isn't a wiring issue. At any rate, it's reassuring to see that prog mode should indeed circumvent this sort of issue. That's what I expected after all, hence my confusion.

I'll keep banging away at it.

Thanks.

Post Reply