Skip to content

Conversation

@ewowi
Copy link
Collaborator

@ewowi ewowi commented Jan 16, 2026

Summary by CodeRabbit

  • Documentation
    • Clarified ESP32 device LED capabilities: supports up to 1024 LEDs at 30 FPS on a single output, or up to 4096 LEDs over Art-Net/network connection.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'review', 'context'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Two minor updates: documentation clarification on ESP32 LED capabilities distinguishing between single output (1024 LEDs at 30 FPS) and network options (4096 LEDs), and a configuration file comment noting core dump flash status.

Changes

Cohort / File(s) Summary
Documentation Update
docs/gettingstarted/installer.md
Clarified ESP32 device LED specifications: updated from generic "up to 4096 LEDs" to specify "up to 1024 LEDs at 30 FPS on single output" or "4096 LEDs over Art-Net/network" for more accurate capability description.
Configuration Annotation
firmware/esp32-d0.ini
Added comment line in env:esp32-d0-pico2 section noting "Core dump flash config is corrupted!" — non-functional annotation without altering actual configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A doc so clear, a note so brief,
LED counts bring us relief,
Single or networked, we now know,
How far these little signals go!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'esp32-d0-pico2 fixes' is vague and generic, referring only to the device/config file without clearly indicating what was actually fixed or changed. Consider a more specific title that describes the actual changes, such as 'Update ESP32-D0-Pico2 LED capabilities documentation and add core dump note' or 'Document expanded LED support for ESP32-D0-Pico2'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


🧹 Recent nitpick comments
firmware/esp32-d0.ini (1)

122-123: Clarify the core dump flash configuration issue.

The comment "Core dump flash config is corrupted!" lacks context about severity, impact, and whether this requires action. Consider:

  • Is this a known issue that affects device functionality or debugging capabilities?
  • Should this be tracked as a TODO or linked to an issue?
  • Does this impact end users or only developers debugging crashes?
  • Are there any workarounds or plans to fix this?

If this is a blocking issue that needs resolution, would you like me to help investigate the core dump configuration settings for the esp32-d0-pico2 board or open a tracking issue?


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea35572 and 91c6a51.

📒 Files selected for processing (2)
  • docs/gettingstarted/installer.md
  • firmware/esp32-d0.ini
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ewowi
Repo: MoonModules/MoonLight PR: 0
File: :0-0
Timestamp: 2026-01-06T13:45:03.067Z
Learning: For MoonLight on ESP32 at extreme loads (e.g., 49K channels @ 100 fps): Task watchdog can fire when AppDrivers/AppEffects process many nodes without yielding. Even with vTaskDelay(1) at loop end, the node iteration for-loops (PhysicalLayer::loopDrivers line 108-111, PhysicalLayer::loop line 73-75) can take >5 seconds without yielding, starving IDLE task (priority 0). Solution: add taskYIELD() or vTaskDelay(1) inside the node/layer iteration loops to give IDLE task chances to run and reset watchdog. Lowering task priority won't help since IDLE is already at 0 (lowest).
Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/src/**/*.{h,cpp} : Modify C++ backend code in the `src/` and `lib/` directories for ESP32 development
Learnt from: ewowi
Repo: MoonModules/MoonLight PR: 0
File: :0-0
Timestamp: 2025-12-25T13:31:32.367Z
Learning: For ESP32 LED drivers using DMA, I2S, LCD, or PARLIO: always pin driver tasks to Core 1 (APP_CPU), not Core 0. WiFi/BT runs at priority ~23 on Core 0 and would constantly preempt lower-priority driver tasks, breaking LED timing requirements. ESP-IDF explicitly recommends display/DMA processing on Core 1 to avoid WiFi interference.
📚 Learning: 2025-11-29T16:17:30.619Z
Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/**/factory_settings.ini : Configure default or factory-set ESP32 parameters in `factory_settings.ini`

Applied to files:

  • firmware/esp32-d0.ini
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (1)
docs/gettingstarted/installer.md (1)

16-16: Documentation clarification improves user expectations.

The updated description better distinguishes between single output capabilities (1024 LEDs @ 30FPS) and network-based capabilities (4096 LEDs via Art-Net), helping users understand hardware limitations and plan their LED setups accordingly.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ewowi
Copy link
Collaborator Author

