7bc4965bbf9517a167c0acc9491e27903c50bb87
[processor-sdk/pdk.git] / packages / pdkAppImageCreate.bat
1 @REM ******************************************************************************\r
2 @REM * FILE PURPOSE: PDK Unit Test and Example Project Creator\r
3 @REM ******************************************************************************\r
4 @REM * FILE NAME: pdkAppImageCreate.bat\r
5 @REM *\r
6 @REM * DESCRIPTION: \r
7 @REM *  The script file is used to create bootable application binaries from the\r
8 @REM *  executable generated by the CCS Projects.\r
9 @REM *\r
10 @REM * Syntax:\r
11 @REM *  pdkAppImageCreate.bat [PDK_PATH] [CG_TOOL_PATH] [APP_PATH] [APP_NAME] [SOC] [PROCESSOR]\r
12 @REM *\r
13 @REM *\r
14 @REM * Copyright (C) 2016-2018, Texas Instruments, Inc.\r
15 @REM *****************************************************************************\r
16 @echo off\r
17 \r
18 set PDK_PATH=%1\r
19 set CG_TOOL_PATH=%2\r
20 set APP_PATH=%3\r
21 set APP_NAME=%4\r
22 set SOC=%5\r
23 set PROCESSOR=%6\r
24 \r
25 @if %SOC% == AM437x (\r
26     goto SOC_AM3_AM4\r
27 )\r
28 @if %SOC% == AM335x (\r
29     goto SOC_AM3_AM4\r
30 )\r
31 @if %SOC% == AM572x (\r
32     goto SOC_AM57XX\r
33 )\r
34 @if %SOC% == AM574x (\r
35     goto SOC_AM57XX\r
36 )\r
37 @if %SOC% == AM571x (\r
38     goto SOC_AM57XX\r
39\r
40 @if %SOC% == am65xx (\r
41     goto SOC_K3\r
42\r
43 @if %SOC% == am64x (\r
44     goto SOC_K3\r
45 )\r
46 @if %SOC% == j721e (\r
47     goto SOC_K3\r
48\r
49 @if %SOC% == K2G (\r
50     goto SOC_K2G\r
51 )\r
52 @if %SOC% == OMAPL137 (\r
53     goto SOC_OMAPL13X\r
54 )\r
55 @if %SOC% == OMAPL138 (\r
56     goto SOC_OMAPL13X\r
57 )\r
58 \r
59 @goto ENDSCRIPT\r
60 \r
61 :SOC_AM57XX\r
62     if %PROCESSOR% == arm (\r
63         set BIN_PATH=%APP_PATH%\r
64         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
65         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
66         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
67     )\r
68     if %PROCESSOR% == dsp (\r
69         set BIN_PATH=%APP_PATH%\r
70         set APP_DSP1=%APP_PATH%/%APP_NAME%.out\r
71         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
72         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
73     )\r
74     if %PROCESSOR% == m4 (\r
75         set BIN_PATH=%APP_PATH%\r
76         set APP_IPU1_CPU0=%APP_PATH%/%APP_NAME%.out\r
77         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
78         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
79     )\r
80     goto ENDSCRIPT\r
81 \r
82 :SOC_K3\r
83     @REM Refer to SBL document for core ID value (0, or 4 bellow).\r
84     if %PROCESSOR% == mpu (\r
85         set BIN_PATH=%APP_PATH%\r
86         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
87         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 0 %APP_PATH%/%APP_NAME%.out\r
88     )\r
89     if %PROCESSOR% == mcu (\r
90         set BIN_PATH=%APP_PATH%\r
91         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
92         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 4 %APP_PATH%/%APP_NAME%.out\r
93     )\r
94     goto ENDSCRIPT\r
95 :SOC_K2G\r
96     if %PROCESSOR% == arm (\r
97         set BIN_PATH=%APP_PATH%\r
98         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
99         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
100         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
101     )\r
102     if %PROCESSOR% == dsp (\r
103         set BIN_PATH=%APP_PATH%\r
104         set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
105         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
106         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
107     )\r
108     goto ENDSCRIPT\r
109 \r
110 :SOC_AM3_AM4\r
111     %CG_TOOL_PATH%/bin/arm-none-eabi-objcopy -O binary %APP_NAME%.out %APP_NAME%.bin\r
112     %PDK_PATH%/ti/starterware/tools/ti_image/tiimage.exe 0x80000000 NONE %APP_NAME%.bin app )\r
113     goto ENDSCRIPT\r
114 \r
115 :SOC_OMAPL13X\r
116     if %PROCESSOR% == arm (\r
117         set BIN_PATH=%APP_PATH%\r
118         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
119         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
120         call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
121     )\r
122     if %PROCESSOR% == dsp (\r
123         set BIN_PATH=%APP_PATH%\r
124         set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
125         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
126         call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
127     )\r
128     goto ENDSCRIPT\r
129 \r
130 :ENDSCRIPT\r