ffcd721fd088e1b892a461f418434204107ad57e
[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 PDK_INSTALL_PATH=%PDK_PATH%\r
20 set CG_TOOL_PATH=%2\r
21 set APP_PATH=%3\r
22 set APP_NAME=%4\r
23 set SOC=%5\r
24 set PROCESSOR=%6\r
25 \r
26 @if %SOC% == AM437x (\r
27     goto SOC_AM3_AM4\r
28 )\r
29 @if %SOC% == AM335x (\r
30     goto SOC_AM3_AM4\r
31 )\r
32 @if %SOC% == AM572x (\r
33     goto SOC_AM57XX\r
34 )\r
35 @if %SOC% == AM574x (\r
36     goto SOC_AM57XX\r
37 )\r
38 @if %SOC% == AM571x (\r
39     goto SOC_AM57XX\r
40\r
41 @if %SOC% == am65xx (\r
42     goto SOC_K3\r
43\r
44 @if %SOC% == am64x (\r
45     goto SOC_K3\r
46 )\r
47 @if %SOC% == j721e (\r
48     goto SOC_K3\r
49\r
50 @if %SOC% == K2G (\r
51     goto SOC_K2G\r
52 )\r
53 @if %SOC% == OMAPL137 (\r
54     goto SOC_OMAPL13X\r
55 )\r
56 @if %SOC% == OMAPL138 (\r
57     goto SOC_OMAPL13X\r
58 )\r
59 \r
60 @goto ENDSCRIPT\r
61 \r
62 :SOC_AM57XX\r
63     if %PROCESSOR% == arm (\r
64         set BIN_PATH=%APP_PATH%\r
65         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
66         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
67         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
68     )\r
69     if %PROCESSOR% == dsp (\r
70         set BIN_PATH=%APP_PATH%\r
71         set APP_DSP1=%APP_PATH%/%APP_NAME%.out\r
72         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
73         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
74     )\r
75     if %PROCESSOR% == m4 (\r
76         set BIN_PATH=%APP_PATH%\r
77         set APP_IPU1_CPU0=%APP_PATH%/%APP_NAME%.out\r
78         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
79         call %PDK_PATH%/ti/boot/sbl/tools/scripts/AM57xImageGen.bat\r
80     )\r
81     goto ENDSCRIPT\r
82 \r
83 :SOC_K3\r
84     @REM Refer to SBL document for core ID value (0, or 4 bellow).\r
85     if %PROCESSOR% == mpu (\r
86         set BIN_PATH=%APP_PATH%\r
87         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
88         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 0 %APP_PATH%/%APP_NAME%.out\r
89     )\r
90     if %PROCESSOR% == mcu (\r
91         set BIN_PATH=%APP_PATH%\r
92         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
93         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K3ImageGen.bat 4 %APP_PATH%/%APP_NAME%.out\r
94     )\r
95     goto ENDSCRIPT\r
96 :SOC_K2G\r
97     if %PROCESSOR% == arm (\r
98         set BIN_PATH=%APP_PATH%\r
99         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
100         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
101         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
102     )\r
103     if %PROCESSOR% == dsp (\r
104         set BIN_PATH=%APP_PATH%\r
105         set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
106         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
107         call %PDK_PATH%/ti/boot/sbl/tools/scripts/K2GImageGen.bat\r
108     )\r
109     goto ENDSCRIPT\r
110 \r
111 :SOC_AM3_AM4\r
112     %CG_TOOL_PATH%/bin/arm-none-eabi-objcopy -O binary %APP_NAME%.out %APP_NAME%.bin\r
113     %PDK_PATH%/ti/starterware/tools/ti_image/tiimage.exe 0x80000000 NONE %APP_NAME%.bin app )\r
114     goto ENDSCRIPT\r
115 \r
116 :SOC_OMAPL13X\r
117     if %PROCESSOR% == arm (\r
118         set BIN_PATH=%APP_PATH%\r
119         set APP_MPU_CPU0=%APP_PATH%/%APP_NAME%.out\r
120         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
121         call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
122     )\r
123     if %PROCESSOR% == dsp (\r
124         set BIN_PATH=%APP_PATH%\r
125         set APP_DSP0=%APP_PATH%/%APP_NAME%.out\r
126         set TOOLS_PATH=%PDK_PATH%/ti/boot/sbl/tools\r
127         call %PDK_PATH%/ti/boot/sbl/tools/scripts/OMAPL13xImageGen.bat\r
128     )\r
129     goto ENDSCRIPT\r
130 \r
131 :ENDSCRIPT\r