# calcelf **Repository Path**: luyaocf/calcelf ## Basic Information - **Project Name**: calcelf - **Description**: calcelf(Calculate Executable file),通过导入 Keil5 uVision 编译后的 .map 和 .sct 文件,来计算并输出 RAM/ROM 已经使用的百分比。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-07-30 - **Last Updated**: 2024-11-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 介绍 - calcelf(Calculate Executable file), 通过导入 Keil5 uVision 编译后的 .map 和 .sct 文件,来计算并输出 RAM/ROM 已经使用的百分比。 - 为什么要写这样一个程序?当实现在 JetBrains CLion 下配置 armclang 工具链后,觉得 Keil5 uVision 输出的 RAM/ROM 占用情况不太直观。 ## 使用说明 - 安装: - 将 Keil 安装目录配置一个名为 `KEIL_HOME` 的环境变量,并将 `%KEIL_HOME%\ARM\ARMCLANG\bin` 添加到 Path 中 - 将 calcelf.exe 拷贝到 `%KEIL_HOME%\ARM\ARMCLANG\bin` 目录 - 帮助: ```txt calcelf.exe -h calcelf(Calculate Executable file) Licensed under GNU GPL v2 --help | -h display this help --version | -v display program version --debug | -d set debug level. available options:(-d3) --format | -f set format to print. available options:(percent, progbar) --map | -m set Keil5 uVision .map file --scatter | -s set Keil5 uVision .sct file ``` ## 结果展示 ```txt // 默认输出为百分比 calcelf.exe -m jlcsky031_blink.elf.map -s stm32f407.sct Memory Region Used Size Region Size %age Used RAM: 1640 B 128 KB 1.25% FLASH: 2976 B 512 KB 0.57% // 也可以输出进度条 calcelf.exe -d0 -m jlcsky031_blink.elf.map -s stm32f407.sct -f progbar Total RW Size ( RW Data + ZI Data) 1640 ( 1.60 KB) Total ROM Size (Code + RW Data + RO Data) 2976 ( 2.91 KB) [==--------------------------------------------------------------------------------------------------] 1.25% RAM USED [=---------------------------------------------------------------------------------------------------] 0.57% ROM USED ```