Commit 8b137863 authored by axel.maurer's avatar axel.maurer
Browse files

Umstellung auf make.bat

parent 3357ce65
......@@ -641,7 +641,7 @@ int CreateApp(int masterAppId, int appId, char *resultStr)
mks.NumberOfKeys = 3;
mks.KeyType = DESF_KEYTYPE_AES;
default:
default:
break;
}
if (!DESFire_CreateApplication(CRYPTO_ENV0, appId, &mks))
......
@echo off
rem Das Verzeichnis sollte den gleichen Namen haben, wie die Source-Datei
rem Falls nicht muss das in dieser Datei angepasst werden
set PROJECT_DIR=KIT-Card
set PROJECT_SOURCE=KIT-Card
set PROJECT=KIT-Card_Reader
rem Development KIT Version
set DEV_VERSION=405
set FIRMWARE_VERSION=%DEV_VERSION%
set ELATEC_DIR=C:\Users\xy0007\Documents\KIT-Card\Elatec\TWN4DevPack%DEV_VERSION%
set BIX_FILE=TWN4_CCx%FIRMWARE_VERSION%_KIT100_%PROJECT%.bix
set FIRMWARE_PATH=Firmware\TWN4_xKx%FIRMWARE_VERSION%_STD204_Multi_Keyboard_Standard.bix
@REM set FIRMWARE_PATH=Firmware\TWN4_xCx401_STD204_Multi_CDC_Standard.bix
rem eventuell zu setzende Compiler Switches. Es können auch mehrere -D gesetzt werden
@REM set DEBUG= -DDEBUG
set READER_ACTION= -DREADER_ACTION=65
@REM set SECURE= -DSECURE
set GERMAN_KEYBOARD= -DGERMAN_KEYBOARD
c:
cd %ELATEC_DIR%\Apps\%PROJECT_DIR%
"%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-gcc" -std=c99 -mcpu=cortex-m0 -Os -ffunction-sections -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms="App_KITC100_%PROJECT%.lst" -DAPPCHARS=KITC -DVERSION=0x100 -DAPPEXTCONFIG=0 %DEBUG% %SECURE% %READER_ACTION% %GERMAN_KEYBOARD% -I. -I"%ELATEC_DIR%\Tools\sys" "%ELATEC_DIR%\Tools\sys\twn4.crt.c" "%PROJECT_SOURCE%.c" -nostartfiles -T"%ELATEC_DIR%\Tools\sys\app.ld" -Wl,--gc-sections,-e,AppHeader,--no-print-gc-sections,-Map="App_KITC100_%PROJECT%.map",--cref,--no-warn-mismatch "%ELATEC_DIR%\Tools\sys\libapp.a" -lc -o "App_KITC100_%PROJECT%.elf"
if errorlevel 1 goto ende
copy "%ELATEC_DIR%\%FIRMWARE_PATH%" TWN4_%DEV_VERSION%.bix
"%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-objcopy" -O ihex "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.hex"
if errorlevel 1 goto ende
"%ELATEC_DIR%\Tools\makeapp" -tTWN4 -nTWN4 "-iTWN4_%DEV_VERSION%.bix" "-hApp_KITC100_%PROJECT%.hex" "-o%BIX_FILE%"
if errorlevel 1 goto ende
del "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.lst" "App_KITC100_%PROJECT%.map" "App_KITC100_%PROJECT%.hex" "TWN4_%DEV_VERSION%.bix"
"%ELATEC_DIR%\Tools\flash" USB %BIX_FILE%
:ende
\ No newline at end of file
@echo off
rem Das Verzeichnis sollte den gleichen Namen haben, wie die Source-Datei
rem Falls nicht muss das in dieser Datei angepasst werden
set PROJECT_DIR=KIT-Card
set PROJECT_SOURCE=KIT-Card
set PROJECT=KIT-Card_Serial
rem Development KIT Version
set DEV_VERSION=405
set FIRMWARE_VERSION=%DEV_VERSION%
set ELATEC_DIR=C:\Users\xy0007\Documents\KIT-Card\Elatec\TWN4DevPack%DEV_VERSION%
set BIX_FILE=TWN4_CCx%FIRMWARE_VERSION%_KIT100_%PROJECT%.bix
set FIRMWARE_PATH=Firmware\TWN4_xCx%FIRMWARE_VERSION%_STD204_Multi_CDC_Standard.bix
rem eventuell zu setzende Compiler Switches. Es können auch mehrere -D gesetzt werden
@REM set DEBUG= -DDEBUG
@REM set READER_ACTION= -DREADER_ACTION=1
@REM set SECURE= -DSECURE
c:
cd %ELATEC_DIR%\Apps\%PROJECT_DIR%
"%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-gcc" -std=c99 -mcpu=cortex-m0 -Os -ffunction-sections -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms="App_KITC100_%PROJECT%.lst" -DAPPCHARS=KITC -DVERSION=0x100 -DAPPEXTCONFIG=0 %DEBUG% %SECURE% %READER_ACTION% -I. -I"%ELATEC_DIR%\Tools\sys" "%ELATEC_DIR%\Tools\sys\twn4.crt.c" "%PROJECT_SOURCE%.c" -nostartfiles -T"%ELATEC_DIR%\Tools\sys\app.ld" -Wl,--gc-sections,-e,AppHeader,--no-print-gc-sections,-Map="App_KITC100_%PROJECT%.map",--cref,--no-warn-mismatch "%ELATEC_DIR%\Tools\sys\libapp.a" -lc -o "App_KITC100_%PROJECT%.elf"
if errorlevel 1 goto ende
copy "%ELATEC_DIR%\%FIRMWARE_PATH%" TWN4_%DEV_VERSION%.bix
"%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-objcopy" -O ihex "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.hex"
if errorlevel 1 goto ende
"%ELATEC_DIR%\Tools\makeapp" -tTWN4 -nTWN4 "-iTWN4_%DEV_VERSION%.bix" "-hApp_KITC100_%PROJECT%.hex" "-o%BIX_FILE%"
if errorlevel 1 goto ende
del "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.lst" "App_KITC100_%PROJECT%.map" "App_KITC100_%PROJECT%.hex" "TWN4_%DEV_VERSION%.bix"
"%ELATEC_DIR%\Tools\flash" USB %BIX_FILE%
@REM exit
timeout /T 2
python -m serial.tools.miniterm -e --exit-char 25 com9
:ende
\ No newline at end of file
@echo off
SETLOCAL
goto :init
:header
echo %__NAME% v%__VERSION%
echo generates ELATEC Firmware and loads it.
echo.
goto :eof
:usage
echo USAGE:
echo %__BAT_NAME% [flags] "serial|reader"
echo.
echo. -?, --help shows this help
echo. -v, --version shows the version
echo. -e, --verbose shows detailed output
echo. -d, --debug debug messages on
echo. -ek, --english_keyboard set keyboard emulation mode in reader mode to english (default is german)
echo. -r, --reader_action "action" set the reader action
echo. This option is mandatory in reader mode
goto :eof
:version
if "%~1"=="full" call :header & goto :eof
echo. Make Version: %__VERSION%
echo. ElATEC dev kit Version: %DEV_VERSION%
goto :eof
:missing_argument
call :header
call :usage
echo.
echo **** ****
echo **** MISSING "REQUIRED ARGUMENT" ****
echo **** ****
echo.
goto :eof
:init
rem Development KIT Version
set PROJECT=KIT-Card
set PROJECT_SOURCE_FILE=KIT-Card.c
set "DEV_VERSION=405"
set "FIRMWARE_VERSION=%DEV_VERSION%"
set "ELATEC_DIR=C:\Users\xy0007\Documents\KIT-Card\Elatec\TWN4DevPack%DEV_VERSION%"
set "BIX_FILE=TWN4_CCx%FIRMWARE_VERSION%_KIT100_%PROJECT%.bix"
set "FIRMWARE_PATH_SERIAL=Firmware\TWN4_xCx%FIRMWARE_VERSION%_STD204_Multi_CDC_Standard.bix"
set "FIRMWARE_PATH_READER=Firmware\TWN4_xKx%FIRMWARE_VERSION%_STD204_Multi_Keyboard_Standard.bix"
set "COMPILER=%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-gcc"
set "__NAME=%~n0"
set "__VERSION=1.01"
set "__BAT_FILE=%~0"
set "__BAT_PATH=%~dp0"
set "__BAT_NAME=%~nx0"
set "UnNamedArgument="
set "UnNamedOptionalArg="
set "NamedFlag="
set "CompilerOptions="
:parse
if "%~1"=="" goto :validate
if /i "%~1"=="-?" call :header & call :usage "%~2" & goto :end
if /i "%~1"=="--help" call :header & call :usage "%~2" & goto :end
if /i "%~1"=="-v" call :version & goto :end
if /i "%~1"=="--version" call :version full & goto :end
if /i "%~1"=="-e" set "OptVerbose=yes" & shift & goto :parse
if /i "%~1"=="--verbose" set "OptVerbose=yes" & shift & goto :parse
if /i "%~1"=="-d" set "DebugOption=yes" & shift & goto :parse
if /i "%~1"=="--debug" set "DebugOption=yes" & shift & goto :parse
if /i "%~1"=="-s" set "SecureOption=yes" & shift & goto :parse
if /i "%~1"=="--secure" set "SecureOption=yes" & shift & goto :parse
if /i "%~1"=="-r" set "ReaderAction=%~2" & shift & shift & goto :parse
if /i "%~1"=="--reader_action" set "ReaderAction=%~2" & shift & shift & goto :parse
if /i "%~1"=="-ek" set "eng_keyboard=yes" & shift & goto :parse
if /i "%~1"=="--english_keyboard" set "eng_keyboard=yes" & shift & goto :parse
if not defined UnNamedArgument set "UnNamedArgument=%~1" & shift & goto :parse
shift
goto :parse
:validate
if not defined UnNamedArgument call :missing_argument & goto :end
if /i "%UnNamedArgument%"=="reader" (
if not defined ReaderAction (call :missing_argument & goto :end)
)
:main
if defined DebugOption (
set DEBUG= -DDEBUG
)
if defined SecureOption (
set SECURE= -DSECURE
)
if defined ReaderAction (
set READER_ACTION= -DREADER_ACTION=%ReaderAction%
)
if not defined eng_keyboard (
set GERMAN_KEYBOARD= -DGERMAN_KEYBOARD
)
set "CompilerOptions=%DEBUG%%SECURE%%READER_ACTION%%GERMAN_KEYBOARD%"
if /i "%UnNamedArgument%"=="serial" set FIRMWARE_PATH=%FIRMWARE_PATH_SERIAL%
if /i "%UnNamedArgument%"=="reader" set FIRMWARE_PATH=%FIRMWARE_PATH_READER%
if not defined FIRMWARE_PATH call :missing_argument & goto :end
if defined OptVerbose (
echo making with follwoing parameters:
echo "UnNamedArgument"=%UnNamedArgument%
echo "FIRMWARE_PATH"=%FIRMWARE_PATH%
echo "CompilerOptions"=%CompilerOptions%
)
set COMPILER_PARMSTR=-std=c99 -mcpu=cortex-m0 -Os -ffunction-sections -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms="App_KITC100_%PROJECT%.lst" -DAPPCHARS=KITC -DVERSION=0x100 -DAPPEXTCONFIG=0 %DEBUG% %SECURE% %READER_ACTION% %GERMAN_KEYBOARD% -I. -I"%ELATEC_DIR%\Tools\sys" "%ELATEC_DIR%\Tools\sys\twn4.crt.c" "%PROJECT_SOURCE_FILE%" -nostartfiles -T"%ELATEC_DIR%\Tools\sys\app.ld" -Wl,--gc-sections,-e,AppHeader,--no-print-gc-sections,-Map="App_KITC100_%PROJECT%.map",--cref,--no-warn-mismatch "%ELATEC_DIR%\Tools\sys\libapp.a" -lc -o "App_KITC100_%PROJECT%.elf"
%COMPILER% %COMPILER_PARMSTR%
if errorlevel 1 goto end
@REM copy "%ELATEC_DIR%\%FIRMWARE_PATH%" TWN4_%DEV_VERSION%.bix
"%ELATEC_DIR%\Tools\Yagarto-20110328\bin\arm-none-eabi-objcopy" -O ihex "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.hex"
if errorlevel 1 goto end
"%ELATEC_DIR%\Tools\makeapp" -tTWN4 -nTWN4 "-i%ELATEC_DIR%\%FIRMWARE_PATH%" "-hApp_KITC100_%PROJECT%.hex" "-o%BIX_FILE%"
if errorlevel 1 goto end
del "App_KITC100_%PROJECT%. elf" "App_KITC100_%PROJECT%.lst" "App_KITC100_%PROJECT%.map" "App_KITC100_%PROJECT%.hex" "TWN4_%DEV_VERSION%.bix"
"%ELATEC_DIR%\Tools\flash" USB %BIX_FILE%
@REM goto end
timeout /T 2
python -m serial.tools.miniterm -e --exit-char 25 com9
:end
exit /B
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment