Duck hunt

The firmware update procedure for use as a device with full functionality of ESPrtk manufacturer.

There has been a change in the usage and loading (flash) ESPrtk firmware since version 2.7.2.
This change stems from the system security needs and the size of the new update has exceeded the 4MByte limit of the Flash chip on ESP32.
Program files run once ( as Register or Login ) will be separated from the main program, this will free up more space for the Firmware file and allow integration of advanced security features and utility of IDF from Espressif on it. .

Please read carefully before start uploading firmware for ESP32.


Usage and life cycle of ESPrtk software.

The steps to flash Firmware on ESP32 are as follows:
Register  -> Update firmware 1. -> Update firmware 2 -> …-> Update firmware N. 
This is an irreversible process, uploading ESP32 firmware must follow this order.

After user confirming registration to use ESP32 like ESPrtk, ESP32 will enter protected Flash reading mode and only accept uploading of Firmware file from the manufacturer. This will help ESPrtk be more secure. 

 (ESPrtk Developer, ESPrtk user or ESPrtk manufacturer  is called User.)

Step 1 – Register:

User must prepare a new ESP32 chip and upload the Register.bin file to ESP32.This file will permanently burn registration information to EFUSE of ESP32.

(ESP32 chip is called “New” when it has not registered successfully before. It doesn’t matter when and how long it was bought.
Users of ESPrtk version 2.5.x, 2.6.x and if not registered are also called New chips.)

Upload fail:

If ESP32 does not export the notification data, it seems to have an upload error. In this case,  user is allowed to reload the Register.bin file to ESP32 if the previous upload failed.

Upload successfully:

