Adjust flash size from 2M to 4M for Arduino MMU compatibility#399
Conversation
Override 2MB flash size to 4MB for compatibility.
|
@coderabbitai full review |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughA logic override is added to the flash size configuration in the ESP-IDF builder. When flash size is detected as "2MB", the system logs an informational message and remaps it to "4MB" to ensure Arduino MMU page size compatibility. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@builder/frameworks/espidf.py`:
- Line 424: The print call uses an unnecessary f-string with no placeholders;
replace the print(f"Info: Detected 2MB flash size setting, override to 4MB for
Arduino MMU page size compatibility") with a plain string print("Info: Detected
2MB flash size setting, override to 4MB for Arduino MMU page size
compatibility") to remove the unused f-prefix in the print statement.
- Around line 423-425: generate_board_specific_config currently forces
flash_size="4MB" for any 2MB board but later the mismatch check still reads the
original board.get("upload.flash_size") into board_flash_size causing a spurious
warning; fix by applying the same remapping when computing board_flash_size
(i.e. normalize board.get("upload.flash_size") the same way you normalized
flash_size) or skip the mismatch check when the override flag is set, and
tighten the override guard so it only applies to esp32c2 (restrict the condition
that sets flash_size to "4MB" to MCU "esp32c2"); update references to
flash_size, board_flash_size, idf_flash_size and the SDK key
"ESPTOOLPY_FLASHSIZE" so both sides use the same normalized value.
Description:
fix for crashing ESP32-C2 2MB and all other ESP32x variants with 2MB in Hybrid Compile mode.
Checklist:
Summary by CodeRabbit