zephyr: Add patch to fix zero newlib sbrk() heap on i.MX8M ADSP#90
Merged
Merged
Conversation
Add west patch entry and patch file to fix the zero newlib sbrk() heap size on the i.MX8M ADSP when used with audioreach-engine. _heap_sentry was assigned to '.' immediately after the NOLOAD .heap_mem section in sdram1. When .heap_mem has no input objects, _heap_mem_end == _end == _heap_sentry, collapsing MAX_HEAP_SIZE to 0. Every malloc() call then returns NULL, causing init failures across the audioreach-engine stack. Fix by anchoring _heap_sentry to __stack (SDRAM1_BASE + SDRAM1_SIZE = 0x93400000), giving the newlib sbrk() arena the full remaining sdram1 space above _end. Signed-off-by: Aditya Rathi <aditrath@qti.qualcomm.com>
quic-plai
approved these changes
Jun 1, 2026
qti-sbojja
approved these changes
Jun 2, 2026
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.
Add west patch entry and patch file to fix the zero newlib sbrk() heap size on the i.MX8M ADSP when used with audioreach-engine.
_heap_sentry was assigned to '.' immediately after the NOLOAD .heap_mem section in sdram1. When .heap_mem has no input objects, _heap_mem_end == _end == _heap_sentry, collapsing MAX_HEAP_SIZE to 0. Every malloc() call then returns NULL, causing init failures across the audioreach-engine stack.
Fix by anchoring _heap_sentry to __stack (SDRAM1_BASE + SDRAM1_SIZE = 0x93400000), giving the newlib sbrk() arena the full remaining sdram1 space above _end.