基於 CCS 的工程,添加如下的 post-build steps 可生成 bin 文件
"${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd2000.exe" "${CG_TOOL_ROOT}/bin/hex2000.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"
在這個指令中奇怪的 {CCE_INSTALL_ROOT} 環境變量在 CCS 終端環境下等價於 {CCS_INSTALL_ROOT}
那麼事實上依然無法正常生成,找到 CCS 安裝目錄下的 /utils/tiobj2bin/tiobj2bin.bat 這個文件,將其中的 "470" 全部改成 "2000",重新編譯一下就能正常生成了。
那麼此時可能會有報錯說 "C: 找不到" 什麼什麼的,是 tiobj2bin.bat 中以下一段內容在作祟。如果實在討厭這個報錯提示刪掉這段內容就好,不影響 bin 文件的生成
rem ==========================================================================
rem C2000 EABI files are not supported. This code uses ofd2000 to search the
rem file header to determine whether it is an ELF file or not. All the output
rem of that command, including any error diagnostics, is thrown away. For the
rem details of how this works, Internet search the commands used.
rem ==========================================================================
if %base_ofdcmd% == ofd2000 (
setlocal enabledelayedexpansion
%ofdcmd% --obj_display=none,header %outfile% | findstr/c:" ELF " > nul 2>&1
if !errorlevel! equ 0 (
echo C28x files built with --abi=eabi are not supported
exit /b
)
setlocal disabledelayedexpansion
)
此文由 Mix Space 同步更新至 xLog
原始鏈接為 https://www.yono233.cn/notes/21