logo elektroda
logo elektroda
X
logo elektroda

Configuring OpenBeken on ESP32 with 4MB Default Using sdkconfig.defaults.esp32

insmod 6315 149
ADVERTISEMENT
  • Helpful post
    #1 21220790
    insmod
    Level 23  
    >>21220502 ESP32 fixed, it lacked sdkconfig.defaults.esp32. Now configured with 4MB by default.

    Moderated By p.kaczmarek2:

    This is a good work and deserves a separate thread

  • ADVERTISEMENT
  • #2 21220833
    p.kaczmarek2
    Moderator Smart Home
    very nice, it would be also nice to get basics running on ESP8266. I can help, especially if we get online builds to work. They help me a lot because they allow me to develop anywhere without having a toolchain. As far as I can tell, most of the ESP8266 devices have 2MB flash on the board so it should be enough for basic functionality.
    Helpful post? Buy me a coffee.
  • #3 21220842
    DeDaMrAz
    Level 19  
    Can I join the topic by asking for any progress update on this?

    And also to second the @p.kaczmarek2 thought on most of 8266 boards running on 2Mb Vs rare 4Mb boards.
  • ADVERTISEMENT
  • #5 21220858
    p.kaczmarek2
    Moderator Smart Home
    So what kind of ESP32 modules do you guys have? I've found that one:
    LilyGO D1 Mini Plus module with ESP32-C3 chip on a wooden background
    Looks like ESP32-C3
    Helpful post? Buy me a coffee.
  • #6 21220885
    insmod
    Level 23  
    I have an ESP32-C3 Supermini, which isn't without its troubles (solved with esp_wifi_set_max_tx_power(13 * 4) under a define), and WeAct ESP32-C6-Mini.
    Also have an ESP32-CAM module, + i can spare an ESP32-CAM, where i replaced tho stock module with an ESP32-S3.
    Additionally have 2 of the fake ESP32-S2 Mini
    Don't have any devkits with ESP32-C2 modules, only 01C with combo flashing board (32-wroom, esp-12, esp-01).
  • #7 21220902
    p.kaczmarek2
    Moderator Smart Home
    I can try to flash some test binaries in a moment. I also have this ESP32 device:
    https://www.elektroda.pl/rtvforum/topic4021279.html
    It has ESP32-DOWD inside it seems.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 21220923
    divadiow
    Level 34  
    >>21220858
    4mb ESP32-C2-12 (revision v1.0) dev board
    4mb ESP32-D0WDQ5-V3 (revision v3.1) (ESP-WROOM-32) dev board
    4mb ESP32-C3 on PCB in SPI/PWM LED device (about to solder up to flash)

    Motherboard with electronic components on a blue background.

    older
    2x 4mb ESP8266EX dev boards
    other 1/2/4mb ESP8285/8266 in devices and loose modules
  • #10 21220970
    DeDaMrAz
    Level 19  
    I stay corrected, most of the ESP-12E modules I've taken from devices have 25q32FV chips which are 32Mbits (aka 4Mbytes) and I was drawn to 2Mb because BK7231 chips have that as the base.
  • ADVERTISEMENT
  • #11 21220976
    p.kaczmarek2
    Moderator Smart Home
    I may be wrong, but as far as I remember, it's very easy to swap SPI flash to larger one in ESP, or at least for ESP's that have external flash, of course. So not for ESP8285, etc... but for ESP8266, etc, you can solder an SPI Flash chip and it should work, correct me if I'm wrong.
    https://www.instructables.com/ESP-03-Upgrade-Flash-Memory-to-128-M-Bit/
    https://github.com/micropython/micropython/issues/2335
    Helpful post? Buy me a coffee.
  • #12 21220978
    insmod
    Level 23  
    >>21220976 Correct, I have done it once. It was an ESP-01 with 1MB flash, I successfully replaced it for 4MB, which then correctly showed up in esptool flash_id.
  • #13 21220983
    DeDaMrAz
    Level 19  
    My concern was that most of the OBK users will not be able to do a chip swap as they find it difficult to flash the device in situ in the first place.

    But more is better and i think 4Mb base would be perfect, at least for those who are trying to run OBK on the common ESP devices.
  • #14 21220988
    divadiow
    Level 34  
    divadiow wrote:
    4mb ESP32-C3 on PCB in SPI/PWM LED device (about to solder up to flash)


    Code: Text
    Log in, to see the code

    but sadly

    Code: Text
    Log in, to see the code
  • #15 21220991
    p.kaczmarek2
    Moderator Smart Home
    How do you flash it? I have C3 as well, I can test
    Helpful post? Buy me a coffee.
  • #17 21221001
    p.kaczmarek2
    Moderator Smart Home
    Some early OBK printfs are there, but then it crashes:
    Screenshot of Tasmota ESP Flasher tool showing error information.
    Helpful post? Buy me a coffee.
  • #18 21221011
    divadiow
    Level 34  
    my issue relates to encryption flags.

    Code: Text
    Log in, to see the code


    vs dev board:

    Code: Text
    Log in, to see the code


    Added after 54 [seconds]:

    unique to my device so I'll deal with that on its own
  • #20 21221040
    p.kaczmarek2
    Moderator Smart Home
    Very promising, I'll check more:
    Console with log messages related to initialization and errors.

    Added after 29 [seconds]:

    Wi-Fi connection dialog for network OpenESP32C3_F97142E0 with an option to connect automatically.

    Added after 1 [minutes]:

    OpenESP32C3 application interface with Config, Restart, Launch Web Application, and About buttons.
    Congratulations, you did it! Now, which basic features are missing and how I can help? I personally consider online builds to be pretty high priority... I need to revise the PR code to know more, I will do it in the morning, as it's midnight here.
    Helpful post? Buy me a coffee.
  • #21 21221042
    DeDaMrAz
    Level 19  
    No luck with the dev board I got

    
    my EPS32 dev board log
    Chip Info:
     - Chip Family: ESP32
     - Chip Model: ESP32-D0WDQ6-V3 (revision v3.0)
     - Number of Cores: 2
     - Max CPU Frequency: 240MHz
     - Has Bluetooth: YES
     - Has Embedded Flash: NO
     - Has Factory-Calibrated ADC: YES
  • #22 21221048
    p.kaczmarek2
    Moderator Smart Home
    Even scan works:
    ESP32C3 module user interface showing a list of WiFi networks.

    Added after 3 [minutes]:

    it also connects to WiFi successfully:
    Screen of the OpenESP32C3 user interface displaying system information.
    Helpful post? Buy me a coffee.
  • #23 21221080
    divadiow
    Level 34  
    divadiow wrote:
    unique to my device so I'll deal with that on its own

    burnt efuse with
    espefuse.exe --port com9 burn_efuse DIS_DOWNLOAD_MANUAL_ENCRYPT
    espefuse.exe --port com9 burn_efuse SPI_BOOT_CRYPT_CNT

    to make
    Code: Text
    Log in, to see the code


    anyway. the import thing is
    OpenESP32C3_4EDCD224 web interface displaying configuration, restart, and launch web application buttons.

    Code: Text
    Log in, to see the code


    Added after 3 [minutes]:

    Screenshot of the LittleFS file management panel with options to edit the /autoexec.bat file.
  • #24 21221088
    p.kaczmarek2
    Moderator Smart Home
    Nice, I didn't notice that LFS works:
    
    again:
    addChannel 1 1
    delay_s 1
    goto again
    

    Screenshot of a system log with messages related to channel changes and MQTT.

    However, I am now confused, it seems to increase less frequently than every second.
    Helpful post? Buy me a coffee.
  • #25 21221094
    divadiow
    Level 34  
    Some stuff to be worked out I guess.

    How does one account for the different frequency crystals? Is that related? I see 40 and 26 in my esptool info returns for different dev boards
  • Helpful post
    #26 21221102
    insmod
    Level 23  
    Regarding tasmota partitions: doubtful, as modern versions use "safeboot" partition, which is not applicable here. Pre v12 it have been possible, but not now. Also, i've looked at the csv files in tasmota, and they're only for 4MB flash.
    CI is ready, binaries are available at github.
  • #27 21221104
    p.kaczmarek2
    Moderator Smart Home
    The issue with script counting too slowly seem to be ESP-related. It works good on WB3S:
    Screenshot of system logs displaying changing channel and time information.
    On ESP increase is every few seconds:
    Screenshot of system logs showing channel changes and time information.
    It seems that delta time of the scripts tick is invalid:
    Code: C / C++
    Log in, to see the code

    it is called from user_main.c:
    Code: C / C++
    Log in, to see the code

    Maybe g_deltaTimeMS is invalid on ESP globally.

    Here is a larger snippet:
    Code: C / C++
    Log in, to see the code

    Does that mean the QuickTick thread gets fired not often enough?
    Code: C / C++
    Log in, to see the code

    I am not sure right now....
    Helpful post? Buy me a coffee.
  • #28 21221112
    insmod
    Level 23  
    >>21221104 The code
    
    #if defined(PLATFORM_BEKEN) || defined(WINDOWS)
    	g_time = rtos_get_time();
    #elif defined (PLATFORM_ESPIDF)
    	g_time = esp_timer_get_time() / 1000;
    #else
    	g_time += QUICK_TMR_DURATION;
    #endif
    

    mitigates this somewhat, but it's still a little slower (MAIN:Time 150, channel 1 has changed to 121)
  • #29 21221113
    p.kaczmarek2
    Moderator Smart Home
    But what is the core source of the problem? Is the QUICK_TMR_DURATION tick frequency too high for used SDK? rtos_init_timer is not that precise?

    I would try to setup an empty timer (or a timer toggling pin) with QUICK_TMR_DURATION duration and check on scope/logic analyzer how often in reality it toggles.

    Or simplify the experiment and insert pin toggle in Quicktick entry.

    Added after 3 [minutes]:

    Maybe something like CONFIG_FREERTOS_HZ setting is needed? Just guessing, I've done a very little research so far.
    Helpful post? Buy me a coffee.
  • #30 21221114
    insmod
    Level 23  
    >>21221113 in quick_timer_thread vTaskDelay(QUICK_TMR_DURATION / portTICK_RATE_MS); instead of vTaskDelay(QUICK_TMR_DURATION); is now almost alright, 1-2 sec error.

Topic summary

The discussion revolves around configuring OpenBeken on the ESP32 platform, specifically addressing the integration of sdkconfig.defaults.esp32 for devices with 4MB flash memory. Users share their experiences with various ESP32 models, including ESP32-C3, ESP32-C6, and ESP32-D0WDQ6, while troubleshooting issues related to flashing, GPIO functionality, and driver compatibility. Key topics include the successful flashing of test binaries, the need for proper GPIO configuration, and the challenges faced with UART communication. Participants also discuss the potential for expanding support to ESP8266 devices and the importance of online builds for development flexibility.
Summary generated by the language model.
ADVERTISEMENT