2020TPC-SW/2020TPCApp0.cydsn/post_build_core1.bat
2025-02-01 19:52:04 -06:00

42 lines
1.1 KiB
Batchfile

@rem Usage:
@rem Call post_build_core1.bat <tool> <output_dir> <project_short_name>
@rem E.g. in PSoC Creator 4.2:
@rem post_build_core1.bat creator ${OutputDir} ${ProjectShortName}
@echo ------------------------------------------
@echo Post-build commands for Cortex-M4 core
@echo ------------------------------------------
@rem Set proper path to your PDL 3.x and above installation
@set PDL_PATH="C:\Program Files (x86)\Cypress\PDL\3.1.7"
@set CY_MCU_ELF_TOOL=%PDL_PATH%"\tools\win\elf\cymcuelftool.exe"
@set IDE=%1
@if "%IDE%" == "creator" (
@set OUTPUT_DIR=%2
@set PRJ_NAME=%3
@set ELF_EXT=.elf
)
@if "%IDE%" == "uvision" (
@set OUTPUT_DIR=%2
@set PRJ_NAME=%3
@set ELF_EXT=.axf
)
@if "%IDE%" == "iar" (
@set OUTPUT_DIR=%2
@set PRJ_NAME=%3
@set ELF_EXT=.out
)
@if "%IDE%" == "eclipse" (
@set OUTPUT_DIR=%2
@set PRJ_NAME=%3
@set ELF_EXT=
)
@rem Sign the application with the RSA private key
%CY_MCU_ELF_TOOL% -S %OUTPUT_DIR%\%PRJ_NAME%%ELF_EXT% SHA256 --encrypt RSASSA-PKCS --key ..\Keys\rsa_private.txt --output %OUTPUT_DIR%\%PRJ_NAME%_RSA%ELF_EXT% --hex %OUTPUT_DIR%\%PRJ_NAME%.hex