feat(firmware-info): добавь pre/post-build для CCS и Keil
Подключи общий генератор версии и SCI8-конвертацию через templates. Сохрани метаданные и SHA-256 готового BIN, совместимость с Python 3.8 и прежний SETGUI preflight. Опиши настройку CCS и локальное копирование результатов.
This commit is contained in:
90
tools/firmware-build/README.md
Normal file
90
tools/firmware-build/README.md
Normal file
File diff suppressed because one or more lines are too long
5
tools/firmware-build/ccs/firmware_identity.example.json
Normal file
5
tools/firmware-build/ccs/firmware_identity.example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"product": "MY_CONTROLLER",
|
||||
"target": "TMS320F28335",
|
||||
"version": [0, 1, 0]
|
||||
}
|
||||
25
tools/firmware-build/ccs/postcompile.bat
Normal file
25
tools/firmware-build/ccs/postcompile.bat
Normal file
@@ -0,0 +1,25 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions DisableDelayedExpansion
|
||||
if /i "%~1"=="--identity" goto identity
|
||||
rem Legacy mode: SETGUI release preflight.
|
||||
if "%~1"=="" goto usage
|
||||
if not "%~2"=="" goto usage
|
||||
if not exist "%~1" (
|
||||
echo [firmware-build] Release config not found: "%~1" 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
call "%~dp0..\..\firmware-publish\PUBLISH_FIRMWARE.bat" --config "%~f1" --preflight
|
||||
exit /b %errorlevel%
|
||||
:identity
|
||||
if "%~2"=="" goto usage
|
||||
if "%~3"=="" goto usage
|
||||
if "%~4"=="" goto usage
|
||||
if "%~5"=="" goto usage
|
||||
if "%~6"=="" goto usage
|
||||
if not "%~7"=="" goto usage
|
||||
python "%~dp0..\..\..\c\firmware-info\tools\c2000_postbuild.py" --compiler "%~f2" --build-dir "%~f3" --artifact "%~4" --metadata "%~f5" --output "%~f6"
|
||||
exit /b %errorlevel%
|
||||
:usage
|
||||
echo Usage: postcompile.bat --identity "compiler-root" "build-dir" "artifact-name" "generated-metadata.json" "output-dir" 1>&2
|
||||
echo Legacy: postcompile.bat "firmware-release.cmd" 1>&2
|
||||
exit /b 2
|
||||
24
tools/firmware-build/ccs/precompile.bat
Normal file
24
tools/firmware-build/ccs/precompile.bat
Normal file
@@ -0,0 +1,24 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions DisableDelayedExpansion
|
||||
if /i "%~1"=="--identity" goto identity
|
||||
rem Legacy mode: build ID header only.
|
||||
if "%~1"=="" goto usage
|
||||
if "%~2"=="" goto usage
|
||||
if not "%~3"=="" goto usage
|
||||
if not exist "%~1\." (
|
||||
echo [firmware-build] Project directory not found: "%~1" 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\..\..\c\firmware-info\tools\make_build_id.ps1" -Repository "%~f1" -Output "%~f2"
|
||||
exit /b %errorlevel%
|
||||
:identity
|
||||
if "%~2"=="" goto usage
|
||||
if "%~3"=="" goto usage
|
||||
if "%~4"=="" goto usage
|
||||
if not "%~5"=="" goto usage
|
||||
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" prepare --repository "%~f2" --templates "%~dp0..\..\.." --config "%~f3" --output "%~f4"
|
||||
exit /b %errorlevel%
|
||||
:usage
|
||||
echo Usage: precompile.bat --identity "project-root" "firmware_identity.json" "generated-dir" 1>&2
|
||||
echo Legacy: precompile.bat "project-root" "output-header" 1>&2
|
||||
exit /b 2
|
||||
13
tools/firmware-build/keil/postcompile.bat
Normal file
13
tools/firmware-build/keil/postcompile.bat
Normal file
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
setlocal DisableDelayedExpansion
|
||||
if "%~1"=="" goto usage
|
||||
if not "%~2"=="" goto usage
|
||||
if not exist "%~1" (
|
||||
echo [firmware-build] Release config not found: "%~1" 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
call "%~dp0..\..\firmware-publish\PUBLISH_FIRMWARE.bat" --config "%~f1" --preflight
|
||||
exit /b %errorlevel%
|
||||
:usage
|
||||
echo Usage: postcompile.bat "firmware-release.cmd" 1>&2
|
||||
exit /b 2
|
||||
14
tools/firmware-build/keil/precompile.bat
Normal file
14
tools/firmware-build/keil/precompile.bat
Normal file
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
setlocal DisableDelayedExpansion
|
||||
if "%~1"=="" goto usage
|
||||
if "%~2"=="" goto usage
|
||||
if not "%~3"=="" goto usage
|
||||
if not exist "%~1\." (
|
||||
echo [firmware-build] Project directory not found: "%~1" 1>&2
|
||||
exit /b 2
|
||||
)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\..\..\c\firmware-info\tools\make_build_id.ps1" -Repository "%~f1" -Output "%~f2"
|
||||
exit /b %errorlevel%
|
||||
:usage
|
||||
echo Usage: precompile.bat "project-root" "output-header" 1>&2
|
||||
exit /b 2
|
||||
Reference in New Issue
Block a user