-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[debug] Add ESP32 partition table logging to dump_config
#8012
Conversation
This enhances the `DebugComponent` by adding functionality to log detailed partition table information during the `dump_config()` process. The partition table details are displayed in a clean, aligned format, providing developers with clear insights into the device's flash memory layout. #### **Features:** 1. Logs the following attributes for each partition: - Name - Type - Subtype - Start Address - Size 2. Uses the `esp_partition` API for ESP32 devices running either Arduino or ESP-IDF. 3. Ensures alignment of columns for improved readability. #### **Example Log Output:** ``` [23:37:05][C][debug:033]: Partition table: [23:37:05][C][debug:034]: Name Type Subtype Address Size [23:37:05][C][debug:038]: nvs 1 2 0x00009000 0x00005000 [23:37:05][C][debug:038]: otadata 1 0 0x0000E000 0x00002000 [23:37:05][C][debug:038]: app0 0 16 0x00010000 0x003C0000 [23:37:05][C][debug:038]: app1 0 17 0x003D0000 0x003C0000 [23:37:05][C][debug:038]: eeprom 1 153 0x00790000 0x00001000 [23:37:05][C][debug:038]: spiffs 1 130 0x00791000 0x0000F000 ``` #### **Why This Change is Useful:** 1. **Improved Debugging:** Developers can verify partition configurations directly from logs, without requiring physical access or external tools. 2. **Diagnostic Aid:** Identifies potential issues related to insufficient partition sizes or incorrect layouts. 3. **Consistency:** Provides a clear and formatted output to improve log readability. #### **Implementation Details:** - **Platform-Specific:** The feature is implemented for ESP32 devices using the ESP-IDF framework. - **Formatted Output:** Ensures aligned columns using fixed-width formatting for better clarity.
Hey there @OttoWinter, mind taking a look at this pull request as it has been labeled with an integration ( |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #8012 +/- ##
==========================================
+ Coverage 53.70% 53.77% +0.06%
==========================================
Files 50 50
Lines 9408 9840 +432
Branches 1654 1361 -293
==========================================
+ Hits 5053 5291 +238
- Misses 4056 4223 +167
- Partials 299 326 +27 ☔ View full report in Codecov by Sentry. |
Would this work on ESP8266? |
This implementation is only for ESP32, but it's probably not that hard to implement something similar for ESP8266 as we probably can find some Arduino library to get the required info, but I would prefer to leave ESP8266 to another PR. |
dump_config
dump_config
What does this implement/fix?
This enhances the
DebugComponent
by adding functionality to log detailed partition table information during thedump_config()
process. The partition table details are displayed in a clean, aligned format, providing developers with clear insights into the device's flash memory layout.Features:
esp_partition
API for ESP32 devices running either Arduino or ESP-IDF.Example Log Output:
Why This Change is Useful:
Implementation Details:
Types of changes
Related issue or feature (if applicable): N/A
Pull request in esphome-docs with documentation (if applicable): N/A
Test Environment
Example entry for
config.yaml
: N/AChecklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: