Page 1 of 1

Factory reset

Posted: Thu Nov 22, 2018 12:51 pm
by urbanze
I am using the factory reset option of bootloader (menuconfig), it works fine but there is a problem.

I am using GPIO4 for both factory reset and user touch (after code start) and when some software reset, panic reset, etc happens (! = POWER_ON), it seems that the bootloader does not activate the pull_up of the pin, causing factory reset... However, in power_on works normally.

What is this problem and how solve?

Re: Factory reset

Posted: Fri Nov 23, 2018 1:47 am
by ESP_Sprite
One thing I can think of is that the pin has enough (parasitic) capacitance to still be low, even after the pull-up is enabled. You could try adding a delay of a bunch of milliseconds between the pull-up enable and the pin read to compensate for this.

Re: Factory reset

Posted: Sun Nov 25, 2018 12:15 pm
by urbanze
ESP_Sprite wrote:
Fri Nov 23, 2018 1:47 am
One thing I can think of is that the pin has enough (parasitic) capacitance to still be low, even after the pull-up is enabled. You could try adding a delay of a bunch of milliseconds between the pull-up enable and the pin read to compensate for this.
How can I add delay if "bootloader" read the pin? I just enable this option in menuconfig, changing absolutly nothing in my code. Why in power_on works (not trigger reset) and when software reset occur fail (trigging reset factory)?

Re: Factory reset

Posted: Sun Nov 25, 2018 12:40 pm
by chegewara

Re: Factory reset

Posted: Tue Nov 27, 2018 6:12 pm
by urbanze
I finally finished developing OTA via GSM, however, this problem persists and is half out of our reach, since the bootloader should activate the internal pull-up at boot every time, but when SW_RST occurs this does not seem to happen, causing factory reset.

Help guys?

Re: Factory reset

Posted: Tue Nov 27, 2018 7:45 pm
by WiFive
Also possible the touch fsm is not getting disabled/reset during those reset events. You could modify the bootloader to make sure touch is deinit and rtc gpio is deinit.

Re: Factory reset

Posted: Tue Nov 27, 2018 9:08 pm
by urbanze
WiFive wrote:
Tue Nov 27, 2018 7:45 pm
Also possible the touch fsm is not getting disabled/reset during those reset events. You could modify the bootloader to make sure touch is deinit and rtc gpio is deinit.
If I need to change the bootloader for this to work, it will be easier to disable it and make my own "IF" at the beginning of the code to boot into factory_app... I will be waiting for correction and do my methods. :?