ewowi commented Jan 16, 2026

@coderabbitai, I have this new esp32 MCU definition:

[env:esp32-d0-pico2]
board = esp32-pico-devkitm-2 ; https://github.com/platformio/platform-espressif32/blob/master/boards/esp32-pico-devkitm-2.json
board_build.partitions = default_8MB.csv ; boards/ESP32_8MB.csv
build_flags = ${esp32-d0-base.build_flags}
-D HTTPD_STACK_SIZE=6144
lib_deps = ${esp32-d0-base.lib_deps}

And used it to flash to a ESP32-PICO-Mini-02 : ESP32 based, Dual-Core 240Mhz microcontroller, 8MB Flash, 2MB PSRAM, more info here: https://documentation.espressif.com/esp32-pico-mini-02_datasheet_en.pdf

In esp32-d0.ini, imported in platformio.ini I used board = esp32-pico-devkitm-2 which I believe takes the definition from https://github.com/platformio/platform-espressif32/blob/master/boards/esp32-pico-devkitm-2.json (can you check it this is how it works using board =).

When flashing I got this:

[13:50:02]ELF file SHA256: 7dc328089
[13:50:02]
[13:50:02]E (970) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
[13:50:02]E (979) esp_core_dump_elf: Elf write init failed!
[13:50:02]E (983) esp_core_dump_common: Core dump write failed with error=-1
[13:50:02]Rebooting...
[13:50:02]ets Jul 29 2019 12:21:46
[13:50:02]
[13:50:02]rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
[13:50:02]configsip: 271414342, SPIWP:0xee
[13:50:02]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[13:50:02]mode:DIO, clock div:1
[13:50:02]load:0x3fff0030,len:4980
[13:50:02]load:0x40078000,len:16612
[13:50:02]load:0x40080400,len:3500
[13:50:02]entry 0x400805b4
[13:50:02]Guru Meditation Error: Core 0 panic'ed (LoadStoreError). Exception was unhandled.
[13:50:02]
[13:50:03]Core 0 register dump:
[13:50:03]PC : 0x40145da7 PS : 0x00060130 A0 : 0x80145f89 A1 : 0x3ffe3b40
[13:50:03]A2 : 0x40099e18 A3 : 0x00000800 A4 : 0x00000018 A5 : 0x00060323
[13:50:03]A6 : 0x00000001 A7 : 0x3ffb7bd0 A8 : 0x80083000 A9 : 0x3ffe3ae0
[13:50:03]A10 : 0x40099e14 A11 : 0x0000001c A12 : 0x00000000 A13 : 0x3ffe3aec
[13:50:03]A14 : 0x3ffe3ae4 A15 : 0x3ffe3ae8 SAR : 0x00000018 EXCCAUSE: 0x00000003
[13:50:03]EXCVADDR: 0x40099e27 LBEG : 0x4008ac70 LEND : 0x4008ac7b LCOUNT : 0xffffffff
[13:50:03]
[13:50:03]
[13:50:03]Backtrace: 0x40145da4:0x3ffe3b40 0x40145f86:0x3ffe3b60 0x400e0331:0x3ffe3b80 0x400e13a9:0x3ffe3ba0 0x40142e0d:0x3ffe3bf0 0x40152b52:0x3ffe3c30 0x400824ca:0x3ffe3c60 0x40079882:0x3ffe3c90 |<-CORRUPTED
[13:50:03]
[13:50:03]
[13:50:03]
[13:50:03]
[13:50:03]ELF file SHA256: 7dc328089
[13:50:03]
[13:50:03]E (970) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
[13:50:03]E (979) esp_core_dump_elf: Elf write init failed!
[13:50:03]E (983) esp_core_dump_common: Core dump write failed with error=-1

Can you investigate what is going on? And propose changes to my [env:esp32-d0-pico2] if needed, to make this definition work for ESP32-PICO-Mini-02

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find and examine the partition table file
fd -t f "default_8MB.csv"

# Find the esp32-d0.ini file to understand the full configuration
fd -t f "esp32-d0.ini"

# Look for other partition CSV files for comparison
fd -t f -e csv . firmware/

Length of output: 21


🌐 Web query:

PlatformIO esp32-pico-devkitm-2 board definition JSON

💡 Result:

