esp32 reset

Hello guys I am using esp32 module in my project. There is an en button that resets the chip but I want to make it such that when we press en button for 5 sec that the device resets instead of immediately. I appreciate your suggestions.

Great question very hard to answer. There are a lot of different resets to chose. Try this link for more information.
The technical reference manual Section 3 (Reset and Clock) covers types of reset. The ESP32 datasheet covers strapping pins which are used to determine the boot mode at reset.

flash read err, 1000
ets_main.c 371

I am getting this error in my esp32 devkit v1
How to solve it?
I am using arduino IDE for programming the esp32