CCS ベースのプロジェクトに、以下の post-build steps を追加すると bin ファイルを生成できます。
Shell
"${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 ファイルの生成には影響しません。
BAT
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
)
C2000 シリーズで bin を生成する際の厄介な問題