.sct文件分析
点击查看代码
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x00000000 0x00080000 { ; load region size_region
ER_IROM1 0x00000000 0x00080000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00020000 { ; RW data
.ANY (+RW +ZI)
}
RW_IRAM2 0x70000000 0x00800000 { ; RW data
*(.SDRAM)
}
}
一、空间大小分析
---1.flash:起始地址为0x00000000;大小为0x00080000,即80000(hex) / 400(hex) = 200(hex) = 512 KB;其中 400(hex) = 1024(dec)
---2.sram: 起始地址为0x20000000;大小为0x00020000,即20000(hex) / 400(hex) = 50 (hex)= 128 KB;
---3.sdram:起始地址为0x70000000;大小为0x00800000,即80000(hex) / 400(hex) = 8192 KB = 8MB;
二、文件作用
---1.不勾选"use memory layout from target dialog"这个选项的话,则是要加载外部对应的sct文件去分配各个内存,包括startup.s里的栈内存和堆内存。
---2.对于ROM跟RAM的设置,光靠这个界面设置并不全面,所以想要设置全面,应该使用.sct文件。
三、
---Code:表示程序所占用 FLASH 的大小(FLASH)。
---RO-data:即 Read Only-data,表示程序定义的常量,如 const 类型(FLASH)。
---RW-data:即 Read Write-data,表示已被初始化的全局变量(SRAM)
---ZI-data:即 Zero Init-data,表示未被初始化的全局变量(SRAM)
浙公网安备 33010602011771号