Skip to content

Instantly share code, notes, and snippets.

@zhivko
Forked from morganrallen/esp32.md
Created October 30, 2016 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhivko/b21167f237576bc00f80028c715203cb to your computer and use it in GitHub Desktop.
Save zhivko/b21167f237576bc00f80028c715203cb to your computer and use it in GitHub Desktop.
ESP32 hacking notes

Basic hookup

As I plan to make a custom breakout board I wanted to solder as few connections as possible. I was able to boot the device, with UART (out at least) soldering the following.

PIN NAME
0 GND
1 3V3
2 EN
15 GND
34 RXD
35 TXD
38 GND

Note I did not solder/reflow/hotair the central GND

Flashing

In order to flash without having to press button or jump jumpers I wanted to use DTR/RTS from the UART to toggle EN and enable flash upload mode. Two more pins are required.

PIN NAME UART
25 IO0 DTR
24 IO2 x
2 EN RTS

GPIO2 can be left connected to GND if not being used, but otherwise needs to be connected to GND in order to boot into flash upload mode.

GPIO0 on the otherhand, must be connected to 3V3 in order to boot, and connected to GND in order to boot into flash upload mode. Connect to DTR on the UART module.

EN shoud be connected to RTS.

Flash tool

The old esptool.py will not work on the ESP32, there is a more up to date version available on the ESP32 forums, registration may be required. Link: esptool32.py

SDK

So far this is definitely the most beta part of working with the ESP32. Just a simple comparison of the linker linker scripts from this and the ESP8266 shows only about 10% of the functionality is available, not including new features unique to the ESP32.

GPIO

Cannot seem to configure GPIO23 as an output. 21 and 22 worked fine.

Bad Boot

At some point I ended up with the bootloader in a bad state and not matter how I reflashed I got the following error

bin status is 0 error
last bin 0 current 0
user code done

This occurred where this would have been expected.

start_addr 2510 40000

jump to run addr @ 0x40000

Command line being used.

esptool32 --port /dev/XBeeX --baud 230400 write_flash -fs 2m 0x0000 ../../bin/boot.bin 0x04000 bin/irom1.bin 0x40000 bin/irom0_flash.bin 0xFE000 ../../bin/blank.bin

Several things happen or where done around the time this problem started. The most notable for me is the multimeter probes connacting each other shorting out the circuit. With my limit electronics knowledge I'm unsure how bad of a problem this is. The circuit was layed out with 5V going through the meter, then connected to an LD33V which powered the board.

Some progress

I've been flashing with -fs 2m without problems so far. After this issue I've dropped that, letting esptool32 default to 4m which has let the boot loader progress.

********************************
*    hello espressif ESP32!    *
* pro cpu 2nd boot is running! *
********************************

2nd boot version : 1.1
SPI Speed      : 40MHz
SPI Mode       : QIO
SPI Flash Size : 1MB
start_addr 2510 40000

jump to run addr @ 0x40000

This is then followed by...

  • Garbage
  • exception(0) or exception(9) mixed with garbage, sometimes with stack
  • Very rarely a successful boot.
Solved!

It's ALWAYS a power supply issue. In the wee early hours I must have messed something up in the power supply. Since cleaning up and rewiring it's now back to normal.

Mysteries of -fs

The ESP31 appears to have 1MB of Flash. esptool32 doesn't appear to support 1MB.

-fs size VS bootloader reporting + result

-fs Reported Size Result
x 1MB Jump 0x40000 + garbage
2m 2MB user code done error
4m 1MB Jump 0x40000 + garbage
4m 4MB link param zone error

Boot Errors

user code done
bin status is 0 error
last bin 0 current 0
user code done

param zone error

This is like the user code done error with an additional message.

bin status is 0 error
last bin 0 current 0
write bin info to system param zone failed
user code done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment