ESP32-S2 Outboard DFU

Thought others might be interested that I’ve had a go with Outboard DFU on ESP32-S2.
(This also serves as notes for me to return to later)
I know this isn’t officially supported yet.

I’ve got it working on a Unexpected Maker FeatherS2 board on a Notecarrier-F.
The pins don’t match up exactly to what is expected, but can be sorted with jumper wires. See image below. Unfortunately I don’t believe this can work with Adafruit ESP32-S2 Feather boards because they don’t break out the UART0 RX Pin.

After that, the process works mostly like described here Outboard DFU - Blues Wireless Developers

The other key thing is to make sure the different bin files end up at the correct offsets.
This can be done with the Blues binpack tool, e.g

notecard -binpack esp32 0x1000:Blink.ino.bootloader.bin 0x8000:Blink.ino.partitions.bin 0x10000:Blink.ino.bin

alternatively using esptool, e.g.

esptool.py --chip esp32s2 merge_bin 0x1000 Blink.ino.bootloader.bin 0x8000 Blink.ino.partitions.bin 0x10000 Blink.ino.bin -o combined.bin

that is based on the offsets in the example here
https://docs.espressif.com/projects/esptool/en/latest/esp32s2/esptool/basic-commands.html?highlight=merge_bin

Then use notehub to upload and flash the .binpack file

2 Likes

PS, Any Blues folks reading this…
I got tripped up for a minute by an error in the API python example here

Should be “name” not “mode”

Also, as developer feedback:
I’ve noticed that the notecard puts the host into bootloader mode but then takes several minutes to actually update the firmware. Not a big deal or high priority, but I wonder if this delay could be avoided?
e.g. only put the host into bootloader mode when ready to flash the firmware.

Wow @calcut!

That is totally AWESOME!

Excellent diagram, it clearly illustrates what needs to be done. Nice call out on the memory locations with binpack as well.

Thank you for letting us know about the doc bug, we will definitely update the typo ASAP.

I’m going to buy one of those boards, because would love to reproduce this myself. Also, we will see if we can reproduce the early bootloader jump, and fix it as well.

Can you share the link you used to buy the “Unexpected Maker FeatherS2”, so I can be certain I have the same board as you?

Excellent work!
Zak

Thanks Zak

I bought it from Pimoroni in the UK. They are currently out of stock.

Looks like you can get them from adafruit or amazon in the US.

I don’t have a featherS3 board, but you might want to give that a whirl too.

I’ve got the parts on order and the doc fix in a PR!

Thanks again @calcut, for digging in and reporting your findings!

Great! if you find these are boards you want to support, the number of jumper wires required could be reduced to 1, but it would require the “B0” signal to be available on some other pin e.g. AUX1 or AUX2. That way the DFU DIP switch could be left on. Just an idea.

I agree that the Notecarrier-F is the most convenient form-factor for using a Feather compatible MCU. However, Outboard DFU support is not limited to the Notecarrier-F.

In fact, all of our Notecarriers are capable of supporting Outboard DFU by using jumper wires. Outboard DFU is really only limited by the availability of the strapping pins on the MCU.

Personally, I’m very excited to validate the Outboard DFU compatibility of the Unexpected Maker MCUs, identify the hiccup you observed, eliminate it, and ensure the DFU process is stable and smooth.

1 Like

Hey @zfields and all the Blues team,
Thanks heaps for the Outboard OTA functionality - very much appreciated. Also @calcut for making it work on the ESP32-S2 Feather and posting your bin file/memory offset syntax -awesome!
I can report it works on the ESP-wroom-32 modules too with slight modification. AUX3 is connected to the IO0 pin for putting the ESP into boot mode. Also, the OTA wouldn’t work with merging the 3 bin files as per calcut’s post. However when I tried the app binary by itself - bingo! So,

notecard -binpack esp32 0x10000:Blink.ino.bin

The rest as per the example. Also tried the same with an ESP8266 on the off-chance (memory location is the same) … but no go. Might it get support in the near future?

1 Like

Amazing work @rberkelm!!!

Thanks for sharing it here. I’m certain it will help many others just like yourself!

Sincerely,
Zak

I was able to get Outboard DFU to work on the Unexpected Maker ESP32-S3 Feather (referenced above) and the Notecarrier-F using the instructions in this thread. I used an Arduino app not Circuit Python, so that changes the binpack as also mentioned in the thread.

I tried using the Adafruit ESP32-S3 Feather (Adafruit ESP32-S3 Feather with 4MB Flash 2MB PSRAM [STEMMA QT / Qwiic] : ID 5477 : $17.50 : Adafruit Industries, Unique & fun DIY electronics and kits) but it doesn’t have IO0 on the pins, so it didn’t work. As I recall the schematic for this board shows a test point connected to IO0, so it may still be possible to get outboard DFU working by soldering a jumper onto the test point.

Just wanted to document this on the board.

1 Like