[realtek-ambz2] Fix missing flash API resource lock unit
This commit is contained in:
13
cores/realtek-ambz2/base/fixups/hal_flash.h
Normal file
13
cores/realtek-ambz2/base/fixups/hal_flash.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/* Copyright (c) Kuba Szczodrzyński 2023-05-31. */
|
||||
|
||||
// - flash_api.c and flash_api_ext.c are both compiled in libambz2_sdk.a
|
||||
// - the former declares weak functions 'flash_resource_lock' and 'flash_resource_unlock',
|
||||
// while the latter actually implements them
|
||||
// - for some reason, the linker resolves the weak functions only,
|
||||
// and doesn't include them in the final binary
|
||||
|
||||
#include_next "hal_flash.h"
|
||||
|
||||
// try to remove the weak attribute
|
||||
#undef __weak
|
||||
#define __weak
|
||||
@@ -385,5 +385,11 @@ SECTIONS
|
||||
PROVIDE(__sram_end__ = __StackLimit);
|
||||
|
||||
/* Check if data + heap + stack exceeds RAM limit */
|
||||
/* TODO: ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") */
|
||||
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
|
||||
ASSERT(__bss_start__ >= __ram_code_text_end__, "sram heap will overwrite sram text")
|
||||
ASSERT(__bss_start__ >= __ram_code_rodata_end__, "sram heap will overwrite sram rodata")
|
||||
ASSERT(__bss_start__ >= __data_end__, "sram heap will overwrite sram data")
|
||||
ASSERT(__psram_bss_start__ >= __psram_code_text_end__, "psram heap will overwrite psram text")
|
||||
ASSERT(__psram_bss_start__ >= __psram_code_rodata_end__, "psram heap will overwrite psram rodata")
|
||||
ASSERT(__psram_bss_start__ >= __psram_data_end__, "psram heap will overwrite psram data")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user