After uploading to Register.bin and restarting ESP32.  ESP32 requires confirmation of the registration from the user side (via Serial port (TX-UART0 -baudrate 230400 ) by press and hold on the CWB button in 5 seconds. After registration is completed,ESP32 will export a completed notification (Register Done ..) .

Since this time, ESP32 is in the “Registered-Done” state and does not need to register further.
This means that the registration will only need to be performed once per ESP32 chip.(Unless users want to re-register because they have previously canceled, see more : Cancel and Re-register ESPrtk. )
Now ESP32 needs to update Firmware.

Step 2 – Upload / Update Firmware:

This is the last step.
 Users need to upload the program file for ESPrtk. Theyy are  App.bin and Data.bin file. They collectively called the Firmwares file.

Users are only allowed to upload the Firmwares file when ESP32 is in “Registered-Done”  state  (pass step 1) or needing update other Firmware.

  After upload Firmware files and restarting ESP32. ESP32 will export a  completed notification (ESPrtk information..) via Serial port (TX-UART0 -baudrate 230400 ) .

Upload fail:

If ESP32 does not export the notification data, it seems to have an upload error. In this case,  user is allowed to reload the Firmware files to ESP32 if the previous upload failed.
Upload successfully:

  Since this time. ESP32 is in the “Upload Firmware Success” state.

Now ESP32 is ESPrtk and ready to use.

  Update firmware:

Users may need to update patches or upgrade new features.  They can upload files of Firmwares files with different version numbers and unlimited limit of uploads.To update the new firmware, users only need to repeat uploading the new file App.bin / Data.bin, (the partition address and upload configuration are the same as the first update of Firmwares in Step 2 above).


Steps to upload .bin files for ESPrtk.

 To use ESP32 as ESPrtk. User need to do these steps: 

  • Step 0 : Prepare hardware.
  • Step 1: Upload Register.bin file  and confirm registration.
  • Step 2 : Upload Firmware files (can be uploaded several times).
  • Step 3 : Go to Web config and create new profile account and use.

To upload .bin files for ESP32, we will use “Flash Download Tools” software, This is the tool provided by Espressif (ESP32 manufacturer).

If you don’t know how to use this tool, read this tutorial to learn how to upload an example:  How to use Flash Download Tools to flash .bin file for ESP32.

Dowload .bin fileLink
Flash Download Tools .exe
Serial Port Utility Application .exe

( To download firmware with other themes , clich here )

Step 0 – Prepare hardware.:

GPIO13 pin is connected to 10 K resistor holding Pullup and CWB button. 

Release CWB (no press and no hold) with high Logic voltage level.

Press and hold CWB with low Logic voltage level.

See more circuit here :  Create an ESPrtk board from any ESP32 development boards.

Step 1 – Register:

Need perform this step if ESP32 is new chip .

(  If ESP32 only needs to update the Firmware, skip  this step and  go to Step 2 ).

After step 1 , ESP32 in “Registered-Done” state.

Upload configure: 

Number of bin file1
Register.bin address offset0x0

After flash Register.bin file.

 Open Serial Terminal and press Reset ESP32 . CWB button must be release. (no press and no  hold). 

Now ESP32 requires confirmation of the registration.

To confirm registration , hold on the CWB button in 5 seconds., then you can release CWB button and wait until ESP32 print out  ( Register Done…) message , total time to wait can up to 30 second.

If it does not work , you can press Reset ESP32 then try again as above .

See video below:

After Step 1, if you see ESP32 export an error message reading Flash like this at baudrate 115200:

flash read err, 1000
ets_main.c 371
ets Jun  8 2016 00:22:57

That means the registration is successful and ESP32 only accept ESPrtk ‘s Firmware, so you need to upload the Firmware file.

Step 2 – Upload or Update Firmware:

After registering, upload 2 files of App.bin and Data.bin to use.
Note: App.bin and Data.bin must have the same version, otherwise ESPrtk will not work.

Since this time. ESP32 is in the “Upload Firmware Success” state.

Upload configure: 

Number of bin file2
App.bin address offset0x0
Data.bin address offset 0x350000

See video below:

Step 3 -Go to Web config and create new profile account and use.

After loading the program and connecting ESP32 as an ESPrtk circuit board, you can start using it. Start  WEB Configure , goto Profile and login with account ( Name : admin , Password : abc123ABC ) , then you can visit and start using the web configure interface. 

Now to start using the full feature on ESPrtk, you need to enable it (even you are using Free or Purchase ESPrtk’s firmware ). To do this, click here to continue: Get KEY file to activate ESPrtk.

See video below:

Unable to enter firmware update mode.

ESP32 enter the firmware update mode by following these steps:

-#1 Pull GPIO0 pin down to 0v and hold it until the update is complete.

-#2 Reset ESP32 to enter firmware update mode.

-#3 Update the firmware via the UART_0 port.

-#4 Update complete.

ESP32 cannot enter firmware update mode because GPIO0 pin is not pulled down low before reset. On ESPrtk 3.0.0 version, GPIO0 pin is used as CS-SPI output pin for Ethernet module, so when updating firmware for ESPrtk it is necessary to disconnect power to Ethernet or disconnect GPIO0 to CS-SPI pin. -Ethernet to ensure GPIO0 will be pulled low during the firmware update process.

When designing PCB for your final projects, remember to add a switch or jupmer for the GPIO0 pin to ensure it can pull the GPIO0 pin low during the firmware update. You can refer to the proposed connection block diagram in the datasheet for more info.

Voltage problem:

ESP32 needs to be supplied with the voltage maintained at 3.0 -> 3.5 Volt. In some cases. Pulling GPIO0 to 0Volt may not be enough.

Using too many devices on the same power supply bus on the circuit as ECN28J60 / W5500 + LoRa + GNSS + OLED ...., (while the voltage source is limited output power) can cause the voltage to be applied on ESP32 was not enough for ESP32 to enter firmware download mode.

So, maybe, you need to disconnect the power supply for other devices that are sharing the source bus with ESP32 before pulling the GPIO0 pin down.

Cancel and reuse

Cancel and reuse

  When users want to stop using ESPrtk to use ESP32 for other purposes. They will have to Flash ESP32 for their project, but this violates the security process on ESPrtk , if the user tries to FLash the program not Firmware file of ESPrtk, ESP32 will not run.

After Cancel success:
Users can use ESP32 as usual (eg compiling projects on Arduino-IDE and uploading). And user can still go back to using ESP32 like ESPrtk by Re-register and Reload ESPrtk Firmware file.

See more : Cancel and Re-register ESPrtk.