ESP32 HybridCompile: separate checkouts sharing ~/.platformio link each other's IDF libs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system, embedded-iot
Research direction
Start by reading extra_scripts/esp32_pre.py, especially drop_stale_sdkconfig_defaults(), and trace where the IDF library cache key and sdkconfig.defaults marker are created. Reproduce the shared PlatformIO core scenario with the two environments named in the issue. Done means each project detects when the shared libraries were built for a different configuration and recompiles them; verify the resulting firmware contains the expected PSRAM mode.
Written by the indexing model from the issue text.
Description
Summary
ESP32 envs with custom_sdkconfig compile the Arduino IDF libs into the global ~/.platformio/packages/framework-arduinoespressif32-libs/<mcu>/. Whether to recompile them is decided by a hash stored in the project-local sdkconfig.defaults (line 1, # TASMOTA__<hash>). When two project directories share one PlatformIO core dir (git worktrees, multiple clones, a persistent CI cache), a build in one directory rewrites the global libs, but the other directory's marker still matches. That directory's next build reuses the libs, which are now configured for another board.
The image builds without error and does not boot. In the case below a quad-PSRAM board linked octal-PSRAM libs and boot-looped:
E (415) octal_psram: PSRAM chip is not connected, or wrong PSRAM line mode
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
The backtrace ends in psramInit() → esp_timer_impl_get_time().
Reproduce
- Directory A:
pio run -e t-deck-pro(quad PSRAM). It boots. - Directory B, sharing
~/.platformio:pio run -e t5s3_epaper_inkhud(octal PSRAM). This recompiles the global libs for octal. - Directory A: rebuild
t-deck-proafter any source change. No IDF-libs recompile happens. The image containsoctal_psramand notquad_psram(strings firmware.bin | grep -c octal_psram), and it boot-loops.
Deleting .pio/build/t-deck-pro does not help. Deleting A's sdkconfig.defaults does.
Cause
#11112 added the PSRAM fingerprint to the hash, and #11834 drops sdkconfig.defaults when the libs are older than it (an interrupted compile). Both compare against a marker held in one project, while the libs they guard are shared. drop_stale_sdkconfig_defaults() in extra_scripts/esp32_pre.py returns early when libs/<chip_variant>/sdkconfig is at least as new as sdkconfig.defaults, which is exactly the case when another project recompiled the libs.
Possible fix
Record what the libs were built for alongside the libs: after a completed compile, write the cache-key hash next to libs/<chip_variant>/sdkconfig. Then compare that hash, not timestamps, with the project's sdkconfig.defaults, and drop the marker on any mismatch. That covers both directions: an aborted compile (#11834) and a compile by another project.
Workaround
Delete the project's sdkconfig.defaults before building after any other ESP32 build that used a different PSRAM configuration in another directory. Before flashing, confirm the image has the expected quad_psram or octal_psram string.
Platform: pioarduino espressif32 55.3.311 (meshtastic fork).
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 2.8k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 119
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from meshtastic/firmware
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meshtastic/firmware#12519 ·
Maintainers usually reply within 1 day
-
first-contribution
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
meshtastic/firmware#12433 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: device-installer.sh closes terminal after completion so results cannot be seenPossibly taken @piyush295 claimed this 27 days ago. Openbug first-contribution triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
meshtastic/firmware#11954 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Heltec Capsule Sensor v3 GPS not workingMay be free again A pull request for this issue was closed without being merged. Openbug first-contribution triaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
meshtastic/firmware#9854 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
meshtastic/firmware#12520 ·
Maintainers usually reply within 1 day
All issues in meshtastic/firmware
Similar issues
-
arch-based bug niri
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
noctalia-dev/noctalia#5552 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
EchoTools/nevr-runtime#2912 ·
Maintainers usually reply within 1 day
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yugabyte/yugabyte-db#39462 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days