基于 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