Unable to software restart...custom hardware assistance

rfleming
Posts: 62
Joined: Tue Oct 09, 2018 12:30 am

Unable to software restart...custom hardware assistance

Postby rfleming » Mon May 10, 2021 5:28 am

Hi all,

I have ran into this issue once before with some custom hardware and just wondering what IOs on an esp32-pico-d4 should I be looking at to address this issue. I currently have every IO connected on my esp32 except:

Code: Select all

Pins | IO
30  |  IO11
32  |  IO7
25  |  IO16
27  |  IO17
31  |  IO6
33  |  IO8
44
45
47
48
Regardless, the device powers up fine, restarts fine with an external button etc. This is based on the ethernet kit so I have the 50MHz clock going into IO0 (Pin 23) Though I am unsure what could stop the board from actually allowing a software reboot.

This could happen from a crash

Code: Select all

ELF file SHA256: d34294f2a681643e

Re-entered core dump! Exception happened during core dump!
Rebooting...
Or even generally calling esp_restart()

I am sorry as I cannot upload a schematic that would obviously help much more :(

rfleming
Posts: 62
Joined: Tue Oct 09, 2018 12:30 am

Re: Unable to software restart...custom hardware assistance

Postby rfleming » Mon May 10, 2021 7:34 am

Update.

Starting at default SDK, it appears to be specifically enabling "external rtc 32khz crystal" causes this to occur. Possibly on these 2 boards I have an RTC crystal issue, though interesting that it stops it from being able to do a software reboot...

This line gave me the hint:

Code: Select all

{1B}[0;33mW (444) clk: 32 kHz XTAL not found, switching to internal 150 kHz oscillator{1B}[0m
sdkconfig changes required to repeat

Code: Select all

# CONFIG_ESP32_RTC_CLK_SRC_INT_RC is not set
CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS=y
# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set
# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set
# CONFIG_ESP32_RTC_EXT_CRYST_ADDIT_CURRENT is not set
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
CONFIG_ESP32_RTC_XTAL_CAL_RETRY=1
CONFIG_ESP32_RTC_XTAL_BOOTSTRAP_CYCLES=5

rfleming
Posts: 62
Joined: Tue Oct 09, 2018 12:30 am

Re: Unable to software restart...custom hardware assistance

Postby rfleming » Tue May 11, 2021 2:12 am

Update. Solved.

It turns out the esp-idf (currently on v4.2.1) fails to restart if it has a bad rtc crystal/load capacitance and its enabled.

The first issue is the fact the toolchain locks up when trying to reboot, the ironic work around for this increasing the logging verbosity to either DEBUG or VERBOSE in the sdkconfig. This at least allows the application to run as expected.

The second issue, though on my side was I had bad load capacitance on my crystal. This was immediately confirmed by placing a scope probe on the xtal XP pin (pin 13 on the pic-d4). This would increase the capacitance on the load and the crystal would begin to oscillate. This was further confirmed to be the issue as when the esp_restart() function is called, the mcu stops. Once I place my probe on the XP capacitor, the crystal oscillates and the MCU then restarts as expected, holding the probbe on the capacitor and go through multiple of the same operations results in the expected outcomes.

Note to readers, my scope probe is roughly 7pF. My crystal has a load capacitance of 12.5. The ESP32-Pico-D4 as an input IO capacitance of 2pf. Plugging this into the target forumal gives:

Code: Select all

Load Capacitance = (12.5-2)*2 ~=21pF
the 22pF capacitors I have on hand are close enough, and this solved my issue.

Who is online

Users browsing this forum: No registered users and 85 guests