-
Notifications
You must be signed in to change notification settings - Fork 52
fix function get_app_partition_offset() #252
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
Conversation
WalkthroughThe code modifies logic in the ESP-IDF builder framework for handling partition tables. It replaces manual CSV parsing with function-based queries for determining the application partition offset, updates the search to prioritize the "ota_0" and "factory" subtypes, and improves robustness by using safer dictionary access methods. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
builder/frameworks/espidf.py (1)
1352-1362
: Safer access for 'name' looks good; consider guarding 'type'/'subtype' too.Switching to
pt_params.get("name")
avoids a KeyError. Minor follow-up: this block still indexespt_params["type"]
andpt_params["subtype"]
directly. If future callers pass onlyname
(and not"boot"
), this would raise. Either assert/document the invariant or use.get(...)
with a clear error if missing.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
builder/frameworks/espidf.py
(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#225
File: builder/main.py:99-108
Timestamp: 2025-07-13T20:03:29.695Z
Learning: In the ESP32 platform builder, the subprocess call to get site-packages directory in setup_python_paths() function is intentionally left without error handling because if this basic Python operation fails, it indicates a fundamental system issue that would cause the entire build process to fail anyway.
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#199
File: builder/main.py:221-226
Timestamp: 2025-06-26T09:55:55.788Z
Learning: In the _update_max_upload_size function in builder/main.py, the `sizes` variable that maps partition subtypes to their sizes should not be removed despite appearing unused to static analysis tools. The variable serves a purpose that's not immediately obvious from the code structure.
📚 Learning: 2025-08-05T11:47:41.756Z
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#246
File: builder/main.py:0-0
Timestamp: 2025-08-05T11:47:41.756Z
Learning: In the ESP32 platform builder, subprocess calls correctly use the virtual environment Python by explicitly passing PYTHON_EXE (which is set to the venv python path) as the first argument in the command array, rather than relying on environment variable propagation. The env=os.environ parameter only affects environment variables, not the executable path itself.
Applied to files:
builder/frameworks/espidf.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: build (macos-15, examples/espidf-peripherals-usb)
- GitHub Check: build (macos-15, examples/arduino-zigbee-switch)
- GitHub Check: build (macos-15, examples/espidf-arduino-matter-light)
- GitHub Check: build (macos-15, examples/arduino-rmt-blink)
- GitHub Check: build (macos-15, examples/arduino-blink)
- GitHub Check: build (windows-latest, examples/espidf-coap-server)
- GitHub Check: build (windows-latest, examples/espidf-blink)
- GitHub Check: build (windows-latest, examples/espidf-storage-sdcard)
- GitHub Check: build (windows-latest, examples/espidf-peripherals-usb)
- GitHub Check: build (windows-latest, examples/espidf-arduino-littlefs)
- GitHub Check: build (windows-latest, examples/arduino-NimBLE-ext_client)
- GitHub Check: build (windows-latest, examples/arduino-rmt-blink)
- GitHub Check: build (windows-latest, examples/arduino-wifiscan)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-blink)
- GitHub Check: build (ubuntu-latest, examples/espidf-hello-world)
- GitHub Check: build (ubuntu-latest, examples/espidf-blink)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-matter-light)
- GitHub Check: build (ubuntu-latest, examples/tasmota)
- GitHub Check: build (ubuntu-latest, examples/arduino-wifiscan)
- GitHub Check: build (ubuntu-latest, examples/arduino-blink)
🔇 Additional comments (1)
builder/frameworks/espidf.py (1)
2240-2246
: LGTM; verify offset format expected downstream.Using the helper to compute and export
ESP32_APP_OFFSET
simplifies the flow. Please verify consumers expect a hex string (e.g.,0x10000
). If not guaranteed by parttool, consider normalizing to hex for consistency before setting the env var.
Description:
was never working. There is no
boot
entry. Fixed regarding espressif docshttps://docs.espressif.com/projects/esp-idf/en/v5.5/esp32/api-guides/partition-tables.html
removed workaround.
Checklist:
Summary by CodeRabbit
Bug Fixes
Refactor