Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/fw/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _generate_memory_layout(bld):
ldscript_template = bld.path.find_node('stm32f7xx_flash_fw.ld.template')
elif bld.is_silk():
ldscript_template = bld.path.find_node('stm32f412_flash_fw.ld.template')
elif bld.env.BOARD == 'snowy_emery':
elif bld.env.BOARD in ('snowy_emery', 'spalding_gabbro'):
ldscript_template = bld.path.find_node('stm32f439_snowy_emery_flash_fw.ld.template')
elif bld.is_snowy_compatible():
ldscript_template = bld.path.find_node('stm32f439_flash_fw.ld.template')
Expand Down Expand Up @@ -336,6 +336,12 @@ def _generate_memory_layout(bld):
worker_ram_size = 12 * 1024 # The worker always gets 12k of RAM.
worker_ram = (ram_end - app_ram_size - worker_ram_size, worker_ram_size)
kernel_ram_size = total_ram[1] - app_ram_size - worker_ram_size
# On snowy_emery the excess RAM results in a kernel heap far larger than real
# hardware (~131K vs ~106K), which is further capped by the heap allocator's
# 15-bit segment size field to 131068 bytes. Reduce kernel RAM to match real
# hardware heap pressure and avoid masking memory-related bugs in QEMU.
if bld.env.BOARD in ('snowy_emery', 'spalding_gabbro'):
kernel_ram_size = min(kernel_ram_size, 172 * 1024)
kernel_ram = (total_ram[0], kernel_ram_size)

# As a basic sanity check, make sure we're giving the kernel at least 64k.
Expand Down
Loading