ROM,RAM使用情况统计

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/ch_xin/article/details/8363976

一般我们的flash分区文件在custom_MemoryDevice.h (custom\system\techain50_cosmos_11b_bb) 目录下。

一般的flash大小为128*64Mb,指的是位,即为128*64M/bit(128*64Mb),也就是我们通常说的小b,
所以,真正计算时,我们要换算为Byte计算,也就是所谓的大B进行计算,即都除8,也就是16*8M/Byte(16*8MB)。前面是ROM,后面是RAM。

 ****************************************************************************
 Step 6: This is an optional step special for NOR-XIP configuration only.
 
         This step configures the FS (file system) region information on NOR FLASH!

         By default, FS region is located the last bank of NOR Flash.
         For specific purpose, user are able to manually configure the
         
         Step 1. Start address of FS region on NOR-flash,
         Step 2. Total FS size on NOR-flash disk
         Step 3. The first drive (or partition) size of FS region. if no additional drive
                 on NOR-flash disk, it should be 0. For more details, please refer to REMIND.
         
         [REMIND]
         ========
         It is special for flash disk which has two drives (or partitions), the
         first leading is user drive, visible on USB disk, the second may be
         system drive, and invisible from USB disk.

         [VERY IMPORTANT NOTICE]
         =======================
         1. Disable this definition and make auto Gen pick default setting from
            Memory Device Excel Database is recommend.
            
         2. Please assign the exact integer value in terms of sectors (one sector equal
            to 512 Bytes) in NOR_BOOTING_NOR_FS_FIRST_DRIVE_SECTORS.
            MUST NOT assign as
            (TOTAL_FS_SIZE - SIZE_OF_SYSTEM_DRIVE), because system will keep
            some spaces for disk management.

 ****************************************************************************
*/

#define NOR_BOOTING_NOR_FS_BASE_ADDRESS           0x00E40000
#define NOR_BOOTING_NOR_FS_SIZE                   0x001C0000
#define NOR_BOOTING_NOR_FS_FIRST_DRIVE_SECTORS    260


 

其中,

0x00E40000:代码段,E40000转换为十进制为:14942208,14942208/1024=14592KB,再除以1024即14.25MB.这就是我们配置的ROM大小。

0x001C0000:文件系统盘,文件系统盘大小+代码段大小=整个flash ROM空间大小。

260:用户盘大小,260*512/1024=130KB 属于文件系统盘中的一部分。

1.ROM计算

build\CHERRY_T71_COSMOS_11B\CHERRY_T71_COSMOS_11B_PCB01_gprs_MT6250_S00.CHERRY_W7_T712V_M01_DEMO_121219.bin文件夹下

VIVA
TECHAIN50_COSMOS_11B_BOOTLOADER_V005_MT6250_T750_M00_S03_120811.bin
ROM
EXT_BOOTLOADER
 

以上四个文件的size相加,就是已经使用的ROM空间大小。

 
2.RAM计算方法:

猜你喜欢

转载自blog.csdn.net/ch_xin/article/details/8363976