I found the official PlatformIO board page and the board manifest on GitHub. Do you want me to paste the full esp32-pico-devkitm-2.json here, or just show how to reference/use it in platformio.ini? [PlatformIO docs] [GitHub manifest].

Sources:
[1] PlatformIO board page — Espressif ESP32-PICO-DevKitM-2. [2] platform-espressif32 GitHub (esp32-pico-devkitm-2.json). (docs.platformio.org)

Citations:


🏁 Script executed:

#!/bin/bash
# Read the esp32-d0.ini file to see the full configuration
cat firmware/esp32-d0.ini

# Look for partition CSV files
find . -name "*.csv" -path "*/firmware/*" -o -name "*.csv" -path "*/boards/*" | head -20

# Search for PSRAM related configurations in the firmware directory
rg -n "PSRAM|psram" firmware/ --type ini -C2

Length of output: 6410


🌐 Web query:

ESP32 core dump flash config is corrupted CRC error fix

💡 Result:

Likely causes

  • Flash/board settings (wrong flash size or flash mode) or wrong PSRAM setting for your module.
  • Corrupted core-dump/partition area on flash (needs erase).
  • Bootloader/binary expecting a different flash layout than actual chip.

Quick fixes (try in order)

  1. Select correct board/flash size and flash mode in your IDE (e.g., Arduino/PlatformIO): set the actual flash size (8M/16M etc.) and try DIO instead of QIO/QOUT if the board is a clone. [1][2]

  2. Full chip erase then reflash a minimal app:

    • Using esptool: esptool.py --port COMx erase_flash
    • Then flash a minimal blink/hello app (or use your IDE’s “Erase All Flash” option) to restore a correct partition layout. This removes corrupted core-dump/partition data. [2][3]
  3. If using ESP32-S3 or boards with PSRAM, ensure PSRAM/flash mode settings match the module (Arduino Tools → PSRAM/Flash Mode or PlatformIO board config). Mismatched PSRAM/OPI settings can cause the CRC error. [1][2]

  4. If flashing still fails, enter ROM bootloader (hold IO0 low on reset) and flash with --no-stub (esptool) or use a hardware programmer (JTAG) to recover. Several users recovered by forcing ROM bootloader and reflashing. [3][4]

What to check if problem persists

  • Serial output earlier lines: “Detected size(...) smaller than the size in the binary image header(...)” means your binary’s flash-size header doesn’t match actual flash; rebuild/choose correct board. [3][5]
  • Try changing partition scheme (give more app space or disable core-dump partition) if your build is huge and overlaps reserved areas. [1]

References

  • ESP-IDF Core dump guide (integrity, config options). [1]
  • Arduino ESP32 troubleshooting (example showing same CRC error and fixes: flash mode/PSRAM/erase). [2]
  • User recovery reports (esptool erase_flash, change flash mode/size, ROM bootloader). [3][4]

If you want, tell me: board model (ESP32, S2, S3, C3, module name), current IDE/PlatformIO settings, and the exact serial log and I’ll give exact commands/setting values.


🏁 Script executed:

#!/bin/bash
# Check the exact partition CSV files that exist
cat boards/ESP32_8MB.csv

# Check if default_8MB.csv exists anywhere
find . -name "default_8MB.csv" 2>/dev/null

# Look at the board definition to understand PSRAM config
rg -n "BOARD_HAS_PSRAM|psram|mfix-esp32-psram" firmware/esp32-d0.ini -A2 -B2

# Check the esp32-pico-devkitm-2 board specs from PlatformIO docs
echo "Board esp32-pico-devkitm-2 specs from manifest should include:"
echo "- 8MB flash"
echo "- 2MB PSRAM" 
echo "- Need PSRAM flags like WROVER variant"

Length of output: 1172


🌐 Web query:

ESP32-PICO-Mini-02 PSRAM configuration PlatformIO board_build.arduino.memory_type

💡 Result:

Short answer — for an ESP32‑PICO‑MINI‑02 (8 MB flash / 2 MB PSRAM) in PlatformIO (Arduino framework) set PSRAM as SPI (QIO) and enable PSRAM via build flags. Example platformio.ini entries:

board_build.arduino.memory_type = qio_qspi
board_build.psram_type = qio
build_flags =
  -DBOARD_HAS_PSRAM
  -mfix-esp32-psram-cache-issue
