As there're linker-defined symbols like
Load$$LR$$load_region_name$$Base Address of the load region. Load$$LR$$load_region_name$$Length Length of the load region. Load$$LR$$load_region_name$$Limit Address of the byte beyond the end of the load region
to get the attributes of a Load region. But I think the Load$$LR$$load_region_name$$Length and Load$$LR$$load_region_name$$Limit are redundant. Since we can calculate the Limit address by adding the Length to the Base address.
My question is how to get the maximum size of a region in C source? For example,
Load Region LR_IROM1 (Base: 0x00005000, Size: 0x00005cb8, Max: 0x0000b000, ABSOLUTE, COMPRESSED[0x000054ec])
Load$$LR$$LR_IROM1$$Length would be 0x000054ec. But is there any symbol to refer to the value of 0x0000b000?
There is no linker defined symbol for getting the maximum possible size of a region that is configured in the scatter file.
But, if you need to share such information between your application and the linker configuration, you can use the scatter file preprocessing feature (here is the related documentation in the Arm Compiler 6 toolchain documentation):
https://www.keil.com/support/man/docs/armclang_ref/armclang_ref_pge1362066010024.htm
So you can use a macro #define in a header file, that you can include in your application and the scatter file to have this setting centralized in one place only.
using a define per device was exactly what we were trying to prevent. I was also thinking, is it possible to set the stack to the end of the ram by default, instead of right after the heap? That way we can determine the unused space in front of the stack.