Repository navigation
Implement GlobalAlloc via SiLabs SDK and ESP-IDF - #74
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The unsafe global allocator replacements lack SDK-matched build and on-device validation of ABI compatibility, alignment, realloc failure, and shared-heap behavior on both MCUs, particularly against pinned Simplicity SDK 2026.6.2.
No open issues 🎉
What changed in this PR
Replaces the embedded Rust stack’s fixed 128 KiB heap with vendor SDK allocators, allowing Ziggurat to share available RAM with other firmware components.
Changes:
- Adds SiLabs and ESP-IDF
GlobalAllocimplementations with alignment-aware reallocation and mutually exclusive platform features. - Updates firmware build configuration, bumps the SiLabs SDK, and increases both platforms’ NCP transmit buffers to 4 KiB.
- Refreshes embedded firmware documentation and removes the
embedded-allocdependency.
| File | Description |
|---|---|
README.md |
Documents embedded RCP support and platform build locations. |
firmwares/esp32-c6/CMakeLists.txt |
Increases the NCP transmit buffer to 4 KiB. |
firmwares/esp32-c6/build.sh |
Enables the esp-idf Rust feature. |
firmwares/efr32mg24/brd2601b_ziggurat_rcp.yaml |
Updates the SDK to 2026.6.2 and increases the NCP transmit buffer. |
crates/ziggurat-ot/src/lib.rs |
Implements SDK-backed allocators and platform feature checks. |
crates/ziggurat-ot/Cargo.toml |
Defines platform features and removes embedded-alloc. |
crates/ziggurat-ot/Cargo.lock |
Removes unused allocator dependencies. |
Review effort: Balanced
Member
Author
|
I tested this change on my home network with ~100 devices just fine. Performing an OTA update of a bulb while toggling 20-30 lights caused no issues. |
Member
Author
|
For reference, here's what the current memory usage looks like with fairly aggressive usage patterns:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
embedded-allocis used as a fixed 128KB arena for embedded Ziggurat. This works fine. An alternative is to integrate with the chip vendor SDK's memory management system:heap_caps_aligned_allocfor ESP-IDF andsl_memory_alloc_advancedfor Simplicity SDK. These allow Ziggurat to better coexist with other applications and also fully utilize available RAM.CC @DH4CK, as you mentioned running Ziggurat on a C6.