如何使用KEIL生成bin/hex文件
生成hex文件
打开一个keil工程,按如下顺序,将Create HEX File处打勾,编译无报错后,
然后打开你工程,默认情况下,编译生成的hex文件在你template.uvprojx工程的output->debug文件下
生成bin文件
这里介绍的是生成bin文件绝对路径的方式;
按如下顺序步骤,然后编译
Run #1 中的字符
fromelf --bin -o “$L@L.bin” “#L”
编译后,在下方信息框看到如下类似信息
After Build - User command #1: fromelf --bin -o “C:\my_word\linshi\HC32F460_DDL_Rev3.2.0\projects\ev_hc32f460_lqfp100_v2\template\MDK\output\debug\template.bin” “C:\my_word\linshi\HC32F460_DDL_Rev3.2.0\projects\ev_hc32f460_lqfp100_v2\template\MDK\output\debug\template.axf”
则代表生成成功,生成的bin文件路径就在template\MDK\output\debug下
KEIL报错 【 After Build - User command #1: D:\app\MDK\path\ARM\ARMCC\bin\fromelf.exe --bin --output ./output/debug/updata.bin ./output/debug/xxx.axf】
原因:Run #1 中配置错误,可能是调用keil生成bin文件工具错误,也可能是调用路径错误导致,修改成【 fromelf --bin -o “$L@L.bin” “#L” 】 即可