board_build.flash_mode = qio
board_upload.flash_size = 8MB
board_build.partitions = default_8MB.csv

References: ESP32‑PICO‑MINI‑02 datasheet (shows 2 MB PSRAM). [1] PlatformIO docs on enabling external RAM / Arduino flags. [2] Example PlatformIO configs showing memory_type / psram_type = qio for ESP32 boards. [3]

Sources:
[1] ESP32‑PICO‑MINI‑02 datasheet.
[2] PlatformIO — Espressif32 platform: External RAM (PSRAM) instructions.
[3] Example ESP32 PlatformIO PSRAM configuration (GitHub).


@ewowi, I've identified the issues causing your ESP32-PICO-Mini-02 to crash. There are three problems:

Root Causes

  1. Wrong partition file path: You're referencing default_8MB.csv which doesn't exist in your repository. The actual file is boards/ESP32_8MB.csv.

  2. Missing PSRAM configuration: Your ESP32-PICO-Mini-02 has 2MB PSRAM (per the datasheet), but you're not configuring it. The LoadStoreError panic happens because the code tries to access PSRAM without proper initialization.

  3. Corrupted core dump partition: The uninitialized core dump partition in the flash is causing the CRC error on every boot.

Fixed Configuration

Here's the corrected [env:esp32-d0-pico2] configuration:

