fix(firmware-info): подключи Keil к JSON-схеме версии
Добавь prepare/seal для Keil через общий identity.py, образец конфигурации и команды Before/After Build. Для новой схемы не требуется отдельная release-конфигурация CMD или SETGUI. Проверь HEX/BIN, SHA-256, аргументы и пути с пробелами.
This commit is contained in:
File diff suppressed because one or more lines are too long
5
tools/firmware-build/keil/firmware_identity.example.json
Normal file
5
tools/firmware-build/keil/firmware_identity.example.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"product": "MY_CONTROLLER",
|
||||||
|
"target": "STM32F407",
|
||||||
|
"version": [0, 1, 0]
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal DisableDelayedExpansion
|
setlocal EnableExtensions DisableDelayedExpansion
|
||||||
|
if /i "%~1"=="--identity" goto identity
|
||||||
|
rem Legacy mode retained for existing SETGUI publication configurations.
|
||||||
if "%~1"=="" goto usage
|
if "%~1"=="" goto usage
|
||||||
if not "%~2"=="" goto usage
|
if not "%~2"=="" goto usage
|
||||||
if not exist "%~1" (
|
if not exist "%~1" (
|
||||||
@@ -8,6 +10,22 @@ if not exist "%~1" (
|
|||||||
)
|
)
|
||||||
call "%~dp0..\..\firmware-publish\PUBLISH_FIRMWARE.bat" --config "%~f1" --preflight
|
call "%~dp0..\..\firmware-publish\PUBLISH_FIRMWARE.bat" --config "%~f1" --preflight
|
||||||
exit /b %errorlevel%
|
exit /b %errorlevel%
|
||||||
|
:identity
|
||||||
|
if "%~2"=="" goto usage
|
||||||
|
if "%~3"=="" goto usage
|
||||||
|
if not "%~4"=="" goto usage
|
||||||
|
if /i not "%~x2"==".hex" if /i not "%~x2"==".bin" (
|
||||||
|
echo [firmware-build] Expected a ready HEX or BIN image: "%~2" 1>&2
|
||||||
|
exit /b 2
|
||||||
|
)
|
||||||
|
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" seal --image "%~f2" --metadata "%~f3"
|
||||||
|
if errorlevel 1 exit /b %errorlevel%
|
||||||
|
python "%~dp0..\..\..\c\firmware-info\tools\identity.py" verify --image "%~f2" --manifest "%~f2.manifest.json"
|
||||||
|
if errorlevel 1 exit /b %errorlevel%
|
||||||
|
echo [firmware-build] Image: "%~f2"
|
||||||
|
echo [firmware-build] Manifest: "%~f2.manifest.json"
|
||||||
|
echo [firmware-build] SHA-256: "%~f2.sha256"
|
||||||
|
exit /b 0
|
||||||
:usage
|
:usage
|
||||||
echo Usage: postcompile.bat "firmware-release.cmd" 1>&2
|
echo Usage: postcompile.bat --identity "image.hex-or-bin" "generated-metadata.json" 1>&2
|
||||||
exit /b 2
|
exit /b 2
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal DisableDelayedExpansion
|
setlocal EnableExtensions DisableDelayedExpansion
|
||||||
|
if /i "%~1"=="--identity" goto identity
|
||||||
|
rem Legacy mode: build ID header only.
|
||||||
if "%~1"=="" goto usage
|
if "%~1"=="" goto usage
|
||||||
if "%~2"=="" goto usage
|
if "%~2"=="" goto usage
|
||||||
if not "%~3"=="" goto usage
|
if not "%~3"=="" goto usage
|
||||||
@@ -9,6 +11,14 @@ if not exist "%~1\." (
|
|||||||
)
|
)
|
||||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\..\..\c\firmware-info\tools\make_build_id.ps1" -Repository "%~f1" -Output "%~f2"
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0..\..\..\c\firmware-info\tools\make_build_id.ps1" -Repository "%~f1" -Output "%~f2"
|
||||||
exit /b %errorlevel%
|
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
|
:usage
|
||||||
echo Usage: precompile.bat "project-root" "output-header" 1>&2
|
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
|
exit /b 2
|
||||||
|
|||||||
Reference in New Issue
Block a user