├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── build └── esp32-repart.bin ├── dependencies.lock ├── include └── README ├── lib └── README ├── partitions ├── default_4mb.csv ├── huge_app.csv ├── max_app_4mb.csv ├── min_spiffs.csv ├── nofs.csv ├── previous.csv ├── tinyuf2.csv └── zigbee.csv ├── platformio.ini ├── sdkconfig ├── sdkconfig.esp32dev ├── src ├── CMakeLists.txt ├── device_info.cpp ├── device_info.h ├── main.cpp ├── main.h ├── part_mgr.cpp ├── part_mgr.h ├── utils.cpp └── utils.h └── test └── README /.gitignore: -------------------------------------------------------------------------------- 1 | .pio/ 2 | .vscode/ 3 | sdkconfig.*.old 4 | bootloader-old.bin 5 | partitions-old.bin 6 | 7 | # Prerequisites 8 | *.d 9 | 10 | # Object files 11 | *.o 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Linker output 17 | *.ilk 18 | *.map 19 | *.exp 20 | 21 | # Precompiled Headers 22 | *.gch 23 | *.pch 24 | 25 | # Libraries 26 | *.lib 27 | *.a 28 | *.la 29 | *.lo 30 | 31 | # Shared objects (inc. Windows DLLs) 32 | *.dll 33 | *.so 34 | *.so.* 35 | *.dylib 36 | 37 | # Executables 38 | *.exe 39 | *.out 40 | *.app 41 | *.i*86 42 | *.x86_64 43 | *.hex 44 | 45 | # Debug files 46 | *.dSYM/ 47 | *.su 48 | *.idb 49 | *.pdb 50 | 51 | # Kernel Module Compile Results 52 | *.mod* 53 | *.cmd 54 | .tmp_versions/ 55 | modules.order 56 | Module.symvers 57 | Mkfile.old 58 | dkms.conf 59 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 3 | project(Esp32Repartition) 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 John Mueller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Esp32Repartition - Fix old WLED ESP32 partition table devices via OTA 2 | 3 | This is a kinda basic hack for updating the partition table of an ESP32 device running [WLED](https://kno.wled.ge/) via OTA. 4 | This creates a 1536KB partition for app0 and app1. 5 | This is useful for devices that have an old partition table that doesn't have enough space for the latest WLED firmware. 6 | This is a workaround for the issue described in [this issue](https://github.com/Aircoookie/WLED/issues/4369). 7 | 8 | *Use at your own risk.* 9 | 10 | Risk: This can brick your ESP32 device and require a USB firmware reinstall. I am not responsible for any damage caused by this software. 11 | This code is not tested on many devices. Use at your own risk, really. 12 | Also, make sure your device doesn't randomly get rebooted / have bad power; 13 | if it stops at the wrong time (the window is short), it can disable your partition table and require a USB firmware reinstall. 14 | 15 | ## What it does 16 | 17 | 1. It will check that your partition table is in a supported order (anything, app0, app1, data); names don't matter. 18 | 2. It will check that the app0 partition is the one that is running. You can just reupdate this firmware if it's not, it will switch from app1 to app0. 19 | 3. It will erase the app1 and data partitions. *THIS WILL DELETE ALL DATA ON THESE PARTITIONS.* 20 | 4. It will resize the app0 and app1 partitions to 1536KB each. Shrinking the data partition. 21 | 5. It will recreate the checksum for the partitions. 22 | 6. It will reboot the device. 23 | 7. You can now install the latest WLED firmware via OTA. 24 | 8. Connect to 'WLED-AP' and set up your wifi. 25 | 9. Feel free to breathe again. 26 | 27 | ## Usage 28 | 29 | 1. Backup both `Prefixes` and `Configuration` from your WLED setup. This data will get lost. 30 | 2. Upload this [firmware](https://github.com/softplus/Esp32Repartition/releases) to your ESP32 device using the WLED firmware update page. 31 | 3. It will create an access point called `EPM-AP`, with password `wled1234`. Connect to it. 32 | 4. Go to `http://4.3.3.4/` in your browser. This will take you to the main menu. 33 | 7. Click `List partitions` to see the current partition table. 34 | It does a bunch of tests to make sure that your device is suitable for this. In particular: 35 | * It checks that you're in the first `app` partition. Otherwise just upload the same firmware again and try again. 36 | * It checks that the partition table is a supported layout (app0, app1, data). 37 | * It checks that the data partition has enough space. 38 | * It shows you the current partition table & the proposed new one. 39 | * FYI, example of a 'reasonable' partition table: 40 | ``` 41 | Partition: 42 | Addr: 0x00008000 43 | Type: 01, Subtype: 02, Addr: 0x00009000, Size: 0x00005000 (20K), Label: nvs 44 | Type: 01, Subtype: 00, Addr: 0x0000e000, Size: 0x00002000 (8K), Label: otadata 45 | Type: 00, Subtype: 10, Addr: 0x00010000, Size: 0x00140000 (1280K), Label: app0 46 | Type: 00, Subtype: 11, Addr: 0x00150000, Size: 0x00140000 (1280K), Label: app1 47 | Type: 01, Subtype: 82, Addr: 0x00290000, Size: 0x00170000 (1472K), Label: spiffs 48 | Running: Addr: 0x00010000, Label: app0 49 | Next: Addr: 0x00150000, Label: app1 50 | ``` 51 | 8. Click `Fix partitions`, and await the results. 52 | 9. If you're ok, it'll say ready on the bottom and reboot. 53 | Click `Download log` to save what you see to a local text file. 54 | If something breaks, you (or I) might find it useful. 55 | 10. Reload the page once reboot is complete. 56 | 11. Check `List partitions` to see if it worked. 57 | 12. Upload your desired firmware update. Connect to WLED's AP, set your wifi settings, restore prefixes and configuration. 58 | 13. Good luck. 59 | 60 | ## Building 61 | 62 | Setting everything up took a bit, but here's roughly how it works: 63 | 64 | 1. Clone this repo. 65 | 2. Open PlatformIO. Let it do its thing. It will install the ESP32 platform, etc. 66 | 3. In a command window, enter `pio run -t menuconfig`. This will open the ESP32 menuconfig. 67 | 4. Enable: `Arduino Configuration` -> `Autostart Arduino setup and loop on boot` 68 | 5. Set: `Component config` -> `SPI Flash driver` -> `Writing to dangerous flash regions` -> `Allowed` 69 | 6. Save and exit. 70 | 71 | Note you may need to follow the [workaround for Compile Error "esp32-arduino requires CONFIG_FREERTOS_HZ=1000 (currently 100)"](https://github.com/espressif/arduino-esp32/discussions/8375#discussioncomment-7908337) and manually tweak the `cmakelists.txt` file for the ESP32 platform in order to get this to compile. 72 | 73 | Now you can build and upload the firmware. 74 | Note uploading the firmware will reset your partition table to the old WLED partition table as shown in `partitions_old.csv`. 75 | This allows you to test the functionality. 76 | 77 | ## Supported devices 78 | 79 | This has only been tried on these devices. Your mileage may vary. Prepare the USB cable. 80 | 81 | * ESP32 DevKitC 82 | * D1 Mini ESP32 83 | 84 | ## Known issues 85 | 86 | ? Works for me. 87 | 88 | Potential to-dos: 89 | 90 | * Find a bunch of bootloaders & check their MD5 91 | 92 | ## Changes 93 | 94 | [Releases](https://github.com/softplus/Esp32Repartition/releases) 95 | 96 | * 2024-12-28: Release v0.4.0 97 | * Checks for encrypted flash & aborts if so 98 | * Added support to download app1 partition 99 | * Added timing of steps 100 | * 2024-12-27: Release v0.3.0 101 | * Add support for various configurations with min 2x app, 1x data 102 | * Move data partitions instead of deleting 103 | * 2024-12-27: Release v0.2.0 104 | * 2024-12-15: Initial release - v0.1.0 105 | 106 | ## My notes 107 | 108 | For releases: 109 | 110 | ```bash 111 | cp .pio/build/esp32dev/firmware.bin build/esp32-repart.bin 112 | ``` 113 | 114 | ## Other 115 | 116 | Licensed under the MIT license. 117 | [WLED](https://kno.wled.ge/) is awesome and you should check it out. 118 | 119 | *Disclaimer:* 120 | 121 | As per the MIT license, I assume no liability for any damage to you or any other person or equipment. 122 | -------------------------------------------------------------------------------- /build/esp32-repart.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softplus/Esp32Repartition/a894107eda7210bf157a889f421b33ea59de9ef1/build/esp32-repart.bin -------------------------------------------------------------------------------- /dependencies.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | idf: 3 | source: 4 | type: idf 5 | version: 5.1.4 6 | manifest_hash: 048889cfa6690d54a35525e70d563713f23b7321881fee7a9cf67bb7b6b0a170 7 | target: esp32 8 | version: 2.0.0 9 | -------------------------------------------------------------------------------- /include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /partitions/default_4mb.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv?plain=1 2 | # Should work. 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x140000, 7 | app1, app, ota_1, 0x150000,0x140000, 8 | spiffs, data, spiffs, 0x290000,0x160000, 9 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /partitions/huge_app.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/huge_app.csv?plain=1 2 | # Should fail: only 1 app partition 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x300000, 7 | spiffs, data, spiffs, 0x310000,0xE0000, 8 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /partitions/max_app_4mb.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/max_app_4MB.csv 2 | # Should fail: only one app partition 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, factory, 0x10000, 0x3E0000, 7 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /partitions/min_spiffs.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/min_spiffs.csv?plain=1 2 | # Should work 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x1E0000, 7 | app1, app, ota_1, 0x1F0000,0x1E0000, 8 | spiffs, data, spiffs, 0x3D0000,0x20000, 9 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /partitions/nofs.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/no_fs.csv?plain=1 2 | # Should fail, no data partition to shrink 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x140000, 7 | app1, app, ota_1, 0x200000,0x140000, 8 | coredump, data, coredump,0x3F0000,0x10000, 9 | # adjusted size manually to 0x140000 from 0x1F0000 to test -------------------------------------------------------------------------------- /partitions/previous.csv: -------------------------------------------------------------------------------- 1 | # from old device 2 | # should work. 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x140000, 7 | app1, app, ota_1, 0x150000,0x140000, 8 | spiffs, data, spiffs, 0x290000,0x170000, -------------------------------------------------------------------------------- /partitions/tinyuf2.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/tinyuf2-partitions-4MB.csv?plain=1 2 | # Should work. 3 | # ESP-IDF Partition Table 4 | # Name, Type, SubType, Offset, Size, Flags 5 | # bootloader.bin,, 0x1000, 32K 6 | # partition table, 0x8000, 4K 7 | 8 | nvs, data, nvs, 0x9000, 20K, 9 | otadata, data, ota, 0xe000, 8K, 10 | ota_0, app, ota_0, 0x10000, 1408K, 11 | ota_1, app, ota_1, 0x170000, 1408K, 12 | uf2, app, factory,0x2d0000, 256K, 13 | ffat, data, fat, 0x310000, 960K, -------------------------------------------------------------------------------- /partitions/zigbee.csv: -------------------------------------------------------------------------------- 1 | # https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/zigbee.csv?plain=1 2 | # Should work. 3 | # Name, Type, SubType, Offset, Size, Flags 4 | nvs, data, nvs, 0x9000, 0x5000, 5 | otadata, data, ota, 0xe000, 0x2000, 6 | app0, app, ota_0, 0x10000, 0x140000, 7 | app1, app, ota_1, 0x150000,0x140000, 8 | spiffs, data, spiffs, 0x290000,0x15B000, 9 | zb_storage, data, fat, 0x3EB000,0x4000, 10 | zb_fct, data, fat, 0x3EF000,0x1000, 11 | coredump, data, coredump,0x3F0000,0x10000, -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [platformio] 12 | default_envs = esp32dev 13 | 14 | [env:esp32dev] 15 | platform = platformio/espressif32 16 | framework = arduino, espidf 17 | board = esp32dev 18 | board_build.flash_mode = dout 19 | monitor_speed = 115200 20 | upload_speed = 921600 21 | 22 | ; library dependencies 23 | lib_deps = tzapu/WiFiManager 24 | 25 | # Note: We add CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED but it needs to 26 | # be set with esp-idf's menuconfig too. 27 | 28 | ; build flags 29 | build_flags = 30 | -Wno-sign-compare 31 | -Wno-unused-but-set-variable 32 | -Wno-unused-variable 33 | -fno-exceptions 34 | -D CORE_DEBUG_LEVEL=0 35 | -D NDEBUG 36 | -Wno-attributes 37 | -D FIRMWARE_VERSION='"0.4.0.${UNIX_TIME}"' 38 | -D CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=1 39 | 40 | ; unset these build flags 41 | build_unflags = 42 | -DCONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 43 | 44 | ; when locally installing, use the partitions like WLED used to have 45 | board_build.partitions = partitions/previous.csv # should work, basic -> it does 46 | # board_build.partitions = partitions/default_4mb.csv # should work -> it does 47 | # board_build.partitions = partitions/huge_app.csv # should fail, only 1 app -> it does 48 | # board_build.partitions = partitions/max_app_4mb.csv # should fail, only 1 app -> it does 49 | # board_build.partitions = partitions/min_spiffs.csv # should fail, already large enough -> it does 50 | # board_build.partitions = partitions/nofs.csv # should fail, too small data -> it does 51 | # board_build.partitions = partitions/tinyuf2.csv # should work, moves 2 data -> it does 52 | # board_build.partitions = partitions/zigbee.csv # should work -> it does 53 | -------------------------------------------------------------------------------- /sdkconfig: -------------------------------------------------------------------------------- 1 | CONFIG_FREERTOS_HZ=1000 2 | CONFIG_AUTOSTART_ARDUINO=y 3 | CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=y 4 | -------------------------------------------------------------------------------- /sdkconfig.esp32dev: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file. DO NOT EDIT. 3 | # Espressif IoT Development Framework (ESP-IDF) Project Configuration 4 | # 5 | CONFIG_IDF_CMAKE=y 6 | CONFIG_IDF_TARGET_ARCH_XTENSA=y 7 | CONFIG_IDF_TARGET="esp32" 8 | CONFIG_IDF_TARGET_ESP32=y 9 | CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 10 | 11 | # 12 | # SDK tool configuration 13 | # 14 | CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" 15 | # CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set 16 | # end of SDK tool configuration 17 | 18 | # 19 | # Build type 20 | # 21 | CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y 22 | # CONFIG_APP_BUILD_TYPE_ELF_RAM is not set 23 | CONFIG_APP_BUILD_GENERATE_BINARIES=y 24 | CONFIG_APP_BUILD_BOOTLOADER=y 25 | CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y 26 | # end of Build type 27 | 28 | # 29 | # Application manager 30 | # 31 | CONFIG_APP_COMPILE_TIME_DATE=y 32 | # CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set 33 | # CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set 34 | # CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set 35 | CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 36 | # end of Application manager 37 | 38 | # 39 | # Bootloader config 40 | # 41 | CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 42 | CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y 43 | # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set 44 | # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set 45 | # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set 46 | # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set 47 | # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set 48 | # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set 49 | CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y 50 | # CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set 51 | # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set 52 | CONFIG_BOOTLOADER_LOG_LEVEL=3 53 | 54 | # 55 | # Serial Flash Configurations 56 | # 57 | # CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set 58 | CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y 59 | # end of Serial Flash Configurations 60 | 61 | # CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set 62 | CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y 63 | # CONFIG_BOOTLOADER_FACTORY_RESET is not set 64 | # CONFIG_BOOTLOADER_APP_TEST is not set 65 | CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y 66 | CONFIG_BOOTLOADER_WDT_ENABLE=y 67 | # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set 68 | CONFIG_BOOTLOADER_WDT_TIME_MS=9000 69 | # CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set 70 | # CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set 71 | # CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set 72 | # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set 73 | CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 74 | # CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set 75 | # end of Bootloader config 76 | 77 | # 78 | # Security features 79 | # 80 | # CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set 81 | # CONFIG_SECURE_BOOT is not set 82 | # CONFIG_SECURE_FLASH_ENC_ENABLED is not set 83 | # end of Security features 84 | 85 | # 86 | # Serial flasher config 87 | # 88 | CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 89 | # CONFIG_ESPTOOLPY_NO_STUB is not set 90 | # CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set 91 | # CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set 92 | CONFIG_ESPTOOLPY_FLASHMODE_DIO=y 93 | # CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set 94 | CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y 95 | CONFIG_ESPTOOLPY_FLASHMODE="dio" 96 | # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set 97 | CONFIG_ESPTOOLPY_FLASHFREQ_40M=y 98 | # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set 99 | # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set 100 | CONFIG_ESPTOOLPY_FLASHFREQ="40m" 101 | # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set 102 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y 103 | # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set 104 | # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set 105 | # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set 106 | # CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set 107 | # CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set 108 | # CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set 109 | CONFIG_ESPTOOLPY_FLASHSIZE="2MB" 110 | CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y 111 | CONFIG_ESPTOOLPY_BEFORE_RESET=y 112 | # CONFIG_ESPTOOLPY_BEFORE_NORESET is not set 113 | CONFIG_ESPTOOLPY_BEFORE="default_reset" 114 | CONFIG_ESPTOOLPY_AFTER_RESET=y 115 | # CONFIG_ESPTOOLPY_AFTER_NORESET is not set 116 | CONFIG_ESPTOOLPY_AFTER="hard_reset" 117 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_CONSOLE is not set 118 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set 119 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set 120 | CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y 121 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set 122 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set 123 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set 124 | # CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set 125 | CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 126 | CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 127 | # end of Serial flasher config 128 | 129 | # 130 | # Partition Table 131 | # 132 | CONFIG_PARTITION_TABLE_SINGLE_APP=y 133 | # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set 134 | # CONFIG_PARTITION_TABLE_TWO_OTA is not set 135 | # CONFIG_PARTITION_TABLE_CUSTOM is not set 136 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 137 | CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" 138 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 139 | # CONFIG_PARTITION_TABLE_MD5 is not set 140 | # end of Partition Table 141 | 142 | # 143 | # Arduino Configuration 144 | # 145 | CONFIG_ARDUINO_VARIANT="esp32" 146 | CONFIG_ENABLE_ARDUINO_DEPENDS=y 147 | CONFIG_AUTOSTART_ARDUINO=y 148 | # CONFIG_ARDUINO_RUN_CORE0 is not set 149 | CONFIG_ARDUINO_RUN_CORE1=y 150 | # CONFIG_ARDUINO_RUN_NO_AFFINITY is not set 151 | CONFIG_ARDUINO_RUNNING_CORE=1 152 | CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 153 | # CONFIG_ARDUINO_EVENT_RUN_CORE0 is not set 154 | CONFIG_ARDUINO_EVENT_RUN_CORE1=y 155 | # CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set 156 | CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 157 | # CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0 is not set 158 | # CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set 159 | CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY=y 160 | CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=-1 161 | CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 162 | CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 163 | CONFIG_ARDUINO_UDP_RUN_CORE0=y 164 | # CONFIG_ARDUINO_UDP_RUN_CORE1 is not set 165 | # CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set 166 | CONFIG_ARDUINO_UDP_RUNNING_CORE=0 167 | CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 168 | # CONFIG_ARDUINO_ISR_IRAM is not set 169 | # CONFIG_DISABLE_HAL_LOCKS is not set 170 | 171 | # 172 | # Debug Log Configuration 173 | # 174 | # CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_NONE is not set 175 | CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR=y 176 | # CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_WARN is not set 177 | # CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_INFO is not set 178 | # CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_DEBUG is not set 179 | # CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_VERBOSE is not set 180 | CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL=1 181 | # CONFIG_ARDUHAL_LOG_COLORS is not set 182 | # CONFIG_ARDUHAL_ESP_LOG is not set 183 | # end of Debug Log Configuration 184 | 185 | CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT=y 186 | # CONFIG_ARDUHAL_PARTITION_SCHEME_MINIMAL is not set 187 | # CONFIG_ARDUHAL_PARTITION_SCHEME_NO_OTA is not set 188 | # CONFIG_ARDUHAL_PARTITION_SCHEME_HUGE_APP is not set 189 | # CONFIG_ARDUHAL_PARTITION_SCHEME_MIN_SPIFFS is not set 190 | CONFIG_ARDUHAL_PARTITION_SCHEME="default" 191 | # CONFIG_AUTOCONNECT_WIFI is not set 192 | # CONFIG_ARDUINO_SELECTIVE_COMPILATION is not set 193 | # end of Arduino Configuration 194 | 195 | # 196 | # Compiler options 197 | # 198 | CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y 199 | # CONFIG_COMPILER_OPTIMIZATION_SIZE is not set 200 | # CONFIG_COMPILER_OPTIMIZATION_PERF is not set 201 | # CONFIG_COMPILER_OPTIMIZATION_NONE is not set 202 | CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y 203 | # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set 204 | # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set 205 | CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 206 | # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set 207 | CONFIG_COMPILER_HIDE_PATHS_MACROS=y 208 | # CONFIG_COMPILER_CXX_EXCEPTIONS is not set 209 | # CONFIG_COMPILER_CXX_RTTI is not set 210 | CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y 211 | # CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set 212 | # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set 213 | # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set 214 | # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set 215 | # CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set 216 | # CONFIG_COMPILER_DUMP_RTL_FILES is not set 217 | # end of Compiler options 218 | 219 | # 220 | # Component config 221 | # 222 | 223 | # 224 | # Application Level Tracing 225 | # 226 | # CONFIG_APPTRACE_DEST_JTAG is not set 227 | CONFIG_APPTRACE_DEST_NONE=y 228 | CONFIG_APPTRACE_LOCK_ENABLE=y 229 | # end of Application Level Tracing 230 | 231 | # 232 | # ESP-ASIO 233 | # 234 | # CONFIG_ASIO_SSL_SUPPORT is not set 235 | # end of ESP-ASIO 236 | 237 | # 238 | # Bluetooth 239 | # 240 | # CONFIG_BT_ENABLED is not set 241 | # end of Bluetooth 242 | 243 | # 244 | # CoAP Configuration 245 | # 246 | CONFIG_COAP_MBEDTLS_PSK=y 247 | # CONFIG_COAP_MBEDTLS_PKI is not set 248 | # CONFIG_COAP_MBEDTLS_DEBUG is not set 249 | CONFIG_COAP_LOG_DEFAULT_LEVEL=0 250 | # end of CoAP Configuration 251 | 252 | # 253 | # Driver configurations 254 | # 255 | 256 | # 257 | # ADC configuration 258 | # 259 | # CONFIG_ADC_FORCE_XPD_FSM is not set 260 | CONFIG_ADC_DISABLE_DAC=y 261 | # end of ADC configuration 262 | 263 | # 264 | # MCPWM configuration 265 | # 266 | # CONFIG_MCPWM_ISR_IN_IRAM is not set 267 | # end of MCPWM configuration 268 | 269 | # 270 | # SPI configuration 271 | # 272 | # CONFIG_SPI_MASTER_IN_IRAM is not set 273 | CONFIG_SPI_MASTER_ISR_IN_IRAM=y 274 | # CONFIG_SPI_SLAVE_IN_IRAM is not set 275 | CONFIG_SPI_SLAVE_ISR_IN_IRAM=y 276 | # end of SPI configuration 277 | 278 | # 279 | # TWAI configuration 280 | # 281 | # CONFIG_TWAI_ISR_IN_IRAM is not set 282 | # CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set 283 | # CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set 284 | # CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set 285 | # CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set 286 | # CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM is not set 287 | # end of TWAI configuration 288 | 289 | # 290 | # UART configuration 291 | # 292 | # CONFIG_UART_ISR_IN_IRAM is not set 293 | # end of UART configuration 294 | 295 | # 296 | # RTCIO configuration 297 | # 298 | # CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set 299 | # end of RTCIO configuration 300 | 301 | # 302 | # GPIO Configuration 303 | # 304 | # CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set 305 | # end of GPIO Configuration 306 | 307 | # 308 | # GDMA Configuration 309 | # 310 | # CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set 311 | # CONFIG_GDMA_ISR_IRAM_SAFE is not set 312 | # end of GDMA Configuration 313 | # end of Driver configurations 314 | 315 | # 316 | # eFuse Bit Manager 317 | # 318 | # CONFIG_EFUSE_CUSTOM_TABLE is not set 319 | # CONFIG_EFUSE_VIRTUAL is not set 320 | # CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set 321 | CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y 322 | # CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set 323 | CONFIG_EFUSE_MAX_BLK_LEN=192 324 | # end of eFuse Bit Manager 325 | 326 | # 327 | # ESP-TLS 328 | # 329 | CONFIG_ESP_TLS_USING_MBEDTLS=y 330 | # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set 331 | # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set 332 | # CONFIG_ESP_TLS_SERVER is not set 333 | # CONFIG_ESP_TLS_PSK_VERIFICATION is not set 334 | # CONFIG_ESP_TLS_INSECURE is not set 335 | # end of ESP-TLS 336 | 337 | # 338 | # ESP32-specific 339 | # 340 | CONFIG_ESP32_REV_MIN_0=y 341 | # CONFIG_ESP32_REV_MIN_1 is not set 342 | # CONFIG_ESP32_REV_MIN_1_1 is not set 343 | # CONFIG_ESP32_REV_MIN_2 is not set 344 | # CONFIG_ESP32_REV_MIN_3 is not set 345 | # CONFIG_ESP32_REV_MIN_3_1 is not set 346 | CONFIG_ESP32_REV_MIN=0 347 | CONFIG_ESP32_REV_MIN_FULL=0 348 | CONFIG_ESP_REV_MIN_FULL=0 349 | CONFIG_ESP32_REV_MAX_FULL_STR_OPT=y 350 | CONFIG_ESP32_REV_MAX_FULL=399 351 | CONFIG_ESP_REV_MAX_FULL=399 352 | CONFIG_ESP32_DPORT_WORKAROUND=y 353 | # CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set 354 | CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y 355 | # CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set 356 | CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 357 | # CONFIG_ESP32_SPIRAM_SUPPORT is not set 358 | # CONFIG_ESP32_TRAX is not set 359 | CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 360 | # CONFIG_ESP32_ULP_COPROC_ENABLED is not set 361 | CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 362 | CONFIG_ESP32_DEBUG_OCDAWARE=y 363 | CONFIG_ESP32_BROWNOUT_DET=y 364 | CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y 365 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set 366 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set 367 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set 368 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set 369 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set 370 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set 371 | # CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set 372 | CONFIG_ESP32_BROWNOUT_DET_LVL=0 373 | CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y 374 | # CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set 375 | # CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set 376 | # CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set 377 | CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y 378 | # CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set 379 | # CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set 380 | # CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set 381 | CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 382 | CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 383 | CONFIG_ESP32_XTAL_FREQ_40=y 384 | # CONFIG_ESP32_XTAL_FREQ_26 is not set 385 | # CONFIG_ESP32_XTAL_FREQ_AUTO is not set 386 | CONFIG_ESP32_XTAL_FREQ=40 387 | # CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set 388 | # CONFIG_ESP32_NO_BLOBS is not set 389 | # CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set 390 | # CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set 391 | # CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set 392 | CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 393 | # end of ESP32-specific 394 | 395 | # 396 | # ADC-Calibration 397 | # 398 | CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y 399 | CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y 400 | CONFIG_ADC_CAL_LUT_ENABLE=y 401 | # end of ADC-Calibration 402 | 403 | # 404 | # Common ESP-related 405 | # 406 | CONFIG_ESP_ERR_TO_NAME_LOOKUP=y 407 | # end of Common ESP-related 408 | 409 | # 410 | # Ethernet 411 | # 412 | CONFIG_ETH_ENABLED=y 413 | CONFIG_ETH_USE_ESP32_EMAC=y 414 | CONFIG_ETH_PHY_INTERFACE_RMII=y 415 | CONFIG_ETH_RMII_CLK_INPUT=y 416 | # CONFIG_ETH_RMII_CLK_OUTPUT is not set 417 | CONFIG_ETH_RMII_CLK_IN_GPIO=0 418 | CONFIG_ETH_DMA_BUFFER_SIZE=512 419 | CONFIG_ETH_DMA_RX_BUFFER_NUM=10 420 | CONFIG_ETH_DMA_TX_BUFFER_NUM=10 421 | CONFIG_ETH_USE_SPI_ETHERNET=y 422 | # CONFIG_ETH_SPI_ETHERNET_DM9051 is not set 423 | # CONFIG_ETH_SPI_ETHERNET_W5500 is not set 424 | # CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set 425 | # CONFIG_ETH_USE_OPENETH is not set 426 | # end of Ethernet 427 | 428 | # 429 | # Event Loop Library 430 | # 431 | # CONFIG_ESP_EVENT_LOOP_PROFILING is not set 432 | CONFIG_ESP_EVENT_POST_FROM_ISR=y 433 | CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y 434 | # end of Event Loop Library 435 | 436 | # 437 | # GDB Stub 438 | # 439 | # end of GDB Stub 440 | 441 | # 442 | # ESP HTTP client 443 | # 444 | CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y 445 | # CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set 446 | CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH=y 447 | # end of ESP HTTP client 448 | 449 | # 450 | # HTTP Server 451 | # 452 | CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 453 | CONFIG_HTTPD_MAX_URI_LEN=512 454 | CONFIG_HTTPD_ERR_RESP_NO_DELAY=y 455 | CONFIG_HTTPD_PURGE_BUF_LEN=32 456 | # CONFIG_HTTPD_LOG_PURGE_DATA is not set 457 | # CONFIG_HTTPD_WS_SUPPORT is not set 458 | # end of HTTP Server 459 | 460 | # 461 | # ESP HTTPS OTA 462 | # 463 | # CONFIG_OTA_ALLOW_HTTP is not set 464 | # end of ESP HTTPS OTA 465 | 466 | # 467 | # ESP HTTPS server 468 | # 469 | # CONFIG_ESP_HTTPS_SERVER_ENABLE is not set 470 | # end of ESP HTTPS server 471 | 472 | # 473 | # Hardware Settings 474 | # 475 | 476 | # 477 | # MAC Config 478 | # 479 | CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y 480 | CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y 481 | CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y 482 | CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y 483 | # CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set 484 | CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y 485 | CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 486 | # CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set 487 | # end of MAC Config 488 | 489 | # 490 | # Sleep Config 491 | # 492 | CONFIG_ESP_SLEEP_POWER_DOWN_FLASH=y 493 | CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y 494 | # CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set 495 | # CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set 496 | CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y 497 | # end of Sleep Config 498 | 499 | # 500 | # RTC Clock Config 501 | # 502 | # end of RTC Clock Config 503 | # end of Hardware Settings 504 | 505 | # 506 | # IPC (Inter-Processor Call) 507 | # 508 | CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 509 | CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y 510 | CONFIG_ESP_IPC_ISR_ENABLE=y 511 | # end of IPC (Inter-Processor Call) 512 | 513 | # 514 | # LCD and Touch Panel 515 | # 516 | 517 | # 518 | # LCD Touch Drivers are maintained in the IDF Component Registry 519 | # 520 | 521 | # 522 | # LCD Peripheral Configuration 523 | # 524 | CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 525 | # end of LCD Peripheral Configuration 526 | # end of LCD and Touch Panel 527 | 528 | # 529 | # ESP NETIF Adapter 530 | # 531 | CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 532 | CONFIG_ESP_NETIF_TCPIP_LWIP=y 533 | # CONFIG_ESP_NETIF_LOOPBACK is not set 534 | CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y 535 | # end of ESP NETIF Adapter 536 | 537 | # 538 | # PHY 539 | # 540 | CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y 541 | # CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set 542 | CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 543 | CONFIG_ESP_PHY_MAX_TX_POWER=20 544 | CONFIG_ESP_PHY_REDUCE_TX_POWER=y 545 | CONFIG_ESP_PHY_RF_CAL_PARTIAL=y 546 | # CONFIG_ESP_PHY_RF_CAL_NONE is not set 547 | # CONFIG_ESP_PHY_RF_CAL_FULL is not set 548 | CONFIG_ESP_PHY_CALIBRATION_MODE=0 549 | # end of PHY 550 | 551 | # 552 | # Power Management 553 | # 554 | # CONFIG_PM_ENABLE is not set 555 | # end of Power Management 556 | 557 | # 558 | # ESP Ringbuf 559 | # 560 | # CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set 561 | # CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set 562 | # end of ESP Ringbuf 563 | 564 | # 565 | # ESP System Settings 566 | # 567 | # CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set 568 | CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y 569 | # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set 570 | # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set 571 | # CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set 572 | 573 | # 574 | # Memory protection 575 | # 576 | # end of Memory protection 577 | 578 | CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 579 | CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 580 | CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 581 | CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y 582 | # CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set 583 | # CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set 584 | CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 585 | CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 586 | CONFIG_ESP_CONSOLE_UART_DEFAULT=y 587 | # CONFIG_ESP_CONSOLE_UART_CUSTOM is not set 588 | # CONFIG_ESP_CONSOLE_NONE is not set 589 | CONFIG_ESP_CONSOLE_UART=y 590 | CONFIG_ESP_CONSOLE_MULTIPLE_UART=y 591 | CONFIG_ESP_CONSOLE_UART_NUM=0 592 | CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 593 | CONFIG_ESP_INT_WDT=y 594 | CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 595 | CONFIG_ESP_INT_WDT_CHECK_CPU1=y 596 | CONFIG_ESP_TASK_WDT=y 597 | # CONFIG_ESP_TASK_WDT_PANIC is not set 598 | CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 599 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 600 | CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 601 | # CONFIG_ESP_PANIC_HANDLER_IRAM is not set 602 | # CONFIG_ESP_DEBUG_STUBS_ENABLE is not set 603 | # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set 604 | CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y 605 | # end of ESP System Settings 606 | 607 | # 608 | # High resolution timer (esp_timer) 609 | # 610 | # CONFIG_ESP_TIMER_PROFILING is not set 611 | CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y 612 | CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y 613 | CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 614 | CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 615 | # CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set 616 | # CONFIG_ESP_TIMER_IMPL_FRC2 is not set 617 | CONFIG_ESP_TIMER_IMPL_TG0_LAC=y 618 | # end of High resolution timer (esp_timer) 619 | 620 | # 621 | # Wi-Fi 622 | # 623 | CONFIG_ESP32_WIFI_ENABLED=y 624 | CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 625 | CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 626 | # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set 627 | CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y 628 | CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 629 | CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 630 | CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y 631 | # CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set 632 | CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 633 | CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 634 | # CONFIG_ESP32_WIFI_CSI_ENABLED is not set 635 | CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y 636 | CONFIG_ESP32_WIFI_TX_BA_WIN=6 637 | CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y 638 | CONFIG_ESP32_WIFI_RX_BA_WIN=6 639 | CONFIG_ESP32_WIFI_NVS_ENABLED=y 640 | CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y 641 | # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set 642 | CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 643 | CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 644 | CONFIG_ESP32_WIFI_IRAM_OPT=y 645 | CONFIG_ESP32_WIFI_RX_IRAM_OPT=y 646 | CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y 647 | # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set 648 | # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set 649 | # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set 650 | CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y 651 | # CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set 652 | CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 653 | # end of Wi-Fi 654 | 655 | # 656 | # Core dump 657 | # 658 | # CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set 659 | # CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set 660 | CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y 661 | # end of Core dump 662 | 663 | # 664 | # FAT Filesystem support 665 | # 666 | # CONFIG_FATFS_CODEPAGE_DYNAMIC is not set 667 | CONFIG_FATFS_CODEPAGE_437=y 668 | # CONFIG_FATFS_CODEPAGE_720 is not set 669 | # CONFIG_FATFS_CODEPAGE_737 is not set 670 | # CONFIG_FATFS_CODEPAGE_771 is not set 671 | # CONFIG_FATFS_CODEPAGE_775 is not set 672 | # CONFIG_FATFS_CODEPAGE_850 is not set 673 | # CONFIG_FATFS_CODEPAGE_852 is not set 674 | # CONFIG_FATFS_CODEPAGE_855 is not set 675 | # CONFIG_FATFS_CODEPAGE_857 is not set 676 | # CONFIG_FATFS_CODEPAGE_860 is not set 677 | # CONFIG_FATFS_CODEPAGE_861 is not set 678 | # CONFIG_FATFS_CODEPAGE_862 is not set 679 | # CONFIG_FATFS_CODEPAGE_863 is not set 680 | # CONFIG_FATFS_CODEPAGE_864 is not set 681 | # CONFIG_FATFS_CODEPAGE_865 is not set 682 | # CONFIG_FATFS_CODEPAGE_866 is not set 683 | # CONFIG_FATFS_CODEPAGE_869 is not set 684 | # CONFIG_FATFS_CODEPAGE_932 is not set 685 | # CONFIG_FATFS_CODEPAGE_936 is not set 686 | # CONFIG_FATFS_CODEPAGE_949 is not set 687 | # CONFIG_FATFS_CODEPAGE_950 is not set 688 | CONFIG_FATFS_CODEPAGE=437 689 | CONFIG_FATFS_LFN_NONE=y 690 | # CONFIG_FATFS_LFN_HEAP is not set 691 | # CONFIG_FATFS_LFN_STACK is not set 692 | CONFIG_FATFS_FS_LOCK=0 693 | CONFIG_FATFS_TIMEOUT_MS=10000 694 | CONFIG_FATFS_PER_FILE_CACHE=y 695 | # CONFIG_FATFS_USE_FASTSEEK is not set 696 | # end of FAT Filesystem support 697 | 698 | # 699 | # Modbus configuration 700 | # 701 | CONFIG_FMB_COMM_MODE_TCP_EN=y 702 | CONFIG_FMB_TCP_PORT_DEFAULT=502 703 | CONFIG_FMB_TCP_PORT_MAX_CONN=5 704 | CONFIG_FMB_TCP_CONNECTION_TOUT_SEC=20 705 | CONFIG_FMB_COMM_MODE_RTU_EN=y 706 | CONFIG_FMB_COMM_MODE_ASCII_EN=y 707 | CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND=150 708 | CONFIG_FMB_MASTER_DELAY_MS_CONVERT=200 709 | CONFIG_FMB_QUEUE_LENGTH=20 710 | CONFIG_FMB_PORT_TASK_STACK_SIZE=4096 711 | CONFIG_FMB_SERIAL_BUF_SIZE=256 712 | CONFIG_FMB_SERIAL_ASCII_BITS_PER_SYMB=8 713 | CONFIG_FMB_SERIAL_ASCII_TIMEOUT_RESPOND_MS=1000 714 | CONFIG_FMB_PORT_TASK_PRIO=10 715 | # CONFIG_FMB_PORT_TASK_AFFINITY_NO_AFFINITY is not set 716 | CONFIG_FMB_PORT_TASK_AFFINITY_CPU0=y 717 | # CONFIG_FMB_PORT_TASK_AFFINITY_CPU1 is not set 718 | CONFIG_FMB_PORT_TASK_AFFINITY=0x0 719 | CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT=y 720 | CONFIG_FMB_CONTROLLER_SLAVE_ID=0x00112233 721 | CONFIG_FMB_CONTROLLER_NOTIFY_TIMEOUT=20 722 | CONFIG_FMB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 723 | CONFIG_FMB_CONTROLLER_STACK_SIZE=4096 724 | CONFIG_FMB_EVENT_QUEUE_TIMEOUT=20 725 | # CONFIG_FMB_TIMER_PORT_ENABLED is not set 726 | # CONFIG_FMB_TIMER_USE_ISR_DISPATCH_METHOD is not set 727 | # end of Modbus configuration 728 | 729 | # 730 | # FreeRTOS 731 | # 732 | # CONFIG_FREERTOS_UNICORE is not set 733 | CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF 734 | CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y 735 | CONFIG_FREERTOS_CORETIMER_0=y 736 | # CONFIG_FREERTOS_CORETIMER_1 is not set 737 | CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y 738 | CONFIG_FREERTOS_HZ=100 739 | CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y 740 | # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set 741 | # CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set 742 | CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y 743 | # CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set 744 | CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y 745 | CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 746 | CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y 747 | # CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set 748 | # CONFIG_FREERTOS_ASSERT_DISABLE is not set 749 | CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 750 | CONFIG_FREERTOS_ISR_STACKSIZE=1536 751 | # CONFIG_FREERTOS_LEGACY_HOOKS is not set 752 | CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 753 | CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y 754 | # CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set 755 | CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 756 | CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 757 | CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 758 | CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 759 | # CONFIG_FREERTOS_USE_TRACE_FACILITY is not set 760 | # CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set 761 | CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y 762 | CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y 763 | # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set 764 | # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set 765 | CONFIG_FREERTOS_DEBUG_OCDAWARE=y 766 | # CONFIG_FREERTOS_FPU_IN_ISR is not set 767 | CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y 768 | # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set 769 | # end of FreeRTOS 770 | 771 | # 772 | # Hardware Abstraction Layer (HAL) and Low Level (LL) 773 | # 774 | CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y 775 | # CONFIG_HAL_ASSERTION_DISABLE is not set 776 | # CONFIG_HAL_ASSERTION_SILIENT is not set 777 | # CONFIG_HAL_ASSERTION_ENABLE is not set 778 | CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 779 | # end of Hardware Abstraction Layer (HAL) and Low Level (LL) 780 | 781 | # 782 | # Heap memory debugging 783 | # 784 | CONFIG_HEAP_POISONING_DISABLED=y 785 | # CONFIG_HEAP_POISONING_LIGHT is not set 786 | # CONFIG_HEAP_POISONING_COMPREHENSIVE is not set 787 | CONFIG_HEAP_TRACING_OFF=y 788 | # CONFIG_HEAP_TRACING_STANDALONE is not set 789 | # CONFIG_HEAP_TRACING_TOHOST is not set 790 | # CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set 791 | # end of Heap memory debugging 792 | 793 | # 794 | # jsmn 795 | # 796 | # CONFIG_JSMN_PARENT_LINKS is not set 797 | # CONFIG_JSMN_STRICT is not set 798 | # end of jsmn 799 | 800 | # 801 | # libsodium 802 | # 803 | # end of libsodium 804 | 805 | # 806 | # Log output 807 | # 808 | # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set 809 | # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set 810 | # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set 811 | CONFIG_LOG_DEFAULT_LEVEL_INFO=y 812 | # CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set 813 | # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set 814 | CONFIG_LOG_DEFAULT_LEVEL=3 815 | CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y 816 | # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set 817 | # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set 818 | CONFIG_LOG_MAXIMUM_LEVEL=3 819 | CONFIG_LOG_COLORS=y 820 | CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y 821 | # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set 822 | # end of Log output 823 | 824 | # 825 | # LWIP 826 | # 827 | CONFIG_LWIP_LOCAL_HOSTNAME="espressif" 828 | # CONFIG_LWIP_NETIF_API is not set 829 | CONFIG_LWIP_TCPIP_TASK_PRIO=18 830 | # CONFIG_LWIP_TCPIP_CORE_LOCKING is not set 831 | # CONFIG_LWIP_CHECK_THREAD_SAFETY is not set 832 | CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y 833 | # CONFIG_LWIP_L2_TO_L3_COPY is not set 834 | # CONFIG_LWIP_IRAM_OPTIMIZATION is not set 835 | CONFIG_LWIP_TIMERS_ONDEMAND=y 836 | CONFIG_LWIP_MAX_SOCKETS=10 837 | # CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set 838 | # CONFIG_LWIP_SO_LINGER is not set 839 | CONFIG_LWIP_SO_REUSE=y 840 | CONFIG_LWIP_SO_REUSE_RXTOALL=y 841 | CONFIG_LWIP_SO_RCVBUF=y 842 | # CONFIG_LWIP_NETBUF_RECVINFO is not set 843 | CONFIG_LWIP_IP_DEFAULT_TTL=64 844 | CONFIG_LWIP_IP4_FRAG=y 845 | CONFIG_LWIP_IP6_FRAG=y 846 | # CONFIG_LWIP_IP4_REASSEMBLY is not set 847 | # CONFIG_LWIP_IP6_REASSEMBLY is not set 848 | # CONFIG_LWIP_IP_FORWARD is not set 849 | # CONFIG_LWIP_STATS is not set 850 | # CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set 851 | CONFIG_LWIP_ESP_GRATUITOUS_ARP=y 852 | CONFIG_LWIP_GARP_TMR_INTERVAL=60 853 | CONFIG_LWIP_ESP_MLDV6_REPORT=y 854 | CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 855 | CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 856 | CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y 857 | # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set 858 | CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y 859 | # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set 860 | CONFIG_LWIP_DHCP_OPTIONS_LEN=68 861 | CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 862 | 863 | # 864 | # DHCP server 865 | # 866 | CONFIG_LWIP_DHCPS=y 867 | CONFIG_LWIP_DHCPS_LEASE_UNIT=60 868 | CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 869 | # end of DHCP server 870 | 871 | # CONFIG_LWIP_AUTOIP is not set 872 | CONFIG_LWIP_IPV6=y 873 | # CONFIG_LWIP_IPV6_AUTOCONFIG is not set 874 | CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 875 | # CONFIG_LWIP_IPV6_FORWARD is not set 876 | # CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set 877 | CONFIG_LWIP_NETIF_LOOPBACK=y 878 | CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 879 | 880 | # 881 | # TCP 882 | # 883 | CONFIG_LWIP_MAX_ACTIVE_TCP=16 884 | CONFIG_LWIP_MAX_LISTENING_TCP=16 885 | CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y 886 | CONFIG_LWIP_TCP_MAXRTX=12 887 | CONFIG_LWIP_TCP_SYNMAXRTX=12 888 | CONFIG_LWIP_TCP_MSS=1440 889 | CONFIG_LWIP_TCP_TMR_INTERVAL=250 890 | CONFIG_LWIP_TCP_MSL=60000 891 | CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 892 | CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 893 | CONFIG_LWIP_TCP_WND_DEFAULT=5744 894 | CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 895 | CONFIG_LWIP_TCP_QUEUE_OOSEQ=y 896 | CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 897 | CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 898 | # CONFIG_LWIP_TCP_SACK_OUT is not set 899 | # CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set 900 | CONFIG_LWIP_TCP_OVERSIZE_MSS=y 901 | # CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set 902 | # CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set 903 | CONFIG_LWIP_TCP_RTO_TIME=1500 904 | # end of TCP 905 | 906 | # 907 | # UDP 908 | # 909 | CONFIG_LWIP_MAX_UDP_PCBS=16 910 | CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 911 | # end of UDP 912 | 913 | # 914 | # Checksums 915 | # 916 | # CONFIG_LWIP_CHECKSUM_CHECK_IP is not set 917 | # CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set 918 | CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y 919 | # end of Checksums 920 | 921 | CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 922 | CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y 923 | # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set 924 | # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set 925 | CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF 926 | # CONFIG_LWIP_PPP_SUPPORT is not set 927 | CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 928 | CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 929 | # CONFIG_LWIP_SLIP_SUPPORT is not set 930 | 931 | # 932 | # ICMP 933 | # 934 | CONFIG_LWIP_ICMP=y 935 | # CONFIG_LWIP_MULTICAST_PING is not set 936 | # CONFIG_LWIP_BROADCAST_PING is not set 937 | # end of ICMP 938 | 939 | # 940 | # LWIP RAW API 941 | # 942 | CONFIG_LWIP_MAX_RAW_PCBS=16 943 | # end of LWIP RAW API 944 | 945 | # 946 | # SNTP 947 | # 948 | CONFIG_LWIP_SNTP_MAX_SERVERS=1 949 | # CONFIG_LWIP_DHCP_GET_NTP_SRV is not set 950 | CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 951 | # end of SNTP 952 | 953 | # 954 | # DNS 955 | # 956 | CONFIG_LWIP_DNS_MAX_SERVERS=3 957 | # CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set 958 | # end of DNS 959 | 960 | CONFIG_LWIP_ESP_LWIP_ASSERT=y 961 | 962 | # 963 | # Hooks 964 | # 965 | # CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set 966 | CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y 967 | # CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set 968 | CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y 969 | # CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set 970 | # CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set 971 | CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y 972 | # CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set 973 | # CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set 974 | CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y 975 | # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set 976 | # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set 977 | # end of Hooks 978 | 979 | # CONFIG_LWIP_DEBUG is not set 980 | # end of LWIP 981 | 982 | # 983 | # mbedTLS 984 | # 985 | CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y 986 | # CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set 987 | # CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set 988 | CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y 989 | CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 990 | CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 991 | # CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set 992 | # CONFIG_MBEDTLS_DEBUG is not set 993 | 994 | # 995 | # mbedTLS v2.28.x related 996 | # 997 | # CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set 998 | # CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set 999 | # CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set 1000 | CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y 1001 | # end of mbedTLS v2.28.x related 1002 | 1003 | # 1004 | # Certificate Bundle 1005 | # 1006 | CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y 1007 | CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y 1008 | # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set 1009 | # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set 1010 | # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set 1011 | CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 1012 | # end of Certificate Bundle 1013 | 1014 | # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set 1015 | # CONFIG_MBEDTLS_CMAC_C is not set 1016 | CONFIG_MBEDTLS_HARDWARE_AES=y 1017 | CONFIG_MBEDTLS_HARDWARE_MPI=y 1018 | CONFIG_MBEDTLS_HARDWARE_SHA=y 1019 | CONFIG_MBEDTLS_ROM_MD5=y 1020 | # CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set 1021 | # CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set 1022 | CONFIG_MBEDTLS_HAVE_TIME=y 1023 | # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set 1024 | CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y 1025 | CONFIG_MBEDTLS_SHA512_C=y 1026 | CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y 1027 | # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set 1028 | # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set 1029 | # CONFIG_MBEDTLS_TLS_DISABLED is not set 1030 | CONFIG_MBEDTLS_TLS_SERVER=y 1031 | CONFIG_MBEDTLS_TLS_CLIENT=y 1032 | CONFIG_MBEDTLS_TLS_ENABLED=y 1033 | 1034 | # 1035 | # TLS Key Exchange Methods 1036 | # 1037 | # CONFIG_MBEDTLS_PSK_MODES is not set 1038 | CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y 1039 | CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y 1040 | CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y 1041 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y 1042 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y 1043 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y 1044 | CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y 1045 | # end of TLS Key Exchange Methods 1046 | 1047 | CONFIG_MBEDTLS_SSL_RENEGOTIATION=y 1048 | # CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set 1049 | CONFIG_MBEDTLS_SSL_PROTO_TLS1=y 1050 | CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y 1051 | CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y 1052 | # CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set 1053 | # CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set 1054 | CONFIG_MBEDTLS_SSL_ALPN=y 1055 | CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y 1056 | CONFIG_MBEDTLS_X509_CHECK_KEY_USAGE=y 1057 | CONFIG_MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE=y 1058 | CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y 1059 | 1060 | # 1061 | # Symmetric Ciphers 1062 | # 1063 | CONFIG_MBEDTLS_AES_C=y 1064 | # CONFIG_MBEDTLS_CAMELLIA_C is not set 1065 | # CONFIG_MBEDTLS_DES_C is not set 1066 | CONFIG_MBEDTLS_RC4_DISABLED=y 1067 | # CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set 1068 | # CONFIG_MBEDTLS_RC4_ENABLED is not set 1069 | # CONFIG_MBEDTLS_BLOWFISH_C is not set 1070 | # CONFIG_MBEDTLS_XTEA_C is not set 1071 | CONFIG_MBEDTLS_CCM_C=y 1072 | CONFIG_MBEDTLS_GCM_C=y 1073 | # CONFIG_MBEDTLS_NIST_KW_C is not set 1074 | # end of Symmetric Ciphers 1075 | 1076 | # CONFIG_MBEDTLS_RIPEMD160_C is not set 1077 | 1078 | # 1079 | # Certificates 1080 | # 1081 | CONFIG_MBEDTLS_PEM_PARSE_C=y 1082 | CONFIG_MBEDTLS_PEM_WRITE_C=y 1083 | CONFIG_MBEDTLS_X509_CRL_PARSE_C=y 1084 | CONFIG_MBEDTLS_X509_CSR_PARSE_C=y 1085 | # end of Certificates 1086 | 1087 | CONFIG_MBEDTLS_ECP_C=y 1088 | CONFIG_MBEDTLS_ECDH_C=y 1089 | CONFIG_MBEDTLS_ECDSA_C=y 1090 | # CONFIG_MBEDTLS_ECJPAKE_C is not set 1091 | CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y 1092 | CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y 1093 | CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y 1094 | CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y 1095 | CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y 1096 | CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y 1097 | CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y 1098 | CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y 1099 | CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y 1100 | CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y 1101 | CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y 1102 | CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y 1103 | CONFIG_MBEDTLS_ECP_NIST_OPTIM=y 1104 | # CONFIG_MBEDTLS_POLY1305_C is not set 1105 | # CONFIG_MBEDTLS_CHACHA20_C is not set 1106 | # CONFIG_MBEDTLS_HKDF_C is not set 1107 | # CONFIG_MBEDTLS_THREADING_C is not set 1108 | # CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set 1109 | # CONFIG_MBEDTLS_SECURITY_RISKS is not set 1110 | # end of mbedTLS 1111 | 1112 | # 1113 | # mDNS 1114 | # 1115 | CONFIG_MDNS_MAX_SERVICES=10 1116 | CONFIG_MDNS_TASK_PRIORITY=1 1117 | CONFIG_MDNS_TASK_STACK_SIZE=4096 1118 | # CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set 1119 | CONFIG_MDNS_TASK_AFFINITY_CPU0=y 1120 | # CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set 1121 | CONFIG_MDNS_TASK_AFFINITY=0x0 1122 | CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 1123 | # CONFIG_MDNS_STRICT_MODE is not set 1124 | CONFIG_MDNS_TIMER_PERIOD_MS=100 1125 | # CONFIG_MDNS_NETWORKING_SOCKET is not set 1126 | CONFIG_MDNS_MULTIPLE_INSTANCE=y 1127 | # end of mDNS 1128 | 1129 | # 1130 | # ESP-MQTT Configurations 1131 | # 1132 | CONFIG_MQTT_PROTOCOL_311=y 1133 | CONFIG_MQTT_TRANSPORT_SSL=y 1134 | CONFIG_MQTT_TRANSPORT_WEBSOCKET=y 1135 | CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y 1136 | # CONFIG_MQTT_MSG_ID_INCREMENTAL is not set 1137 | # CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set 1138 | # CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set 1139 | # CONFIG_MQTT_USE_CUSTOM_CONFIG is not set 1140 | # CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set 1141 | # CONFIG_MQTT_CUSTOM_OUTBOX is not set 1142 | # end of ESP-MQTT Configurations 1143 | 1144 | # 1145 | # Newlib 1146 | # 1147 | CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y 1148 | # CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set 1149 | # CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set 1150 | # CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set 1151 | # CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set 1152 | CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y 1153 | # CONFIG_NEWLIB_NANO_FORMAT is not set 1154 | # end of Newlib 1155 | 1156 | # 1157 | # NVS 1158 | # 1159 | # CONFIG_NVS_ASSERT_ERROR_CHECK is not set 1160 | # end of NVS 1161 | 1162 | # 1163 | # OpenSSL 1164 | # 1165 | # CONFIG_OPENSSL_DEBUG is not set 1166 | CONFIG_OPENSSL_ERROR_STACK=y 1167 | # CONFIG_OPENSSL_ASSERT_DO_NOTHING is not set 1168 | CONFIG_OPENSSL_ASSERT_EXIT=y 1169 | # end of OpenSSL 1170 | 1171 | # 1172 | # OpenThread 1173 | # 1174 | # CONFIG_OPENTHREAD_ENABLED is not set 1175 | # end of OpenThread 1176 | 1177 | # 1178 | # PThreads 1179 | # 1180 | CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 1181 | CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 1182 | CONFIG_PTHREAD_STACK_MIN=768 1183 | CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y 1184 | # CONFIG_PTHREAD_DEFAULT_CORE_0 is not set 1185 | # CONFIG_PTHREAD_DEFAULT_CORE_1 is not set 1186 | CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 1187 | CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" 1188 | # end of PThreads 1189 | 1190 | # 1191 | # Main Flash configuration 1192 | # 1193 | 1194 | # 1195 | # Optional and Experimental Features (READ DOCS FIRST) 1196 | # 1197 | 1198 | # 1199 | # Features here require specific hardware (READ DOCS FIRST!) 1200 | # 1201 | # end of Optional and Experimental Features (READ DOCS FIRST) 1202 | # end of Main Flash configuration 1203 | 1204 | # 1205 | # SPI Flash driver 1206 | # 1207 | # CONFIG_SPI_FLASH_VERIFY_WRITE is not set 1208 | # CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set 1209 | CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y 1210 | # CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS is not set 1211 | # CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set 1212 | CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=y 1213 | # CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set 1214 | # CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set 1215 | # CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set 1216 | CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y 1217 | CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 1218 | CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 1219 | CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 1220 | # CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set 1221 | # CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set 1222 | # CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set 1223 | 1224 | # 1225 | # Auto-detect flash chips 1226 | # 1227 | CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y 1228 | CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y 1229 | CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y 1230 | CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y 1231 | # CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set 1232 | # CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set 1233 | # end of Auto-detect flash chips 1234 | 1235 | CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y 1236 | # end of SPI Flash driver 1237 | 1238 | # 1239 | # SPIFFS Configuration 1240 | # 1241 | CONFIG_SPIFFS_MAX_PARTITIONS=3 1242 | 1243 | # 1244 | # SPIFFS Cache Configuration 1245 | # 1246 | CONFIG_SPIFFS_CACHE=y 1247 | CONFIG_SPIFFS_CACHE_WR=y 1248 | # CONFIG_SPIFFS_CACHE_STATS is not set 1249 | # end of SPIFFS Cache Configuration 1250 | 1251 | CONFIG_SPIFFS_PAGE_CHECK=y 1252 | CONFIG_SPIFFS_GC_MAX_RUNS=10 1253 | # CONFIG_SPIFFS_GC_STATS is not set 1254 | CONFIG_SPIFFS_PAGE_SIZE=256 1255 | CONFIG_SPIFFS_OBJ_NAME_LEN=32 1256 | # CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set 1257 | CONFIG_SPIFFS_USE_MAGIC=y 1258 | CONFIG_SPIFFS_USE_MAGIC_LENGTH=y 1259 | CONFIG_SPIFFS_META_LENGTH=4 1260 | CONFIG_SPIFFS_USE_MTIME=y 1261 | 1262 | # 1263 | # Debug Configuration 1264 | # 1265 | # CONFIG_SPIFFS_DBG is not set 1266 | # CONFIG_SPIFFS_API_DBG is not set 1267 | # CONFIG_SPIFFS_GC_DBG is not set 1268 | # CONFIG_SPIFFS_CACHE_DBG is not set 1269 | # CONFIG_SPIFFS_CHECK_DBG is not set 1270 | # CONFIG_SPIFFS_TEST_VISUALISATION is not set 1271 | # end of Debug Configuration 1272 | # end of SPIFFS Configuration 1273 | 1274 | # 1275 | # TCP Transport 1276 | # 1277 | 1278 | # 1279 | # Websocket 1280 | # 1281 | CONFIG_WS_TRANSPORT=y 1282 | CONFIG_WS_BUFFER_SIZE=1024 1283 | # end of Websocket 1284 | # end of TCP Transport 1285 | 1286 | # 1287 | # Unity unit testing library 1288 | # 1289 | CONFIG_UNITY_ENABLE_FLOAT=y 1290 | CONFIG_UNITY_ENABLE_DOUBLE=y 1291 | # CONFIG_UNITY_ENABLE_64BIT is not set 1292 | # CONFIG_UNITY_ENABLE_COLOR is not set 1293 | CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y 1294 | # CONFIG_UNITY_ENABLE_FIXTURE is not set 1295 | # CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set 1296 | # end of Unity unit testing library 1297 | 1298 | # 1299 | # Root Hub configuration 1300 | # 1301 | # end of Root Hub configuration 1302 | 1303 | # 1304 | # Virtual file system 1305 | # 1306 | CONFIG_VFS_SUPPORT_IO=y 1307 | CONFIG_VFS_SUPPORT_DIR=y 1308 | CONFIG_VFS_SUPPORT_SELECT=y 1309 | CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y 1310 | CONFIG_VFS_SUPPORT_TERMIOS=y 1311 | 1312 | # 1313 | # Host File System I/O (Semihosting) 1314 | # 1315 | CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 1316 | # end of Host File System I/O (Semihosting) 1317 | # end of Virtual file system 1318 | 1319 | # 1320 | # Wear Levelling 1321 | # 1322 | # CONFIG_WL_SECTOR_SIZE_512 is not set 1323 | CONFIG_WL_SECTOR_SIZE_4096=y 1324 | CONFIG_WL_SECTOR_SIZE=4096 1325 | # end of Wear Levelling 1326 | 1327 | # 1328 | # Wi-Fi Provisioning Manager 1329 | # 1330 | CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 1331 | CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 1332 | CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y 1333 | # end of Wi-Fi Provisioning Manager 1334 | 1335 | # 1336 | # Supplicant 1337 | # 1338 | CONFIG_WPA_MBEDTLS_CRYPTO=y 1339 | # CONFIG_WPA_WAPI_PSK is not set 1340 | # CONFIG_WPA_SUITE_B_192 is not set 1341 | # CONFIG_WPA_DEBUG_PRINT is not set 1342 | # CONFIG_WPA_TESTING_OPTIONS is not set 1343 | # CONFIG_WPA_WPS_STRICT is not set 1344 | # CONFIG_WPA_11KV_SUPPORT is not set 1345 | # CONFIG_WPA_MBO_SUPPORT is not set 1346 | # CONFIG_WPA_DPP_SUPPORT is not set 1347 | # end of Supplicant 1348 | # end of Component config 1349 | 1350 | # 1351 | # Compatibility options 1352 | # 1353 | # CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set 1354 | # end of Compatibility options 1355 | 1356 | # Deprecated options for backward compatibility 1357 | CONFIG_TOOLPREFIX="xtensa-esp32-elf-" 1358 | # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set 1359 | # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set 1360 | # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set 1361 | CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y 1362 | # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set 1363 | # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set 1364 | CONFIG_LOG_BOOTLOADER_LEVEL=3 1365 | # CONFIG_APP_ROLLBACK_ENABLE is not set 1366 | # CONFIG_FLASH_ENCRYPTION_ENABLED is not set 1367 | # CONFIG_FLASHMODE_QIO is not set 1368 | # CONFIG_FLASHMODE_QOUT is not set 1369 | CONFIG_FLASHMODE_DIO=y 1370 | # CONFIG_FLASHMODE_DOUT is not set 1371 | # CONFIG_MONITOR_BAUD_9600B is not set 1372 | # CONFIG_MONITOR_BAUD_57600B is not set 1373 | CONFIG_MONITOR_BAUD_115200B=y 1374 | # CONFIG_MONITOR_BAUD_230400B is not set 1375 | # CONFIG_MONITOR_BAUD_921600B is not set 1376 | # CONFIG_MONITOR_BAUD_2MB is not set 1377 | # CONFIG_MONITOR_BAUD_OTHER is not set 1378 | CONFIG_MONITOR_BAUD_OTHER_VAL=115200 1379 | CONFIG_MONITOR_BAUD=115200 1380 | CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y 1381 | # CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set 1382 | CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y 1383 | # CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set 1384 | # CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set 1385 | CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 1386 | # CONFIG_CXX_EXCEPTIONS is not set 1387 | CONFIG_STACK_CHECK_NONE=y 1388 | # CONFIG_STACK_CHECK_NORM is not set 1389 | # CONFIG_STACK_CHECK_STRONG is not set 1390 | # CONFIG_STACK_CHECK_ALL is not set 1391 | # CONFIG_WARN_WRITE_STRINGS is not set 1392 | # CONFIG_DISABLE_GCC8_WARNINGS is not set 1393 | # CONFIG_ESP32_APPTRACE_DEST_TRAX is not set 1394 | CONFIG_ESP32_APPTRACE_DEST_NONE=y 1395 | CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y 1396 | CONFIG_ADC2_DISABLE_DAC=y 1397 | # CONFIG_SPIRAM_SUPPORT is not set 1398 | CONFIG_TRACEMEM_RESERVE_DRAM=0x0 1399 | # CONFIG_ULP_COPROC_ENABLED is not set 1400 | CONFIG_ULP_COPROC_RESERVE_MEM=0 1401 | CONFIG_BROWNOUT_DET=y 1402 | CONFIG_BROWNOUT_DET_LVL_SEL_0=y 1403 | # CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set 1404 | # CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set 1405 | # CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set 1406 | # CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set 1407 | # CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set 1408 | # CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set 1409 | # CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set 1410 | CONFIG_BROWNOUT_DET_LVL=0 1411 | CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y 1412 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set 1413 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set 1414 | # CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set 1415 | # CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set 1416 | # CONFIG_NO_BLOBS is not set 1417 | # CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set 1418 | # CONFIG_EVENT_LOOP_PROFILING is not set 1419 | CONFIG_POST_EVENTS_FROM_ISR=y 1420 | CONFIG_POST_EVENTS_FROM_IRAM_ISR=y 1421 | # CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set 1422 | CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y 1423 | CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 1424 | CONFIG_ESP_SYSTEM_PD_FLASH=y 1425 | # CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set 1426 | CONFIG_IPC_TASK_STACK_SIZE=1536 1427 | CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y 1428 | # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set 1429 | CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 1430 | CONFIG_ESP32_PHY_MAX_TX_POWER=20 1431 | CONFIG_ESP32_REDUCE_PHY_TX_POWER=y 1432 | # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set 1433 | CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y 1434 | # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set 1435 | # CONFIG_ESP32S2_PANIC_GDBSTUB is not set 1436 | CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 1437 | CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 1438 | CONFIG_MAIN_TASK_STACK_SIZE=3584 1439 | CONFIG_CONSOLE_UART_DEFAULT=y 1440 | # CONFIG_CONSOLE_UART_CUSTOM is not set 1441 | # CONFIG_ESP_CONSOLE_UART_NONE is not set 1442 | CONFIG_CONSOLE_UART=y 1443 | CONFIG_CONSOLE_UART_NUM=0 1444 | CONFIG_CONSOLE_UART_BAUDRATE=115200 1445 | CONFIG_INT_WDT=y 1446 | CONFIG_INT_WDT_TIMEOUT_MS=300 1447 | CONFIG_INT_WDT_CHECK_CPU1=y 1448 | CONFIG_TASK_WDT=y 1449 | # CONFIG_TASK_WDT_PANIC is not set 1450 | CONFIG_TASK_WDT_TIMEOUT_S=5 1451 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y 1452 | CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y 1453 | # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set 1454 | CONFIG_TIMER_TASK_STACK_SIZE=3584 1455 | # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set 1456 | # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set 1457 | CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y 1458 | CONFIG_MB_MASTER_TIMEOUT_MS_RESPOND=150 1459 | CONFIG_MB_MASTER_DELAY_MS_CONVERT=200 1460 | CONFIG_MB_QUEUE_LENGTH=20 1461 | CONFIG_MB_SERIAL_TASK_STACK_SIZE=4096 1462 | CONFIG_MB_SERIAL_BUF_SIZE=256 1463 | CONFIG_MB_SERIAL_TASK_PRIO=10 1464 | CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=y 1465 | CONFIG_MB_CONTROLLER_SLAVE_ID=0x00112233 1466 | CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20 1467 | CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20 1468 | CONFIG_MB_CONTROLLER_STACK_SIZE=4096 1469 | CONFIG_MB_EVENT_QUEUE_TIMEOUT=20 1470 | # CONFIG_MB_TIMER_PORT_ENABLED is not set 1471 | # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set 1472 | CONFIG_TIMER_TASK_PRIORITY=1 1473 | CONFIG_TIMER_TASK_STACK_DEPTH=2048 1474 | CONFIG_TIMER_QUEUE_LENGTH=10 1475 | # CONFIG_L2_TO_L3_COPY is not set 1476 | # CONFIG_USE_ONLY_LWIP_SELECT is not set 1477 | CONFIG_ESP_GRATUITOUS_ARP=y 1478 | CONFIG_GARP_TMR_INTERVAL=60 1479 | CONFIG_TCPIP_RECVMBOX_SIZE=32 1480 | CONFIG_TCP_MAXRTX=12 1481 | CONFIG_TCP_SYNMAXRTX=12 1482 | CONFIG_TCP_MSS=1440 1483 | CONFIG_TCP_MSL=60000 1484 | CONFIG_TCP_SND_BUF_DEFAULT=5744 1485 | CONFIG_TCP_WND_DEFAULT=5744 1486 | CONFIG_TCP_RECVMBOX_SIZE=6 1487 | CONFIG_TCP_QUEUE_OOSEQ=y 1488 | # CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set 1489 | CONFIG_TCP_OVERSIZE_MSS=y 1490 | # CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set 1491 | # CONFIG_TCP_OVERSIZE_DISABLE is not set 1492 | CONFIG_UDP_RECVMBOX_SIZE=6 1493 | CONFIG_TCPIP_TASK_STACK_SIZE=3072 1494 | CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y 1495 | # CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set 1496 | # CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set 1497 | CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF 1498 | # CONFIG_PPP_SUPPORT is not set 1499 | CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 1500 | CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 1501 | CONFIG_ESP32_PTHREAD_STACK_MIN=768 1502 | CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y 1503 | # CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set 1504 | # CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set 1505 | CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 1506 | CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" 1507 | # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS is not set 1508 | # CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set 1509 | CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=y 1510 | CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y 1511 | CONFIG_SUPPORT_TERMIOS=y 1512 | CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 1513 | # End of deprecated options 1514 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file was automatically generated for projects 2 | # without default 'CMakeLists.txt' file. 3 | 4 | FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*) 5 | 6 | idf_component_register(SRCS ${app_sources}) 7 | -------------------------------------------------------------------------------- /src/device_info.cpp: -------------------------------------------------------------------------------- 1 | #include "device_info.h" 2 | #include "part_mgr.h" 3 | #include "main.h" 4 | 5 | #include 6 | #include "Esp.h" 7 | #include 8 | #include 9 | #include 10 | 11 | // from Esp.cpp 12 | uint32_t ESP_getFlashChipId(void); 13 | 14 | // wrapper for ESP32/ESP8266 15 | uint32_t _ESP_getFlashChipSize(void) { 16 | #ifdef ESP32 17 | return ESP.getFlashChipSize(); 18 | #endif // ESP32 19 | #ifdef ESP8266 20 | return ESP.getFlashChipRealSize(); 21 | #endif // ESP8266 22 | return 0; 23 | } 24 | 25 | void getDeviceInfo(char* info, size_t infoSize) { 26 | uint32_t chipId = 0; 27 | for(int i=0; i<17; i=i+8) { 28 | chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i; 29 | } 30 | 31 | snprintf(info, infoSize, 32 | "Build %s - %s %s\n" 33 | "ESP SDK %s / %u (%s)\n" 34 | "Flash chip ID / Size: 0x%x / %u KB\n" 35 | "Program heap / size: %u KB / %u KB", 36 | FIRMWARE_VERSION, __DATE__, __TIME__, 37 | ESP.getSdkVersion(), chipId, ESP.getChipModel(), 38 | ESP_getFlashChipId(), _ESP_getFlashChipSize()/1024, 39 | ESP.getHeapSize()/1024, ESP.getSketchSize()/1024); 40 | } 41 | 42 | // get MD5 of bootloader 43 | void getBootloaderMd5(char *output_buffer, size_t output_buffer_size) { 44 | if (output_buffer_size < (ESP_ROM_MD5_DIGEST_LEN * 2 + 4)) { 45 | snprintf(output_buffer, output_buffer_size, "Buffer too small\n"); 46 | return; 47 | } 48 | char md5_buf[ESP_ROM_MD5_DIGEST_LEN]; 49 | MD5Builder _md5 = MD5Builder(); 50 | _md5.begin(); 51 | 52 | uint8_t partition_buffer[SPI_FLASH_SEC_SIZE]; 53 | for (uint32_t addr = 0x1000; addr < getPartitionTableAddr(); addr += SPI_FLASH_SEC_SIZE) { 54 | if (spi_flash_read(addr, partition_buffer, SPI_FLASH_SEC_SIZE) != ESP_OK) { 55 | snprintf(output_buffer, output_buffer_size, "Failed to read flash at offset 0x%x\n", addr); 56 | DEBUG_PRINT(output_buffer); 57 | return; 58 | } 59 | _md5.add(partition_buffer, SPI_FLASH_SEC_SIZE); 60 | } 61 | 62 | _md5.calculate(); 63 | _md5.getBytes((uint8_t*)(md5_buf)); 64 | 65 | // Get hex version of MD5, format kinda 66 | for (int i = 0; i < 16; i++) { 67 | snprintf(output_buffer + i * 2 + (i / 4), output_buffer_size - i * 2 - (i / 4), "%02x", (uint8_t)md5_buf[i]); 68 | if ((i + 1) % 4 == 0 && i != 15) { 69 | output_buffer[(i + 1) * 2 + (i / 4)] = ' '; 70 | } 71 | } 72 | output_buffer[32 + 3] = '\0'; // Null-terminate the string 73 | } 74 | -------------------------------------------------------------------------------- /src/device_info.h: -------------------------------------------------------------------------------- 1 | #ifndef DEVICE_INFO_H 2 | #define DEVICE_INFO_H 3 | 4 | #include 5 | 6 | void getDeviceInfo(char* info, size_t infoSize); 7 | void getBootloaderMd5(char *output_buffer, size_t output_buffer_size); 8 | 9 | #endif // DEVICE_INFO_H -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Main loop, setup, and server callbacks for the ESP32Repartition 3 | * @author John Mueller (softplus@gmail.com) 4 | * @version 0.1 5 | * @date 2024-12-15 6 | * 7 | * @copyright Copyright (c) 2024 8 | * @license MIT 9 | */ 10 | 11 | /** 12 | * Creates a new wifi access point called 'EPM-AP', with password 'wled1234', and IP 4.3.3.4 13 | * You can list the partition table, and try to 'fix' it (resizes app0, app1 to 0x180000 bytes = 1536K) 14 | * 15 | * Steps: 16 | * 1. Upload this code 17 | * 2. Connect to EPM-AP, set your actual wifi, it'll reboot 18 | * 3. Find the IP of the device, and connect to it. 19 | * 4. Click 'Fix partitions', and await the results. 20 | * .. if you're ok, it'll say ready on the bottom and reboot 21 | * 5. Reconnect to EPM-AP, set your wifi again, it'll reboot 22 | * 6. Find the IP of the device (should be the same), and connect to it. 23 | * 7. Upload your desired firmware update 24 | * 8. Good luck. 25 | * 26 | * Note: This only works if the current partition is app0. 27 | * If it's app1, you need to upload a firmware update first (it can be this one). 28 | * 29 | * Note 2: It expects a partition table with app0, app1, data in that order, nothing behind it. 30 | * 31 | * Note 3: It empties app1 & data partitions, and resizes app0 & app1. 32 | * 33 | * This: https://github.com/softplus/Esp32Repartition 34 | * WLED: https://kno.wled.ge/ & https://github.com/Aircoookie/WLED 35 | * PlatformIO: https://platformio.org/ 36 | * WiFiManager: https://github.com/tzapu/WiFiManager 37 | * 38 | */ 39 | 40 | #include 41 | #include 42 | #include "main.h" 43 | #include "part_mgr.h" 44 | #include "device_info.h" 45 | 46 | WiFiManager wm; 47 | 48 | void bindServerCallback(); 49 | void handlePartitionRead(); 50 | void handlePartitionFix(); 51 | void handleDownloadFlash(size_t start, size_t end, const char *filename); 52 | void handleDownloadBootloader(); 53 | void handleDownloadPartition(); 54 | void handleDownloadApp1(); 55 | 56 | // bind the server callbacks 57 | void bindServerCallback(){ 58 | wm.server->on("/partition-read", handlePartitionRead); 59 | wm.server->on("/partition-fix", handlePartitionFix); 60 | wm.server->on("/bootloader-download", handleDownloadBootloader); 61 | wm.server->on("/partition-download", handleDownloadPartition); 62 | wm.server->on("/app1-download", handleDownloadApp1); 63 | } 64 | 65 | // Downloads a memory section 66 | void handleDownloadFlash(size_t start, size_t end, const char *filename) { 67 | DEBUG_PRINT("Downloading...\n"); 68 | char buf[SPI_FLASH_SEC_SIZE]; 69 | wm.server->setContentLength(CONTENT_LENGTH_UNKNOWN); 70 | snprintf(buf, sizeof(buf), "attachment; filename=%s", filename); 71 | wm.server->sendHeader("Content-Disposition", buf); 72 | wm.server->send(200, "application/octet-stream", ""); 73 | for (uint32_t addr = start; addrsendContent(buf, SPI_FLASH_SEC_SIZE); 80 | } 81 | DEBUG_PRINT("Done.\n"); 82 | } 83 | 84 | // Downloads the bootloader 85 | void handleDownloadBootloader() { 86 | size_t boot_addr = 0x1000; 87 | size_t boot_end = getPartitionTableAddr(); 88 | handleDownloadFlash(boot_addr, boot_end, "current-bootloader.bin"); 89 | } 90 | 91 | // Downloads the partition table 92 | void handleDownloadPartition() { 93 | size_t part_addr = getPartitionTableAddr(); 94 | handleDownloadFlash(part_addr, part_addr+SPI_FLASH_SEC_SIZE, "current-partition.bin"); 95 | } 96 | 97 | // Downloads the second app partition (likely where the old firmware was) 98 | // Downloading app0 makes no sense (it's this code) 99 | void handleDownloadApp1() { 100 | esp_partition_t part; 101 | getPartitionApp1(&part); 102 | handleDownloadFlash(part.address, part.address+part.size, "current-app1.bin"); 103 | } 104 | 105 | // handle the /partition-read route 106 | void handlePartitionRead() { 107 | wm.server->setContentLength(CONTENT_LENGTH_UNKNOWN); 108 | wm.server->send(200, "text/html", ""); 109 | wm.server->sendContent(HTML_INTRO); 110 | partition_mgr_fix(wm.server, true); 111 | wm.server->sendContent(HTML_OUTRO); 112 | } 113 | 114 | // handle the /partition-fix route 115 | void handlePartitionFix() { 116 | wm.server->setContentLength(CONTENT_LENGTH_UNKNOWN); 117 | wm.server->send(200, "text/html", ""); 118 | wm.server->sendContent(HTML_INTRO); 119 | partition_mgr_fix(wm.server, false); 120 | wm.server->sendContent(HTML_OUTRO); // unless we already rebooted, lol 121 | } 122 | 123 | // main setup function 124 | void setup() 125 | { 126 | Serial.begin(115200); 127 | Serial.println("Starting ESP32Repartition"); 128 | 129 | // setup WifiManager for AP, custom menu 130 | bool res; 131 | wm.setTitle("Esp32Repartition"); 132 | std::vector menu_ids = {"custom"}; 133 | wm.setMenu(menu_ids); 134 | 135 | wm.setCustomMenuHTML( 136 | "" 139 | "

" 140 | "

" 141 | "

" 142 | "[ More ]

" 149 | "Esp32Repartition on Github
" 150 | "" 151 | ); 152 | 153 | wm.setWebServerCallback(bindServerCallback); 154 | 155 | // Similar AP setup as WLED, but AP is 'EPM-AP', password 'wled1234', and IP 4.3.3.4 156 | wm.setAPStaticIPConfig(IPAddress(4,3,3,4), IPAddress(4,3,3,4), IPAddress(255,255,255,0)); // set ip,gw,sn 157 | res = wm.autoConnect("EPM-AP", "wled1234"); 158 | 159 | if(!res) { 160 | Serial.println("Failed to connect"); 161 | // ESP.restart(); // I mean, who really knows what to do. Retry & hope for the best. 162 | } else { 163 | Serial.println("Connected to Wifi!"); 164 | } 165 | wm.startWebPortal(); // Continue to run portal 166 | } 167 | 168 | // If you're watching the serial, this will tell you it's still working. 169 | void watchdog_loop() { 170 | static uint32_t nextTime = 0; 171 | if (millis() > nextTime) { 172 | DEBUG_PRINT("."); 173 | nextTime = millis() + 30000; 174 | } 175 | } 176 | 177 | // main loop function 178 | void loop() { 179 | watchdog_loop(); 180 | wm.process(); // maintain portal 181 | } 182 | -------------------------------------------------------------------------------- /src/main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | // Include necessary libraries 5 | #include 6 | 7 | // This is what the app partitions will be resized to. 8 | // Adjust this as needed. 9 | // Note that you cannot shrink app partitions, you can only expand them. 10 | // All app partitions will be made the same size. 11 | // The biggest data partition will be shrunk do adjust. 12 | // Partitions may be moved as needed. 13 | #define RESIZE_APP_PARTITION_SIZE 0x180000 // (1536K) 14 | // ^^^ adjust this as needed ^^^ 15 | // 16 | 17 | #define DEBUG_MODE // or comment out to disable debug output 18 | #define DEBUGOUT Serial // where to send debug output 19 | 20 | #ifdef DEBUG_MODE 21 | #define DEBUG_PRINT(x) DEBUGOUT.print(x) 22 | #define DEBUG_PRINTLN(x) DEBUGOUT.println(x) 23 | #define DEBUG_PRINTF(x...) DEBUGOUT.printf(x) 24 | #else 25 | #define DEBUG_PRINT(x) 26 | #define DEBUG_PRINTLN(x) 27 | #define DEBUG_PRINTF(x...) 28 | #endif 29 | 30 | // used to output log as HTML 31 | #define HTML_INTRO F("" \ 32 | "" \ 33 | "" \ 34 | "ESP32Repartition
")
35 | 
36 | #define HTML_OUTRO F("
" \ 37 | "" \ 43 | "
Need a record? Save this log locally: " \ 44 | "\n") 45 | 46 | #endif // MAIN_H -------------------------------------------------------------------------------- /src/part_mgr.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file part_mgr.cpp 3 | * @copyright Copyright (c) 2024 John Mueller 4 | * @brief This does the bulk of the partion management aka resizing. Very hacky. 5 | */ 6 | 7 | #include "esp_spi_flash.h" 8 | #include "esp_ota_ops.h" 9 | #include "esp_flash_encrypt.h" 10 | #include "esp_image_format.h" 11 | #include "main.h" 12 | #include "part_mgr.h" 13 | #include "utils.h" 14 | #include "device_info.h" 15 | #include 16 | 17 | // no-idea-dog.jpg 18 | 19 | // Definitions from the ESP SDK & from poking around. 20 | #define PARTITION_TABLE_SIZE 0x0C00 21 | #define MAX_NUMBER_OF_PARTITIONS 10 // arbitrary, we just want to be sure we have things ok 22 | 23 | typedef struct { 24 | uint16_t magic_id; /*!< It's magic */ 25 | uint8_t type; /*!< partition type (app/data) */ 26 | uint8_t subtype; /*!< partition subtype */ 27 | uint32_t address; /*!< starting address of the partition in flash */ 28 | uint32_t size; /*!< size of the partition, in bytes */ 29 | char label[17]; /*!< partition label, zero-terminated ASCII string */ 30 | bool encrypted; /*!< flag is set to true if partition is encrypted */ 31 | bool readonly; /*!< flag is set to true if partition is read-only */ 32 | } _my_esp_partition_t; // <- structure in partition table, from ESP SDK 33 | 34 | 35 | typedef struct { 36 | uint32_t address_old; 37 | uint32_t address_new; 38 | uint32_t size_old; 39 | uint32_t size_new; 40 | bool action_erase; 41 | bool action_move; 42 | } _my_partition_planner_t; 43 | 44 | // get the address of the partition table; either 0x8000 or 0x9000; 0=failed 45 | size_t getPartitionTableAddr() { 46 | // we're looking for "AA 50" 47 | static size_t cached_addr = 0; 48 | if (cached_addr != 0) { 49 | return cached_addr; 50 | } 51 | uint8_t b_buffer[4]; 52 | for (size_t addr = 0x8000; addr < 0xA000; addr += 0x1000) { 53 | DEBUG_PRINTF("Checking for partition table at 0x%08x\n", addr); 54 | esp_err_t err = spi_flash_read(addr, b_buffer, sizeof(b_buffer)); 55 | if (err != ESP_OK) { 56 | continue; 57 | } 58 | if (b_buffer[0] == 0xAA && b_buffer[1] == 0x50) { 59 | cached_addr = addr; 60 | return addr; 61 | } 62 | } 63 | DEBUG_PRINT("ERROR: Partition table not found.\n"); 64 | return 0; // we got nothing, not even an error 65 | } 66 | 67 | // simple debugging & output display 68 | void _add_output(std::unique_ptr & ws, const char *str) { 69 | ws->sendContent(str, strlen(str)); 70 | DEBUG_PRINT(str); 71 | }; 72 | void _add_output(std::unique_ptr & ws, const String& str) { 73 | _add_output(ws, str.c_str()); 74 | }; 75 | 76 | // gets the second app partition table entry 77 | void getPartitionApp1(esp_partition_t *part) { 78 | const esp_partition_t* p_next = esp_ota_get_next_update_partition(NULL); 79 | if (p_next == NULL) { 80 | return; 81 | } 82 | memcpy(part, p_next, sizeof(esp_partition_t)); 83 | } 84 | 85 | // Expand app partitions to our ideal size, output to response 86 | void partition_mgr_fix(std::unique_ptr & ws, bool test_only) { 87 | char c_buffer[256]; 88 | 89 | // 1. confirm first app partition is active 90 | // 2. Check if partition table findable 91 | // 3. copy partition table to local buffer 92 | // 4. confirm that order is app, app, data; else fail 93 | // 5. calculate new data partition size 94 | // 6. erase data partition, app1 partition 95 | // 7. write partition table 96 | // 8. reboot. 97 | 98 | // show device info 99 | getDeviceInfo(c_buffer, sizeof(c_buffer)); // get hardware info 100 | _add_output(ws, c_buffer); 101 | _add_output(ws, "\n"); 102 | snprintf(c_buffer, sizeof(c_buffer), "Partition table address: 0x%x\n", getPartitionTableAddr()); 103 | _add_output(ws, c_buffer); 104 | getBootloaderMd5(c_buffer, sizeof(c_buffer)); 105 | _add_output(ws, F("Bootloader MD5: ")); 106 | _add_output(ws, c_buffer); 107 | _add_output(ws, "\n\n"); 108 | 109 | // info text 110 | if (!test_only) { 111 | _add_output(ws, "NOTE: If you do not see a line with 'Ready' at the end,\nthis process didn't work.\n\n"); 112 | } 113 | 114 | // Check for flash encryption - we can't do anything if it's encrypted 115 | // Rewriting the partition table will brick your device. 116 | if (esp_flash_encryption_enabled()) { 117 | _add_output(ws, "ERROR: Flash encryption is enabled. Can't continue.\n"); 118 | return; 119 | } 120 | 121 | // 1. confirm first app partition is active 122 | const esp_partition_t* p_running = esp_ota_get_running_partition(); 123 | const esp_partition_t* p_next = esp_ota_get_next_update_partition(NULL); 124 | if (p_next == NULL) { 125 | _add_output(ws, "ERROR: There is only one app partition.\n"); 126 | return; 127 | } 128 | if (p_running->address > p_next->address) { 129 | _add_output(ws, "ERROR: YOU MUST UPLOAD THE FIRMWARE AGAIN.\n"); 130 | _add_output(ws, "The current partition is not the first one.\n"); 131 | _add_output(ws, "Upload firmware again\n"); 132 | return; 133 | } 134 | _add_output(ws, "Current app parition is first: OK\n"); 135 | 136 | // 2. Check if partition table findable 137 | if (getPartitionTableAddr() == 0) { 138 | _add_output(ws, "ERROR: Partition table not found. Can't continue.\n"); 139 | return; 140 | } 141 | 142 | // 3. Copy partition table to local buffer 143 | _add_output(ws, "Reading partition table...\n"); 144 | char *partition_buffer = (char *)malloc(SPI_FLASH_SEC_SIZE+1); 145 | if (partition_buffer == NULL) { 146 | _add_output(ws, "Failed to allocate memory for partition buffer\n"); 147 | return; 148 | } 149 | _my_esp_partition_t *partitions[MAX_NUMBER_OF_PARTITIONS] = {NULL}; 150 | esp_err_t err = 151 | spi_flash_read(getPartitionTableAddr(), partition_buffer, SPI_FLASH_SEC_SIZE); 152 | if (err != ESP_OK) { 153 | snprintf(c_buffer, sizeof(c_buffer), "Failed to read partition table: 0x%x\n", err); 154 | _add_output(ws, c_buffer); 155 | free(partition_buffer); 156 | return; 157 | } 158 | 159 | // separate out partitions 160 | _add_output(ws, "Splitting partitions out...\n"); 161 | unsigned short partition_count = 0; 162 | size_t md5_offset = 0; 163 | 164 | for (size_t offset = 0; offset < SPI_FLASH_SEC_SIZE; offset += 32) { 165 | if ((*(partition_buffer+offset)==0xAA) && (*(partition_buffer+offset+1)==0x50)) { 166 | partitions[partition_count] = (_my_esp_partition_t*)(partition_buffer + offset); 167 | partition_count++; 168 | if (partition_count>MAX_NUMBER_OF_PARTITIONS) break; 169 | } else if ((*(partition_buffer+offset)==0xEB) && (*(partition_buffer+offset+1)==0xEB)) { 170 | md5_offset = offset; 171 | } 172 | } 173 | _add_output(ws, "Created local copy of partiton table: OK\n"); 174 | for (int i=0; itype, partitions[i]->subtype, partitions[i]->address, partitions[i]->size, (int)(partitions[i]->size/1024), partitions[i]->label); 177 | _add_output(ws, c_buffer); 178 | } 179 | _add_output(ws, "\n"); 180 | 181 | // 4. Confirm we have min 2x app, and min 1 data 182 | int app_count = 0, data_count = 0; 183 | for (int i=0; itype == ESP_PARTITION_TYPE_APP) { 185 | app_count++; 186 | } else if (partitions[i]->type == ESP_PARTITION_TYPE_DATA) { 187 | data_count++; 188 | } 189 | } 190 | if ((app_count < 2) || (data_count < 1)) { 191 | _add_output(ws, "ERROR: Need 2+ app, 1+ data partitions; can't continue.\n"); 192 | free(partition_buffer); 193 | return; 194 | } 195 | 196 | // make planning copy 197 | _my_partition_planner_t planner[MAX_NUMBER_OF_PARTITIONS]; 198 | for (int i=0; iaddress; 200 | planner[i].size_old = partitions[i]->size; 201 | // defaults 202 | planner[i].address_new = 0; planner[i].size_new = 0; 203 | planner[i].action_erase = false; planner[i].action_move = false; 204 | } 205 | 206 | // plan to resize app partitions 207 | uint32_t size_delta = 0; 208 | int first_app_index = -1; 209 | for (int i=0; itype == ESP_PARTITION_TYPE_APP && 211 | (partitions[i]->subtype == ESP_PARTITION_SUBTYPE_APP_OTA_0 || 212 | partitions[i]->subtype == ESP_PARTITION_SUBTYPE_APP_OTA_1)) { 213 | if (partitions[i]->size < RESIZE_APP_PARTITION_SIZE) { 214 | size_delta += RESIZE_APP_PARTITION_SIZE - partitions[i]->size; 215 | planner[i].size_new = RESIZE_APP_PARTITION_SIZE; 216 | if (first_app_index == -1) { 217 | first_app_index = i; 218 | } else { 219 | planner[i].action_erase = true; 220 | } 221 | } 222 | } 223 | } 224 | if (size_delta == 0) { 225 | _add_output(ws, "UNNECESSARY: App partitions are already ideal size.\n"); 226 | _add_output(ws, "READY TO GO - upload the firmware you want.\n"); 227 | _add_output(ws, "Upload new firmware\n"); 228 | free(partition_buffer); 229 | return; 230 | } 231 | 232 | // find biggest data partition to shrink 233 | int biggest_data_index = 0; uint32_t biggest_data_size = 0; 234 | for (int i=0; itype == ESP_PARTITION_TYPE_DATA) { 236 | if (partitions[i]->size > biggest_data_size) { 237 | biggest_data_size = partitions[i]->size; 238 | biggest_data_index = i; 239 | } 240 | } 241 | } 242 | if (biggest_data_size < size_delta) { 243 | _add_output(ws, "ERROR: Data partition is not large enough.\n"); 244 | free(partition_buffer); 245 | return; 246 | } 247 | planner[biggest_data_index].size_new = biggest_data_size - size_delta; 248 | 249 | // iterate through all partitions 250 | uint32_t address_offset = 0; 251 | for (int i=0; i0) { 253 | planner[i].address_new = planner[i].address_old + address_offset; 254 | if (!planner[i].action_erase) { 255 | planner[i].action_move = true; 256 | if (!planner[i].size_new) planner[i].size_new = planner[i].size_old; 257 | } 258 | } 259 | if (planner[i].size_new != 0) { 260 | address_offset += planner[i].size_new - planner[i].size_old; 261 | } 262 | } 263 | _add_output(ws, "Partition table has 2+x app, 1+x data: OK\n"); 264 | 265 | // 5. update partition table based on new addresses + sizes 266 | for (int i=0; iaddress = planner[i].address_new; 269 | } 270 | if (planner[i].size_new != 0) { 271 | partitions[i]->size = planner[i].size_new; 272 | } 273 | } 274 | 275 | // show new partition table 276 | _add_output(ws, "New partition table:\n"); 277 | for (int i=0; itype, partitions[i]->subtype, partitions[i]->address, partitions[i]->size, (int)(partitions[i]->size/1024), partitions[i]->label); 280 | _add_output(ws, c_buffer); 281 | } 282 | 283 | if (test_only) { 284 | _add_output(ws, "\nEverything looks good! Try it for real now!\n"); 285 | free(partition_buffer); 286 | return; 287 | } 288 | _add_output(ws, "\nDoing the work now...\n"); 289 | 290 | // calculate md5 of new partition table 291 | MD5Builder _md5 = MD5Builder(); 292 | _md5.begin(); 293 | _md5.add((uint8_t*)partition_buffer, md5_offset); 294 | _md5.calculate(); 295 | _md5.getBytes((uint8_t*)(partition_buffer + md5_offset + 16)); 296 | 297 | // write partition table buffer back to flash 298 | unsigned long time_start = micros(); 299 | _add_output(ws, "Erasing partition table...\n"); 300 | err = spi_flash_erase_range(getPartitionTableAddr(), SPI_FLASH_SEC_SIZE); 301 | if (err != ESP_OK) { 302 | snprintf(c_buffer, sizeof(c_buffer), "Failed to erase partition table: 0x%x\n", err); 303 | _add_output(ws, c_buffer); 304 | free(partition_buffer); 305 | return; 306 | } 307 | _add_output(ws, "Writing partition table...\n"); 308 | err = spi_flash_write(getPartitionTableAddr(), partition_buffer, SPI_FLASH_SEC_SIZE); 309 | if (err != ESP_OK) { 310 | snprintf(c_buffer, sizeof(c_buffer), "Failed to write partition table: 0x%x\n", err); 311 | _add_output(ws, c_buffer); 312 | free(partition_buffer); 313 | return; 314 | } 315 | unsigned long time_end = micros(); 316 | snprintf(c_buffer, sizeof(c_buffer), " ... Partition table written in %lu ms\n", (time_end-time_start)/1000); 317 | _add_output(ws, c_buffer); 318 | 319 | uint8_t* move_buffer = (uint8_t*)malloc(SPI_FLASH_SEC_SIZE); 320 | if (move_buffer == NULL) { 321 | snprintf(c_buffer, sizeof(c_buffer), "Failed to allocate memory for buffer\n"); 322 | _add_output(ws, c_buffer); 323 | free(partition_buffer); 324 | return; 325 | } 326 | 327 | // time to clean up partitions 328 | for (int i = partition_count - 1; i >= 0; i--) { 329 | if (planner[i].action_erase) { 330 | snprintf(c_buffer, sizeof(c_buffer), "Erasing partition %i at 0x%x, length 0x%x\n", 331 | i, planner[i].address_new, planner[i].size_new); 332 | _add_output(ws, c_buffer); 333 | time_start = micros(); 334 | err = spi_flash_erase_range(planner[i].address_old, planner[i].size_old); 335 | if (err != ESP_OK) { 336 | snprintf(c_buffer, sizeof(c_buffer), "Failed to erase partition: 0x%x\n", err); 337 | _add_output(ws, c_buffer); 338 | } else { 339 | time_end = micros(); 340 | snprintf(c_buffer, sizeof(c_buffer), " ... Partition erased in %lu ms\n", (time_end-time_start)/1000); 341 | _add_output(ws, c_buffer); 342 | } 343 | } 344 | 345 | if (planner[i].action_move && (planner[i].address_new!=planner[i].address_old)) { 346 | snprintf(c_buffer, sizeof(c_buffer), "Moving partition %i from 0x%x to 0x%x length 0x%x ...\n ", 347 | i, planner[i].address_old, planner[i].address_new, planner[i].size_new); 348 | _add_output(ws, c_buffer); 349 | int counter = 0; 350 | time_start = micros(); 351 | for (int32_t j = planner[i].size_new - SPI_FLASH_SEC_SIZE; j >= 0; j -= SPI_FLASH_SEC_SIZE) { 352 | snprintf(c_buffer, sizeof(c_buffer), "0x%x ", planner[i].address_old + j); 353 | _add_output(ws, c_buffer); 354 | counter++; if (counter % 8 == 0) _add_output(ws, "\n "); 355 | err = spi_flash_read(planner[i].address_old + j, move_buffer, SPI_FLASH_SEC_SIZE); 356 | if (err != ESP_OK) { 357 | snprintf(c_buffer, sizeof(c_buffer), "Failed to read partition chunk: 0x%x\n", err); 358 | _add_output(ws, c_buffer); 359 | free(move_buffer); 360 | free(partition_buffer); 361 | break; 362 | } 363 | err = spi_flash_erase_range(planner[i].address_new+j, SPI_FLASH_SEC_SIZE); 364 | if (err != ESP_OK) { 365 | snprintf(c_buffer, sizeof(c_buffer), "Failed to erase partition: 0x%x\n", err); 366 | _add_output(ws, c_buffer); 367 | // whatever, we will continue 368 | } 369 | err = spi_flash_write(planner[i].address_new + j, move_buffer, SPI_FLASH_SEC_SIZE); 370 | if (err != ESP_OK) { 371 | snprintf(c_buffer, sizeof(c_buffer), "Failed to write partition chunk: 0x%x\n", err); 372 | _add_output(ws, c_buffer); 373 | // we will also continue 374 | } 375 | } 376 | if (counter % 8 != 0) _add_output(ws, "\n "); 377 | time_end = micros(); 378 | snprintf(c_buffer, sizeof(c_buffer), "... Partition moved %i sectors in %lu ms (%lu ms/sector)\n", 379 | counter, (time_end-time_start)/1000, (time_end-time_start)/(1000*counter)); 380 | _add_output(ws, c_buffer); 381 | } 382 | } 383 | free(move_buffer); 384 | 385 | _add_output(ws, "Partitions erased / moved: OK\n"); 386 | 387 | _add_output(ws, "Partition table updated.\n\n"); 388 | _add_output(ws, "READY! After reboot, upload the firmware that you need.\n\n"); 389 | 390 | _add_output(ws, "Rebooting...\n"); 391 | _add_output(ws, "\n"); 392 | _add_output(ws, HTML_OUTRO); // unless we already rebooted, lol 393 | 394 | time_start = millis(); 395 | while (millis() - time_start < 2000) delay(100); // non-blocking delay 396 | 397 | _add_output(ws, "\n"); // sometimes it just doesn't send the rest. this is a hack. 398 | free(partition_buffer); 399 | 400 | // send results 401 | ESP.restart(); 402 | } 403 | -------------------------------------------------------------------------------- /src/part_mgr.h: -------------------------------------------------------------------------------- 1 | #ifndef PART_MGR_H 2 | #define PART_MGR_H 3 | 4 | #include "WebServer.h" 5 | 6 | size_t getPartitionTableAddr(); 7 | void partition_mgr_fix(std::unique_ptr & ws, bool test_only); 8 | void getPartitionApp1(esp_partition_t *part); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /src/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | // dump a memory block to a char[] as hex, for debugging 4 | void hex_dump(char *output, int max_len, const uint8_t *data, unsigned int data_len) { 5 | static const char hex_chars[] = "0123456789abcdef"; 6 | int lines = data_len / 16; 7 | int needed_len = lines * 65 + 1; 8 | 9 | if (max_len < needed_len) { 10 | output[0] = '\0'; 11 | return; 12 | } 13 | 14 | char *ptr = output; 15 | for (int i = 0; i < data_len; i++) { 16 | // Hex part 17 | *ptr++ = hex_chars[data[i] >> 4]; 18 | *ptr++ = hex_chars[data[i] & 0x0F]; 19 | *ptr++ = ' '; 20 | 21 | // At end of line, add ASCII 22 | if ((i + 1) % 16 == 0) { 23 | const uint8_t *line = data + i - 15; 24 | for (int j = 0; j < 16; j++) { 25 | *ptr++ = (line[j] >= 32 && line[j] <= 126) ? line[j] : '.'; 26 | } 27 | *ptr++ = '\n'; 28 | } 29 | } 30 | *ptr = '\0'; 31 | } -------------------------------------------------------------------------------- /src/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H 2 | #define UTILS_H 3 | 4 | // Utility functions and definitions 5 | #include "main.h" 6 | 7 | void hex_dump(char *output, int max_len, const uint8_t *data, unsigned int data_len); 8 | 9 | #endif // UTILS_H -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | --------------------------------------------------------------------------------