[env:esp32-d0-pico2]
board = esp32-pico-devkitm-2 ; https://github.com/platformio/platform-espressif32/blob/master/boards/esp32-pico-devkitm-2.json
board_build.partitions = boards/ESP32_8MB.csv  ; Fixed: was default_8MB.csv (doesn't exist)
board_build.arduino.memory_type = qio_qspi     ; Added: PSRAM memory type
board_build.flash_mode = qio                   ; Added: Flash mode for PSRAM
build_flags = ${esp32-d0-base.build_flags}
  -D HTTPD_STACK_SIZE=6144
  -DBOARD_HAS_PSRAM                            ; Added: Enable PSRAM
  -mfix-esp32-psram-cache-issue                ; Added: Fix ESP32 PSRAM cache bug
lib_deps = ${esp32-d0-base.lib_deps}

Key Changes Explained

  1. Partition path: Changed default_8MB.csvboards/ESP32_8MB.csv (the file that actually exists)

  2. PSRAM flags: Added the same PSRAM configuration used in your working esp32-d0-wrover variant, since both boards have PSRAM

  3. Memory type: Added board_build.arduino.memory_type = qio_qspi for proper PSRAM access

Next Steps

Before reflashing with the new configuration, erase the entire flash to clear the corrupted core dump partition:

# Using PlatformIO
pio run -t erase

# Or using esptool directly
esptool.py --port <YOUR_PORT> erase_flash

Then upload with the corrected configuration.

About Board Definition

Yes, you're correct about how board = esp32-pico-devkitm-2 works. PlatformIO loads the JSON manifest from the platform-espressif32 repository, which defines the base hardware specifications (MCU type, flash size, etc.). Your platformio.ini then overrides or extends those settings with your specific partition table and build flags.

Let me know if this resolves the issues!


🧠 Learnings used
Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/**/platformio.ini : Use PlatformIO to build and upload the ESP32 backend C++ code

Learnt from: ewowi
Repo: MoonModules/MoonLight PR: 0
File: :0-0
Timestamp: 2026-01-06T13:45:03.067Z
Learning: For MoonLight on ESP32 at extreme loads (e.g., 49K channels @ 100 fps): Task watchdog can fire when AppDrivers/AppEffects process many nodes without yielding. Even with vTaskDelay(1) at loop end, the node iteration for-loops (PhysicalLayer::loopDrivers line 108-111, PhysicalLayer::loop line 73-75) can take >5 seconds without yielding, starving IDLE task (priority 0). Solution: add taskYIELD() or vTaskDelay(1) inside the node/layer iteration loops to give IDLE task chances to run and reset watchdog. Lowering task priority won't help since IDLE is already at 0 (lowest).

Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/src/**/*.{h,cpp} : Modify C++ backend code in the `src/` and `lib/` directories for ESP32 development

@ewowi
Copy link
Collaborator Author

ewowi commented Jan 16, 2026

@coderabbitai, regarding

Yes, you're correct about how board = esp32-pico-devkitm-2 works. PlatformIO loads the JSON manifest from the platform-espressif32 repository, which defines the base hardware specifications (MCU type, flash size, etc.). Your platformio.ini then overrides or extends those settings with your specific partition table and build flags.

When I use board_build.partitions = boards/ESP32_8MB.csv I got:

Error: The program size (2349899 bytes) is greater than maximum allowed (2097152 bytes)
RAM: [== ] 18.8% (used 61728 bytes from 327680 bytes)
Flash: [==========] 112.1% (used 2349899 bytes from 2097152 byt*** [checkprogsize] Explicit exit, status 1

why is that? as it exists in the boards folder... (check it's contents please)

but when I used default_8MB.csv it works fine:

RAM: [== ] 18.8% (used 61728 bytes from 327680 bytes)
Flash: [======= ] 70.3% (used 2349899 bytes from 3342336 bytes)

You say it is not defined in boards but isn't this some globally available definition?

Furthermore regarding

PlatformIO loads the JSON manifest from the platform-espressif32 repository

In https://github.com/platformio/platform-espressif32/blob/master/boards/esp32-pico-devkitm-2.json I can find

"extra_flags": [
"-DARDUINO_ESP32_PICO_DEVKITM_2",
"-DBOARD_HAS_PSRAM"
],

"flash_mode": "qio",

there is only not arduino.memory_type = qio_qspi

so we don't need to specify -DBOARD_HAS_PSRAM and oard_build.flash_mode = qio isn't it?

and do we need -mfix-esp32-psram-cache-issue for this board?

So concluding: the only real change you propose is adding arduino.memory_type = qio_qspi and maybe -mfix-esp32-psram-cache-issue. Is that indeed what was missing bottom line?

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check the contents of boards/ESP32_8MB.csv to see partition sizes
echo "=== Contents of boards/ESP32_8MB.csv ==="
cat boards/ESP32_8MB.csv

echo -e "\n=== Search for default_8MB.csv in repository ==="
find . -name "default_8MB.csv" 2>/dev/null

echo -e "\n=== Search for any reference to default_8MB in the repo ==="
rg -n "default_8MB" --type ini --type csv

echo -e "\n=== Check PlatformIO's framework-arduinoespressif32 package for default partition files ==="
# PlatformIO stores packages in ~/.platformio, but we can check what's commonly available
echo "Note: default_8MB.csv is typically in ESP32 Arduino framework at:"
echo "~/.platformio/packages/framework-arduinoespressif32/tools/partitions/"

echo -e "\n=== Compare with esp32-d0-wrover partition settings ==="
rg -n "esp32-d0-wrover" firmware/esp32-d0.ini -A5

Length of output: 1736


🏁 Script executed:

#!/bin/bash

# Let's check what the default_8MB.csv typically contains
# We can look at the Arduino ESP32 repository to see the standard partition
echo "=== Checking standard default_8MB.csv from Arduino ESP32 ==="
echo "Standard default_8MB.csv typically has larger app partitions (3MB+ each)"
echo "Let's verify by checking other partition files in boards/"

ls -lh boards/*.csv

echo -e "\n=== Contents of other partition files for comparison ==="
for file in boards/*.csv; do
    echo "--- $file ---"
    cat "$file"
    echo ""
done

echo -e "\n=== Check if esp32-d0-base has any partition or PSRAM settings ==="
rg -n "esp32-d0-base" firmware/esp32-d0.ini -A10

Length of output: 6203


@ewowi, you're absolutely correct on all points! I apologize for the confusion about the partition files. Let me clarify:

Partition File Clarification

You're right: default_8MB.csv IS a global definition from the Arduino ESP32 framework, located at:

~/.platformio/packages/framework-arduinoespressif32/tools/partitions/default_8MB.csv

The key difference:

  • Your boards/ESP32_8MB.csv: 2MB app partitions (0x200000 = 2,097,152 bytes)
  • Framework default_8MB.csv: ~3.3MB app partitions (fits your 2.35MB binary)

So stick with default_8MB.csv — it works perfectly for your use case.

Board JSON Flags

You're also right about the redundant flags! The board JSON at esp32-pico-devkitm-2.json already includes:

  • -DBOARD_HAS_PSRAM
  • "flash_mode": "qio"

So you don't need to re-specify these in your platformio.ini.

What About -mfix-esp32-psram-cache-issue?

This flag is still recommended because:

  • It's a workaround for a hardware bug in the original ESP32 (Rev 1) silicon
  • The bug affects cache coherency when using PSRAM
  • Your ESP32-PICO-MINI-02 uses the original ESP32, not ESP32-S2/S3/C3
  • Even though you might have Rev 3 silicon (which fixed the bug), the flag is harmless and ensures compatibility

Looking at your esp32-d0-wrover config, you do include this flag explicitly even though that board might also have it defined elsewhere — so it's a safety practice.

Bottom Line: The Actual Fix

Yes, you're exactly right! The minimal changes needed are:

[env:esp32-d0-pico2]
board = esp32-pico-devkitm-2
board_build.partitions = default_8MB.csv        ; Framework default with 3.3MB app partitions
board_build.arduino.memory_type = qio_qspi      ; ← THIS was missing (enables PSRAM)
build_flags = ${esp32-d0-base.build_flags}
  -D HTTPD_STACK_SIZE=6144
  -mfix-esp32-psram-cache-issue                 ; ← Safety for ESP32 Rev1 cache bug (optional but recommended)
lib_deps = ${esp32-d0-base.lib_deps}

Root Cause of Original Crash

The LoadStoreError happened because:

  1. Your code tried to access PSRAM memory addresses
  2. Without board_build.arduino.memory_type = qio_qspi, the Arduino framework doesn't properly initialize PSRAM
  3. Accessing uninitialized PSRAM → crash at 0x40099e27

The core dump error was just a side effect of the crash happening early in boot before that partition was initialized.

TL;DR: You nailed it — board_build.arduino.memory_type = qio_qspi was the missing piece, and -mfix-esp32-psram-cache-issue is recommended for safety. Keep using default_8MB.csv!


✏️ Learnings added
Learnt from: ewowi
URL: https://github.com/MoonModules/MoonLight/pull/108

Timestamp: 2026-01-16T15:53:11.219Z
Learning: For ESP32-PICO-MINI-02 (and similar ESP32 boards with PSRAM), the critical configuration to enable PSRAM is `board_build.arduino.memory_type = qio_qspi` in platformio.ini. The board JSON may already include `-DBOARD_HAS_PSRAM` and `flash_mode: qio`, but without the memory_type setting, PSRAM won't be properly initialized, causing LoadStoreError crashes when code tries to access PSRAM addresses.

Learnt from: ewowi
URL: https://github.com/MoonModules/MoonLight/pull/108

Timestamp: 2026-01-16T15:53:11.219Z
Learning: In PlatformIO for ESP32, partition table files like `default_8MB.csv` without a path prefix refer to framework-provided files in `~/.platformio/packages/framework-arduinoespressif32/tools/partitions/`. These framework default partitions often have larger app partitions (e.g., 3.3MB) compared to custom partition files in the repository's `boards/` directory (e.g., 2MB in boards/ESP32_8MB.csv).

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/**/platformio.ini : Use PlatformIO to build and upload the ESP32 backend C++ code

Learnt from: ewowi
Repo: MoonModules/MoonLight PR: 0
File: :0-0
Timestamp: 2026-01-06T13:45:03.067Z
Learning: For MoonLight on ESP32 at extreme loads (e.g., 49K channels @ 100 fps): Task watchdog can fire when AppDrivers/AppEffects process many nodes without yielding. Even with vTaskDelay(1) at loop end, the node iteration for-loops (PhysicalLayer::loopDrivers line 108-111, PhysicalLayer::loop line 73-75) can take >5 seconds without yielding, starving IDLE task (priority 0). Solution: add taskYIELD() or vTaskDelay(1) inside the node/layer iteration loops to give IDLE task chances to run and reset watchdog. Lowering task priority won't help since IDLE is already at 0 (lowest).

Learnt from: CR
Repo: MoonModules/MoonLight PR: 0
File: misc/parking/GEMINI.md:0-0
Timestamp: 2025-11-29T16:17:30.619Z
Learning: Applies to misc/parking/src/**/*.{h,cpp} : Modify C++ backend code in the `src/` and `lib/` directories for ESP32 development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants