BRIEF: How to disable GPIO re-initialization at boot time?
DETAIL:
* We abuse the HSPI bus to output a proprietary protocol on IO pins.
* The protocol requires a normally high state.
* The ESP32 occasionally needs to reboot.
* We want the IO pin to remain in a high state throughout the reboot and re-initialization.
* We observe a 1 microsecond negative pulse during reboot. (See oscilloscope capture below)
* Judging from the slow skew on the rising edge of the pulse, I believe the pin is being set to an INPUT with PULLUP. It then later gets configured for HSPI use without any further glitch occurring.
* Unfortunately, this glitch causes malfunction of the hardware on the other end of this protocol, which we cannot control.
* Therefore, we seek a way to eliminate this negative pulse occurring on reboot.
* I guess that there is some initialization code where ESP-IDF sets all IO pins to input with pull-up. I would want to disable that behavior. Hopefully this can be done from within the IDF. I.e., that it is not an immutable (ROM) part of the boot process.
Any suggestion on avoiding this sort of IO glitch on reboot is much appreciated.
Cheers from Scenic Northern New Jersey,
-Chris
[SOLVED] Microsecond Glitch at Startup / How to Disable IO Re-Initialization
-
- Posts: 75
- Joined: Tue May 29, 2018 8:00 pm
[SOLVED] Microsecond Glitch at Startup / How to Disable IO Re-Initialization
Last edited by chrismerck on Wed Oct 21, 2020 4:24 pm, edited 1 time in total.
-
- Posts: 9043
- Joined: Thu Nov 26, 2015 4:08 am
Re: Microsecond Glitch at Startup / How to Disable IO Re-Initialization
How are you rebooting the ESP32? What IO pin are you using?
-
- Posts: 75
- Joined: Tue May 29, 2018 8:00 pm
Re: Microsecond Glitch at Startup / How to Disable IO Re-Initialization
GPIO17 and GPIO18. Above capture was of GPIO18.
We are software-rebooting the ESP32 like this:
We are software-rebooting the ESP32 like this:
Code: Select all
void Osal_Reboot()
{
SysUser("Rebooting NOW!");
Osal_Sleep_Ms(100);
/* Leave the RTC slow memory powered during deep sleep.
Without this, we get corruption and bootloops on PBB. */
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON);
/* We do not use esp_restart() because that would cause RTC mem to be init */
/* WARNING: ESP-IDF docs warn that we should shutdown WiFi + BLE prior to
calling esp_deep_sleep. However, we are not doing that... */
esp_deep_sleep(1000 /* 1 ms */);
/* never reaches here */
while (1); /* just in case */
}
-
- Posts: 9043
- Joined: Thu Nov 26, 2015 4:08 am
Re: Microsecond Glitch at Startup / How to Disable IO Re-Initialization
Possibly gpio_hold_en(pin); and gpio_deep_sleep_hold_en(); do what you want.
-
- Posts: 75
- Joined: Tue May 29, 2018 8:00 pm
[SOLVED] Re: Microsecond Glitch at Startup / How to Disable IO Re-Initialization
Thank you, that is exactly what I was looking for!
(However, I note that it turns out that the 1 uS glitch I showed was being driven by another part on the board, not the ESP32.)
(However, I note that it turns out that the 1 uS glitch I showed was being driven by another part on the board, not the ESP32.)
Who is online
Users browsing this forum: MicroController and 105 guests