esp32nodemcu-buildsparkfun

How to patch / configure a nodemcu build for SparkFun ESP32 Thing


I have been using nodemcu-build for 8266 modules with success for several projects.

I have been trying to replicate the same development environment using SparkFun ESP32 Thing using the beta version of nodemcu-build for ESP32.

After building, downloading a build it appears to successfully flash to the ESP32 Thing. But then it displays the following error message:

rtc_clk_init: Possibly invalid CONFIG_ESP32_XTAL_FREQ setting (40MHz). Detected 26 MHz

From my research it appears that SparkFun build these modules with 26MHz xtals, yet the standard is for 40 MHz. The error message suggests to me that the nodemcu-build for ESP32 assumes a 40MHz xtal.

Is there any way to patch to configure for the different frequency. I found a reverse situation where the problem was to patch a 26MHz generated binary to run at 40MHz.

But I'm unwilling to start patching without having confirmation as to exactly what is the correct process.


Solution

  • Is there any way to patch to configure for the different frequency.

    Simple answer: no, not in the cloud builder.

    Elaborate answer: yes, but you have to build the firmware yourself. The relevant configuration param is documented in the ESP-IDF Programming Guide at https://docs.espressif.com/projects/esp-idf/en/stable/api-reference/kconfig.html#config-esp32-xtal-freq-sel

    Main XTAL frequency

    Found in: Component config > ESP32-specific

    ESP32 currently supports the following XTAL frequencies:

    • 26 MHz
    • 40 MHz

    Startup code can automatically estimate XTAL frequency. This feature uses the internal 8MHz oscillator as a reference. Because the internal oscillator frequency is temperature dependent, it is not recommended to use automatic XTAL frequency detection in applications which need to work at high ambient temperatures and use high-temperature qualified chips and modules.

    Unless you plan to very frequently build firmware binaries I suggest you give my Docker build image a try: https://github.com/marcelstoer/docker-nodemcu-build/