UserCommand.bat 484 B

123456789101112131415161718192021
  1. @echo off
  2. ::--------------------------------------------------------
  3. ::-- Input param
  4. ::-- %1: elf file
  5. ::-- %2: tool dir
  6. ::--------------------------------------------------------
  7. set "ELF=%~dpnx1"
  8. set "BIN=%~dp1\..\%~n1.bin"
  9. set "LST=%~dp1\..\%~n1.lst"
  10. set "TOOL=%~2\ARMCC\bin"
  11. set "OUTDIR=%~dp1\..\..\"
  12. :: Output bin
  13. "%TOOL%\fromelf" --bin --output="%BIN%" "%ELF%"
  14. :: Output list
  15. "%TOOL%\fromelf" --text -a -c --output="%LST%" "%ELF%"
  16. :: Copy bin
  17. copy /B /Y "%BIN%" "%OUTDIR%"