我的實測生成.bin為"d:\english router soft\keil4\arm\armcc\bin\fromelf.exe" --bin --output ../upload.bin ../obj/target.axf
前面為keil的安裝路徑,後面為生成的.bin和.axf的檔案名字。
fromelf: creating hex file...
user command #1: d:\keil\arm\bin40\fromelf.exe --bin ..\obj\bootloader.axf -o ..\obj\bootloader.bin
--- error: user command terminated, exit-code = 1
原因及解決辦法:
在options for target ->user分頁有個run#1,功能是編譯完成後執行該指令操作,應該是該指令有問題,一般情況下該錯誤是run#1設定的執行的程式位置不對;比如你的keil是裝在c盤的,自然fromelf.exe檔案也在c盤,你要使用fromelf將編譯後生成的
afx檔案
再轉成bin
檔案(理論
hex檔案
再轉成bin檔案
也可以,但實測會報錯,錯誤資訊為:
c:\keil\arm\bin40\fromelf.exe --bin ..\obj\bootloader.hex -o ..\obj\bootloader.bin
fromelf: creating hex file...
user command #1: c:\keil\arm\bin40\fromelf.exe --bin ..\obj\bootloader.hex -o ..\obj\bootloader.bin
"..\obj\bootloader.hex": error: q0454e: in elf file: file is not an elf file (wrong magic number)
finished: 0 information, 0 warning and 1 error messages.
"..\obj\bootloader.axf" - 0 error(s), 0 warning(s).
),那麼你的執行程式
的位置改為「c:\keil\arm\bin40\fromelf.exe」,再如果你的keil裝在d盤,那麼執行程式的路徑為d:\keil\arm\bin40\fromelf.exe ;否則會提示該錯誤,如果不需要把生成的hex檔案轉bin檔案,將run user programs afterbuild/rebuild的run #1前的勾去掉或選擇fromelf.exe就可以了.
MDK生成bin檔案
關於mdk如何生成bin檔案和為什麼生成bin檔案,網上都有很多資料了,這裡只介紹一下自己遇到的坑 最早看到的格式是這樣的 fromelf.exe bin output p.bin p.axf 沒搞明白是怎樣的格式,就繼續在 網上搜尋了一下,然後找到了 fromelf.exe bin o outpu...
KEIL生成BIN檔案
操作步驟 01 前提概要 keil中生成bin檔案,是執行fromelf.exe程式生成的 說明fromelf.exe 是命令列 cmd 中執行的程式,直接雙擊無法執行 fromelf.exe 路徑為keil安裝目錄下的 arm armcc bin 目錄中 02 在keil中新增命令,執行frome...
使用KEIL , 生成BIN檔案
我的電腦裡的路徑是 d keil v5 arm armcc bin fromelf.exe 我的示例工程裡的檔案目錄是 iot bootloader rtos ps 代表keil工程檔案所在目錄 fromelf.exe檔案路徑 檔名 bin o 生成bin檔案存放路徑 檔名 keil編譯生成的.ax...