Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32_himem: Fix issue that was preventing to map all free memory #2355

Merged
merged 2 commits into from
Nov 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions arch/xtensa/src/esp32/esp32_himem.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ int esp_himem_init(void)

/* Allocate data structures */

g_ram_descriptor = kmm_malloc(sizeof(ramblock_t) * g_ramblockcnt);
g_range_descriptor = kmm_malloc(sizeof(rangeblock_t) * \
g_ram_descriptor = kmm_zalloc(sizeof(ramblock_t) * g_ramblockcnt);
g_range_descriptor = kmm_zalloc(sizeof(rangeblock_t) * \
SPIRAM_BANKSWITCH_RESERVE);

if (g_ram_descriptor == NULL || g_range_descriptor == NULL)
Expand Down Expand Up @@ -320,7 +320,7 @@ static bool allocate_blocks(int count, uint16_t *blocks_out)
for (i = 0; i < count; i++)
{
g_ram_descriptor[blocks_out[i]].is_alloced = true;
g_ram_descriptor[blocks_out[i]].is_mapped = false;
assert(g_ram_descriptor[blocks_out[i]].is_mapped == false);
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
}

return true;
Expand Down