Keil使用自带的fromelf 生成bin文件最好的最好的方法

不想看怎么使用,就用以下两条命令就好。

1、这条直接复制到上面箭头框里,记得打钩,这条是直接在输出目录下生成bin文件

fromelf --bin  -o "$L\@L.bin" "#L"

2、这条是在输出目录下的BIN文件夹下生成bin文件

fromelf --bin  -o "$LBIN\@L.bin" "#L"

formelf.exe的语法,参考这位博主的 Keil如何用fromelf.exe工具生成目标(bin,hex等)文件-CSDN博客

fromelf [options] input_file  (命令的格式)

Options:
       --help         display this help screen (显示帮助信息)
       --vsn          display version information (显示版本信息)
       --output file  the output file. (defaults to stdout for -text format) (输出文件(默认的输出为文本格式))
       --nodebug      do not put debug areas in the output image (在生成的映象中不包含调试信息)
       --nolinkview   do not put sections in the output image (在生成的映象中不包含段的信息)

Binary Output Formats:
       --bin          Plain Binary (生成Plain Binary格式的文件)
       --m32          Motorola 32 bit Hex (生成Motorola 32位十六进制格式的文件)
       --i32          Intel 32 bit Hex (生成Intel 32位十六进制格式的文件)
       --vhx          Byte Oriented Hex format (面向字节的位十六进制格式的文件t)

       --base addr    Optionally set base address for m32,i32 (设置m32,i32格式文件的基地址)

Output Formats Requiring Debug Information (需要调试信息的格式)
       --fieldoffsets Assembly Language Description of Structures/Classes (结构/类的汇编语言描述)
       --expandarrays Arrays inside and outside structures are expanded (扩展数组内部和外部结构被扩展)

Other Output Formats:
       --elf         ELF
       --text        Text Information (显示文本信息)

                Flags for Text Information
                -v          verbose (打印详细信息)
                -a          print data addresses (For images built with debug) (打印数据地址(针对带调试信息的映象))
                -c          disassemble code (打印反汇编代码)
                -d          print contents of data section (打印数据段的内容)
                -e          print exception tables (打印表达式表)
                -g          print debug tables (打印调试表)
                -r          print relocation information (打印重定位信息)
                -s          print symbol table (打印字符表)
                -t          print string table (打印字符串表)
                -y          print dynamic segment contents (打印动态段的内容)
                -z          print code and data size information (打印代码和数据大小的信息)

fromelf   中 $L、@L、L的用法

$L、@L、L用来指定对应的路径或名称。

1、L是指axf文件路径,加文件名。

2、$L是指axf的文件路径,不含文件名。

3、@L是指axf的文件名,不含axf的后缀。

4、#L:表示生成的链接文件的完整路径名及文件名

比如我的输出路径是

那么我使用这条命令 fromelf --bin  -o "$LBIN\@L.bin" "#L"

生成的bin文件路径如下

L的内容为:..\OUTPUT\test.axf

$L的内容为:..\OUTPUT\      (包含最后的“\”)

@L的内容为:test

因此命令中 "$LBIN\@L.bin"

就为 ..\OUTPUT\BIN\test.bin

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值