added readme
[tida-00561-firmware-files/tida-00561-firmware-files.git] / merge.bat
1 @echo off
2 :: ============================
3 @echo.
4 @echo Create combined HEX files
5 @echo.
6 :: ============================
7 :: User's guide for hexmerge.py: http://pythonhosted.org/IntelHex/part3-4.html
9 pushd ..
11 :: Path names
12 @set DEST_PATH=app\FlashOnly_OAD
13 @set APP_PATH=app\FlashOnly_OAD
14 @set STACK_PATH=stack\FlashROM
15 @set BIM_PATH=..\..\..\util\bim_extflash\cc2640\ccs\FlashOnly_ST
17 :: Set application name
18 @set APP_NAME=sensortag_cc2650stk
20 :: Calculate file names
21 @set APP_IMG=%APP_NAME%_app.hex
22 @set STACK_IMG=%APP_IMG:app=stack%
23 @set APST_IMG=%APP_IMG:app=app_stack_oad%
24 @set ALL_IMG=%APP_IMG:app=all%
26 :: Application image start at address 0x1000 (page 0 reserved for BIM vector table)
27 @set APP_IMG_START=1000
29 :: Stack image end (page 31 reserved for BIM and CCFG)
30 @set OAD_STACK_END=1EFFF
32 :: 1) OAD image (application + stack, placed from 0x1000 to 0x1EFFF). For download using OAD or flash programmer
33 "C:\Python27\python" "C:\Python27\Scripts\hexmerge.py" -o "%DEST_PATH%\%APST_IMG%" -r "%APP_IMG_START%:%OAD_STACK_END%" "--overlap=error"  "%APP_PATH%\%APP_IMG%":%APP_IMG_START%: "%STACK_PATH%\%STACK_IMG%"::%OAD_STACK_END%
34 echo Created %DEST_PATH%\%APST_IMG%
36 :: 2) Full executable image (application + stack + BIM). For use with flash programmer
37 "C:\Python27\python" "C:\\Python27\\Scripts\hexmerge.py" -o "%DEST_PATH%\%ALL_IMG%" "--overlap=error"  "%DEST_PATH%\%APST_IMG%" %BIM_PATH%\bim_extflash.hex
38 echo Created %DEST_PATH%\%ALL_IMG%
40 pause