1 # ******************************************************************************
2 # * FILE PURPOSE: PDK Unit Test and Example Project Creator
3 # ******************************************************************************
4 # * FILE NAME: pdkProjectCreate.sh
5 # *
6 # * DESCRIPTION:
7 # * The script file is used to create the test and example projects of all
8 # * components under PDK. These projects are available in the specified
9 # * workspace.
10 # *
11 # * USAGE:
12 # * pdkProjectCreate.sh [soc] [board] [endian] [module] [project type] [processor] [SECUREMODE=<yes/no>]
13 # *
14 # * Description: (first option is default)
15 # * soc - AM335x / AM437x / AM571x / AM572x / AM574x / K2E / K2G / K2K / K2H / K2L /
16 # * C6678 / C6657 / DRA72x / DRA75x / DRA78x / OMAPL137 / OMAPL138 / C6748 / am65xx
17 # * board - all (use "all" for K2X and C66X SOCs)
18 # * -or-
19 # * Refer to pdk_<soc>_<version>\packages\ti\board\lib
20 # * for valid board inputs for the soc
21 # * endian - little / big
22 # * module - all
23 # * -or-
24 # * aif2 / bcp / cppi / csl / dfe / emac / fatfs / fm / fftc /
25 # * gpio / hyplnk / i2c / icss_emac / iqn2 / mcasp / mcbsp / mmap / mmcsd /
26 # * nimu / nimu_icss / nwal / osal / pa / pcie / pktlib / pruss / qm / rm /
27 # * sa / serdes-diag / spi / srio / tcp3d / tfw / transportqmss /
28 # * transportsrio / tsip / uart / usb / wdtimer / vps / dcan / dss / lcdc
29 # * project type - all / example / test
30 # * processor - arm / dsp / m4 / mcu / mpu
31 # * SECUREMODE - yes/no (optional argument). If unspecificed non-secure mode is assumed.
32 # *
33 # * Example:
34 # * a) pdkProjectCreate.sh
35 # * - Creates all module projects for the AM335x soc for arm little endian
36 # * b) pdkProjectCreate.sh AM437x
37 # * - Creates all module projects for the AM437x soc for arm little endian
38 # * c) pdkProjectCreate.sh AM437x idkAM437x
39 # * - Creates all module projects for idkAM437x device for arm little endian
40 # * d) pdkProjectCreate.sh AM571x evmAM571x little
41 # * - Creates all module projects for evmAM571x device for arm little endian
42 # * e) pdkProjectCreate.sh AM571x evmAM571x little i2c all dsp
43 # * - Creates all i2c module projects for evmAM571x device for dsp little endian
44 # * f) pdkProjectCreate.sh K2H all little i2c example arm
45 # * - Creates i2c module example projects for K2H device for arm little endian
46 # * g) pdkProjectCreate.sh C6678 all little hyplnk test dsp
47 # * - Creates hyplnk module test projects for C6678 device for dsp little endian
48 # * h) pdkProjectCreate.sh K2G evmK2G little mcasp all dsp SECUREMODE=yes
49 # * - Creates mcasp module test projects for dsp little endian to be run on evmK2G
50 # * which is in secure mode
51 # *
52 # * Copyright (C) 2012-2019, Texas Instruments, Inc.
53 # *****************************************************************************
55 # Lists of valid input parameters - MUST be updated as new input parameters are added
56 # *****************************************************************************
57 soc_list=("AM335x" "AM437x" "AM571x" "AM572x" "AM574x" "K2E" "K2K" "K2H" "K2L" "K2G" "C6678" "C6657" "DRA72x" "DRA75x" "DRA78x" "OMAPL137" "OMAPL138" "C6748" "am65xx")
58 endian_list=("little" "big")
59 module_list=("all" "aif2" "bcp" "cppi" "csl" "dfe" "emac" "fatfs" "fm" "fftc" "gpio" "gpmc" "hyplnk" "i2c" "icss_emac" "iqn2" "mcasp" "mcbsp" "mmap" "mmcsd" "nimu" "nimu_icss" "nwal" "osal" "pa" "pcie" "pktlib" "pruss" "qm" "rm" "sa" "serdes_diag" "spi" "srio" "tcp3d" "tfw" "transportqmss" "transportsrio" "tsip" "uart" "usb" "wdtimer" "vps" "dcan" "dss" "lcdc" "timeSync")
60 projectType_list=("all" "example" "test")
61 proc_list=("arm" "dsp" "m4" "mpu" "mcu")
63 # Parameter Validation: Check if the argument was passed to the batch file.
64 # *****************************************************************************
65 # Argument [soc] is used to set SOC variable.
66 if [ -n "$1" ]; then
67 export SOC="$1"
68 else
69 export SOC="AM335x"
70 fi
72 # Argument [board] is used to set BOARD variable.
73 # This is the board type of the soc for which project are to be created.
74 if [ -n "$2" ]; then
75 export BOARD="$2"
76 else
77 export BOARD="all"
78 fi
80 # Argument [endian] is used to set ENDIAN variable.
81 # This is Endianess of the projects being created.
82 # Valid Values are 'little' and 'big'. Defaults to 'little'.
83 if [ -n "$3" ]; then
84 export ENDIAN="$3"
85 else
86 export ENDIAN="little"
87 fi
89 # Argument [module] is used to set MODULE variable.
90 # This is specific module for which projects are created.
91 # Valid Values are LLD name. Defaults to all LLD's.
92 if [ -n "$4" ]; then
93 export MODULE="$4"
94 else
95 export MODULE="all"
96 fi
98 # Argument [proj type] is used to set PROJECT_TYPE variable.
99 # This is the type of projects that are created
100 # Valid Values are all, example, or test . Defaults to all.
101 if [ -n "$5" ]; then
102 export PROJECT_TYPE="$5"
103 else
104 export PROJECT_TYPE="all"
105 fi
107 # Argument [processor] is used to set PROCESSOR variable.
108 # This is specific processor type for which projects are created.
109 # Valid Values are arm, dsp, or m4 . Defaults to arm.
110 if [ -n "$6" ]; then
111 export PROCESSOR="$6"
112 else
113 export PROCESSOR="arm"
114 fi
116 # Argument [SECUREMODE] is used to set SECUREMODE variable.
117 # Default to non secure mode if this argument is not specified
118 if [ -n "$7" ]; then
119 if [ "$7" == "SECUREMODE=yes" ]; then
120 echo "The board is in secure mode"
121 export SECUREMODE="yes"
122 else
123 echo "The board is non in secure mode"
124 export SECUREMODE="no"
125 fi
126 else
127 export SECUREMODE="no"
128 fi
130 # If the below entries need to be added for ARM sysbios config files
131 export RTSCCFG_ENTRY_SECUREMODE_ARM="
132 /* Start of lines added for secure device */
133 var gicHwi = xdc.useModule('ti.sysbios.family.arm.gic.Hwi');
134 gicHwi.enableSecureMode = false;
135 gicHwi.BPR = 3;
136 gicHwi.NUM_PRIORITY_BITS = 4;
137 /* End of Lines added for secure device */
138 "
139 # If the below entries need to be added for DSP sysbios config files
140 export RTSCCFG_ENTRY_SECUREMODE_DSP="
141 /* Start of lines added for secure device */
142 var BIOS = xdc.useModule('ti.sysbios.BIOS');
143 BIOS.useSK = true;
144 BIOS.setupSecureContext = true;
145 BIOS.libType = BIOS.LibType_Custom;
146 /* End of Lines added for secure device */
147 "
148 export PDK_SHORT_NAME=$PWD
150 # This define is used to patch the GP EVM CFG file if the SECUREMODE is enabled.
151 # Some EVMs like K2G would need the patch, where as AM437x does not in SECURE MODE
152 # This define will help with the selective patching
153 export SEC_CFG_FILE_UPDATE_NEEDED="no"
154 # TI SDK root directory
155 if [ -z $SDK_INSTALL_PATH ]; then
156 export SDK_INSTALL_PATH=__SDK__INSTALL_DIR__
157 fi
159 # *****************************************************************************
161 echo "========================================================================="
162 echo "Configuration:"
163 echo " SOC : $SOC"
164 echo " BOARD : $BOARD"
165 echo " ENDIAN : $ENDIAN"
166 echo " MODULE : $MODULE"
167 echo " PROJECT_TYPE : $PROJECT_TYPE"
168 echo " PROCESSOR : $PROCESSOR"
169 echo " PDK_SHORT_NAME : $PDK_SHORT_NAME"
170 echo "========================================================================="
171 echo "Checking Configuration..."
173 error_exit () {
174 echo "Exiting..."
175 echo "========================================================================="
176 exit 1
177 }
179 contains () {
180 local name=$1[@]
181 local list=("${!name}")
182 local in_list=0
184 for item in "${list[@]}"
185 do
186 if [ "$2" = "$item" ]; then
187 in_list=1
188 break
189 fi
190 done
192 if [ $in_list -eq 0 ]; then
193 echo "ERROR: $3 ($2) is invalid"
194 error_exit
195 fi
196 }
198 contains soc_list "$SOC" "SOC"
199 contains endian_list "$ENDIAN" "Endian"
200 contains module_list "$MODULE" "Module"
201 contains projectType_list "$PROJECT_TYPE" "Project Type"
202 contains proc_list "$PROCESSOR" "Processor"
204 if [ $BOARD != "all" ]; then
205 if [ $BOARD = "iceAMIC110" ]; then
206 if [ $SOC != "AM335x" ]; then
207 echo "ERROR: Board ($BOARD) is invalid for the specified SOC ($SOC)"
208 error_exit
209 fi
210 elif [ "${BOARD/$SOC}" = "$BOARD" ]; then
211 echo "ERROR: Board ($BOARD) is invalid for the specified SOC ($SOC)"
212 error_exit
213 fi
214 fi
216 if [ $SOC = "AM335x" ]; then
217 if [ $PROCESSOR = "dsp" ]; then
218 echo "ERROR: The AM335x soc does not contain a DSP processor"
219 error_exit
220 elif [ $PROCESSOR = "m4" ]; then
221 echo "ERROR: The AM335x soc does not contain a M4 processor"
222 error_exit
223 fi
225 if [ $ENDIAN = "big" ]; then
226 echo "ERROR: The AM335x soc's arm does not support big endian"
227 error_exit
228 fi
229 elif [ $SOC = "AM437x" ]; then
230 if [ $PROCESSOR = "dsp" ]; then
231 echo "ERROR: The AM437x soc does not contain a DSP processor"
232 error_exit
233 elif [ $PROCESSOR = "m4" ]; then
234 echo "ERROR: The AM437x soc does not contain a M4 processor"
235 error_exit
236 fi
238 if [ $ENDIAN = "big" ]; then
239 echo "ERROR: The AM437x soc's arm does not support big endian"
240 error_exit
241 fi
242 elif [ $SOC = "AM571x" ]; then
243 if [ $ENDIAN = "big" ]; then
244 echo "ERROR: The AM571x soc's processor's do not support big endian"
245 error_exit
246 fi
247 elif [ $SOC = "AM572x" ]; then
248 if [ $ENDIAN = "big" ]; then
249 echo "ERROR: The AM572x soc's processor's do not support big endian"
250 error_exit
251 fi
252 elif [ $SOC = "AM574x" ]; then
253 if [ $ENDIAN = "big" ]; then
254 echo "ERROR: The AM574x soc's processor's do not support big endian"
255 error_exit
256 fi
257 elif [ $SOC = "K2K" ]; then
258 if [ $PROCESSOR = "m4" ]; then
259 echo "ERROR: The K2K soc does not contain a M4 processor"
260 error_exit
261 fi
262 if [ $PROCESSOR = "arm" ]; then
263 if [ $ENDIAN = "big" ]; then
264 echo "ERROR: The K2K soc's processor's do not support big endian"
265 error_exit
266 fi
267 fi
268 elif [ $SOC = "K2H" ]; then
269 if [ $PROCESSOR = "m4" ]; then
270 echo "ERROR: The K2H soc does not contain a M4 processor"
271 error_exit
272 fi
273 if [ $PROCESSOR = "arm" ]; then
274 if [ $ENDIAN = "big" ]; then
275 echo "ERROR: The K2H soc's processor's do not support big endian"
276 error_exit
277 fi
278 fi
279 elif [ $SOC = "K2E" ]; then
280 if [ $PROCESSOR = "m4" ]; then
281 echo "ERROR: The K2E soc does not contain a M4 processor"
282 error_exit
283 fi
284 if [ $PROCESSOR = "arm" ]; then
285 if [ $ENDIAN = "big" ]; then
286 echo "ERROR: The K2E soc's processor's do not support big endian"
287 error_exit
288 fi
289 fi
290 elif [ $SOC = "K2L" ]; then
291 if [ $PROCESSOR = "m4" ]; then
292 echo "ERROR: The K2L soc does not contain a M4 processor"
293 error_exit
294 fi
295 if [ $PROCESSOR = "arm" ]; then
296 if [ $ENDIAN = "big" ]; then
297 echo "ERROR: The K2L soc's processor's do not support big endian"
298 error_exit
299 fi
300 fi
301 elif [ $SOC = "K2G" ]; then
302 if [ $PROCESSOR = "m4" ]; then
303 echo "ERROR: The K2G soc does not contain a M4 processor"
304 error_exit
305 fi
306 if [ $PROCESSOR = "arm" ]; then
307 if [ $ENDIAN = "big" ]; then
308 echo "ERROR: The K2G soc's processor's do not support big endian"
309 error_exit
310 fi
311 fi
312 elif [ $SOC = "OMAPL137" ]; then
313 if [ $PROCESSOR = "m4" ]; then
314 echo "ERROR: The OMAPL137 soc does not contain a M4 processor"
315 error_exit
316 fi
317 if [ $PROCESSOR = "arm" ]; then
318 if [ $ENDIAN = "big" ]; then
319 echo "ERROR: The OMAPL137 soc's processor's do not support big endian"
320 error_exit
321 fi
322 fi
323 elif [ $SOC = "OMAPL138" ]; then
324 if [ $PROCESSOR = "m4" ]; then
325 echo "ERROR: The OMAPL138 soc does not contain a M4 processor"
326 error_exit
327 fi
328 if [ $PROCESSOR = "arm" ]; then
329 if [ $ENDIAN = "big" ]; then
330 echo "ERROR: The OMAPL138 soc's processor's do not support big endian"
331 error_exit
332 fi
333 fi
334 elif [ $SOC = "C6748" ]; then
335 if [ $PROCESSOR = "m4" ]; then
336 echo "ERROR: The C6748 soc does not contain a M4 processor"
337 error_exit
338 fi
339 if [ $PROCESSOR = "arm" ]; then
340 echo "ERROR: The C6748 soc does not contain an arm processor"
341 error_exit
342 fi
343 if [ $PROCESSOR = "dsp" ]; then
344 if [ $ENDIAN = "big" ]; then
345 echo "ERROR: The C6748 soc's processor's do not support big endian"
346 error_exit
347 fi
348 fi
349 elif [ $SOC = "C6678" ]; then
350 if [ $PROCESSOR = "m4" ]; then
351 echo "ERROR: The C6678 soc does not contain a M4 processor"
352 error_exit
353 fi
354 if [ $PROCESSOR = "arm" ]; then
355 echo "ERROR: The C6678 soc does not contain an arm processor"
356 error_exit
357 fi
358 elif [ $SOC = "C6657" ]; then
359 if [ $PROCESSOR = "m4" ]; then
360 echo "ERROR: The C6657 soc does not contain a M4 processor"
361 error_exit
362 fi
363 if [ $PROCESSOR = "arm" ]; then
364 echo "ERROR: The C6657 soc does not contain an arm processor"
365 error_exit
366 fi
367 elif [ $SOC = "DRA72x" ]; then
368 if [ $ENDIAN = "big" ]; then
369 echo "ERROR: The DRA72x soc's processor's do not support big endian"
370 error_exit
371 fi
372 elif [ $SOC = "DRA75x" ]; then
373 if [ $ENDIAN = "big" ]; then
374 echo "ERROR: The DRA75x soc's processor's do not support big endian"
375 error_exit
376 fi
377 elif [ $SOC = "DRA78x" ]; then
378 if [ $ENDIAN = "big" ]; then
379 echo "ERROR: The DRA78x soc's processor's do not support big endian"
380 error_exit
381 fi
382 elif [ $SOC = "am65xx" ]; then
383 if [ $PROCESSOR = "m4" ]; then
384 echo "ERROR: The am65xx soc does not contain a M4 processor"
385 error_exit
386 fi
387 if [ $PROCESSOR = "dsp" ]; then
388 echo "ERROR: The am65xx soc does not contain a DSP processor"
389 error_exit
390 fi
391 if [ $ENDIAN = "big" ]; then
392 echo "ERROR: The am65xx soc's processor's do not support big endian"
393 error_exit
394 fi
395 else
396 echo "ERROR: Invalid soc"
397 error_exit
398 fi
400 # *****************************************************************************
401 # * Version Information of the various tools etc required to build the test
402 # * projects. Customers are free to modify these to meet their requi#ents.
403 # *****************************************************************************
405 # export to 'no' when using QT, EVM, VDB, or other hardware. export to 'yes'
406 # only when using the simulator.
407 export IS_SIMULATOR_SUPPORT_NEEDED=no
409 # Tools root directory
410 if [ -z $CCS_INSTALL_PATH ]; then
411 export CCS_INSTALL_PATH=~/ti/ccs930/ccs
412 fi
414 # Workspace where the PDK projects will be created.
415 export MY_WORKSPACE=$PDK_SHORT_NAME/MyExampleProjects
417 # macros.ini location
418 export MACROS_FILE=$PDK_SHORT_NAME/macros.ini
420 # This is the format of the executable being created
421 # Valid Values are 'ELF' and 'COFF'
422 export OUTPUT_FORMAT=ELF
424 # Version of CG-Tools
425 export CGT_VERSION=8.3.2
427 # Version of CG-ARM-Tools for M4
428 export CGT_M4_VERSION=18.12.5.LTS
430 # Version of XDC
431 export XDC_VERSION=3.55.02.22
433 # Version of BIOS
434 export BIOS_VERSION=6.76.03.01
436 # Version of CG-Tools for ARM
437 export CGT_VERSION_ARM=GNU_7.2.1:Linaro
439 # Version of CG-Tools for A53
440 export CGT_VERSION_ARM_A53="GNU_7.2.1:Linaro aarch64"
442 # Version of the IPC
443 export IPC_VERSION=__IPC_VER__
445 # EDMA3 Version
446 export EDMA_VERSION=2.12.05.30E
448 # Version of the PDK
449 export PDK_VERSION=__PDK_VER__
451 # Version of the NDK
452 export NDK_VERSION=3.61.01.01
454 # Version of UIA
455 export UIA_VERSION=2.30.01.02
457 # Version of CG-Tools for ARM
458 export CGT_VERSION_ARM9=18.1.5.LTS
460 # PDK Part Number & Platform name
461 if [ "$SOC" = "K2K" ]; then
462 export PDK_PARTNO=TCI6638
463 export PDK_ECLIPSE_ID=com.ti.pdk.k2hk
464 export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6638K2K
465 if [ "$PROCESSOR" == "arm" ]; then
466 export RTSC_TARGET=gnu.targets.arm.A15F
467 export CCS_DEVICE="Cortex A.TCI6638K2K"
468 fi
469 elif [ "$SOC" = "K2H" ]; then
470 export PDK_PARTNO=TCI6636
471 export PDK_ECLIPSE_ID=com.ti.pdk.k2hk
472 export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6636K2H
473 if [ "$PROCESSOR" == "arm" ]; then
474 export RTSC_TARGET=gnu.targets.arm.A15F
475 export CCS_DEVICE="Cortex A.66AK2H12"
476 fi
477 elif [ "$SOC" = "K2L" ]; then
478 export PDK_PARTNO=TCI6630
479 export PDK_ECLIPSE_ID=com.ti.pdk.k2l
480 export RTSC_PLATFORM_NAME=ti.platforms.evmTCI6630K2L
481 if [ "$PROCESSOR" == "arm" ]; then
482 export RTSC_TARGET=gnu.targets.arm.A15F
483 export CCS_DEVICE="Cortex A.TCI6630K2L"
484 fi
485 elif [ "$SOC" = "K2E" ]; then
486 export PDK_PARTNO=66AK2E05
487 export PDK_ECLIPSE_ID=com.ti.pdk.k2e
488 export RTSC_PLATFORM_NAME=ti.platforms.evmC66AK2E
489 if [ "$PROCESSOR" == "arm" ]; then
490 export RTSC_TARGET=gnu.targets.arm.A15F
491 export CCS_DEVICE="Cortex A.66AK2E05"
492 fi
493 elif [ "$SOC" = "OMAPL137" ]; then
494 export PDK_PARTNO=OMAPL137
495 export PDK_ECLIPSE_ID=com.ti.pdk.omapl137
496 export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL137
497 if [ "$PROCESSOR" == "arm" ]; then
498 export RTSC_TARGET=ti.targets.arm.elf.Arm9
499 export CCS_DEVICE="ARM9.OMAPL137"
500 fi
501 elif [ "$SOC" = "OMAPL138" ]; then
502 export PDK_PARTNO=OMAPL138
503 export PDK_ECLIPSE_ID=com.ti.pdk.omapl138
504 export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138
505 if [ "$PROCESSOR" == "arm" ]; then
506 export RTSC_TARGET=ti.targets.arm.elf.Arm9
507 export CCS_DEVICE="ARM9.OMAPL138"
508 fi
509 elif [ "$SOC" = "C6748" ]; then
510 # C6748 is the alias for OMAPL138 where the OMAPL138 settings will
511 # be used to create projects for C6748 SOC.
512 export SOC=OMAPL138
513 export BOARD=lcdkOMAPL138
514 export PDK_PARTNO=OMAPL138
515 export PDK_ECLIPSE_ID=com.ti.pdk.omapl138
516 export RTSC_PLATFORM_NAME=ti.platforms.evmOMAPL138
517 if [ "$PROCESSOR" == "arm" ]; then
518 export RTSC_TARGET=ti.targets.arm.elf.Arm9
519 export CCS_DEVICE="ARM9.OMAPL138"
520 fi
521 elif [ "$SOC" = "K2G" ]; then
522 export PDK_PARTNO=66AK2G02
523 if [ "$SECUREMODE" == "yes" ]; then
524 # Set the board to evmK2G as BOARD is being used to find example project files by name
525 export PDK_ECLIPSE_ID=com.ti.pdk.k2g-hs
526 export SEC_CFG_FILE_UPDATE_NEEDED="yes"
527 else
528 export PDK_ECLIPSE_ID=com.ti.pdk.k2g
529 fi
530 export RTSC_PLATFORM_NAME=ti.platforms.evmTCI66AK2G02
531 if [ "$PROCESSOR" == "arm" ]; then
532 export RTSC_TARGET=gnu.targets.arm.A15F
533 export CCS_DEVICE="Cortex A.66AK2G02"
534 fi
535 elif [ "$SOC" = "AM571x" ]; then
536 export PDK_PARTNO=AM571X
537 export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
538 export RTSC_PLATFORM_NAME=ti.platforms.idkAM571X
539 if [ "$PROCESSOR" = "arm" ]; then
540 export RTSC_TARGET=gnu.targets.arm.A15F
541 export CCS_DEVICE="Cortex A.AM5728_RevA"
542 elif [ "$PROCESSOR" == "m4" ]; then
543 export RTSC_TARGET=ti.targets.arm.elf.M4
544 export CCS_DEVICE="Cortex M.AM5728_RevA"
545 fi
546 elif [ "$SOC" == "AM572x" ]; then
547 export PDK_PARTNO=AM572X
548 export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
549 if [ "$BOARD" == "idkAM572x" ]; then
550 export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X
551 else
552 export RTSC_PLATFORM_NAME=ti.platforms.evmAM572X
553 fi
554 if [ "$PROCESSOR" == "arm" ]; then
555 export RTSC_TARGET=gnu.targets.arm.A15F
556 export CCS_DEVICE="Cortex A.AM5728_RevA"
557 elif [ "$PROCESSOR" == "m4" ]; then
558 export RTSC_TARGET=ti.targets.arm.elf.M4
559 export CCS_DEVICE="Cortex M.AM5728_RevA"
560 fi
561 elif [ "$SOC" = "AM574x" ]; then
562 export PDK_PARTNO=AM574X
563 export PDK_ECLIPSE_ID=com.ti.pdk.am57xx
564 export RTSC_PLATFORM_NAME=ti.platforms.idkAM572X
565 if [ "$PROCESSOR" = "arm" ]; then
566 export RTSC_TARGET=gnu.targets.arm.A15F
567 export CCS_DEVICE="Cortex A.AM5728_RevA"
568 elif [ "$PROCESSOR" == "m4" ]; then
569 export RTSC_TARGET=ti.targets.arm.elf.M4
570 export CCS_DEVICE="Cortex M.AM5728_RevA"
571 fi
572 elif [ "$SOC" == "DRA72x" ]; then
573 export PDK_PARTNO=DRA72x
574 export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
575 export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX
576 if [ "$PROCESSOR" == "arm" ]; then
577 export RTSC_TARGET=gnu.targets.arm.A15F
578 export CCS_DEVICE="Cortex A.DRA72x"
579 elif [ "$PROCESSOR" == "m4" ]; then
580 export RTSC_TARGET=ti.targets.arm.elf.M4
581 export CCS_DEVICE="Cortex M.DRA72x"
582 fi
583 elif [ "$SOC" == "DRA75x" ]; then
584 export PDK_PARTNO=DRA75x
585 export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
586 export RTSC_PLATFORM_NAME=ti.platforms.evmDRA7XX
587 if [ "$PROCESSOR" == "arm" ]; then
588 export RTSC_TARGET=gnu.targets.arm.A15F
589 export CCS_DEVICE="Cortex A.DRA75x_DRA74x"
590 elif [ "$PROCESSOR" == "m4" ]; then
591 export RTSC_TARGET=ti.targets.arm.elf.M4
592 export CCS_DEVICE="Cortex M.DRA75x_DRA74x"
593 fi
594 elif [ "$SOC" == "DRA78x" ]; then
595 export PDK_PARTNO=DRA78x
596 export PDK_ECLIPSE_ID=com.ti.pdk.dra7xx
597 export RTSC_PLATFORM_NAME=ti.platforms.evmTDA3XX
598 if [ "$PROCESSOR" == "m4" ]; then
599 export RTSC_TARGET=ti.targets.arm.elf.M4
600 export CCS_DEVICE="Cortex M.TDA3x"
601 fi
602 elif [ "$SOC" == AM335x ]; then
603 export PDK_PARTNO=AM335
604 export PDK_ECLIPSE_ID=com.ti.pdk.am335x
605 export RTSC_PLATFORM_NAME=ti.platforms.evmAM3359
606 export RTSC_TARGET=gnu.targets.arm.A8F
607 export CCS_DEVICE="Cortex A.AM3359.ICE_AM3359"
608 elif [ "$SOC" = "AM437x" ]; then
609 export PDK_PARTNO=AM437
610 if [ "$SECUREMODE" == "yes" ]; then
611 # Set the board to am437x-hs as BOARD is being used to find example project files by name
612 export PDK_ECLIPSE_ID=com.ti.pdk.am437x-hs
613 # No cfg file updates are required for AM437x-hs
614 export SEC_CFG_FILE_UPDATE_NEEDED="no"
615 else
616 export PDK_ECLIPSE_ID=com.ti.pdk.am437x
617 fi
618 export RTSC_PLATFORM_NAME=ti.platforms.evmAM437X
619 export RTSC_TARGET=gnu.targets.arm.A9F
620 export CCS_DEVICE="Cortex A.AM4379.IDK_AM437X"
621 elif [ "$SOC" = "C6678" ]; then
622 export PDK_PARTNO=C6678L
623 export PDK_ECLIPSE_ID=com.ti.pdk.c667x
624 export RTSC_PLATFORM_NAME=ti.platforms.evm6678
625 elif [ "$SOC" = "C6657" ]; then
626 export PDK_PARTNO=C6657
627 export PDK_ECLIPSE_ID=com.ti.pdk.c665x
628 export RTSC_PLATFORM_NAME=ti.platforms.evm6657
629 elif [ "$SOC" = "am65xx" ]; then
630 export PDK_PARTNO=AM65XX
631 export PDK_ECLIPSE_ID=com.ti.pdk.am65xx
632 if [ "$PROCESSOR" = "mpu" ]; then
633 export RTSC_PLATFORM_NAME=ti.platforms.cortexA:AM65X
634 export RTSC_TARGET=gnu.targets.arm.A53F
635 export CCS_DEVICE="Cortex A.AM6548"
636 elif [ "$PROCESSOR" == "mcu" ]; then
637 export RTSC_PLATFORM_NAME=ti.platforms.cortexR:AM65X
638 export RTSC_TARGET=ti.targets.arm.elf.R5F
639 export CCS_DEVICE="Cortex R.AM6548"
640 fi
641 else
642 # Need to exit the batch script cleanly
643 export PDK_PARTNO=TCI6634
644 export PDK_ECLIPSE_ID=ti.pdk
645 export RTSC_PLATFORM_NAME=ti.platforms.simKepler
646 fi
648 # RTSC Target
649 # - Please ensure that you select this taking into account the
650 # OUTPUT_FORMAT and the RTSC_PLATFORM_NAME
651 if [ "$PROCESSOR" = "dsp" ]; then
652 if [ "$ENDIAN" = "big" ]; then
653 export RTSC_TARGET=ti.targets.elf.C66_big_endian
654 export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"
655 export DSP_TYPE=c66
656 else
657 if [ "$SOC" = "OMAPL137" ]; then
658 export RTSC_TARGET=ti.targets.elf.C674
659 export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"
660 export DSP_TYPE=c674x
661 elif [ "$SOC" = "OMAPL138" ]; then
662 export RTSC_TARGET=ti.targets.elf.C674
663 export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC674xDevice"
664 export DSP_TYPE=c674x
665 else
666 export RTSC_TARGET=ti.targets.elf.C66
667 export CCS_DEVICE="com.ti.ccstudio.deviceModel.C6000.GenericC64xPlusDevice"
668 export DSP_TYPE=c66
669 fi
670 fi
671 fi
673 echo " PDK_PARTNO : $PDK_PARTNO"
674 echo " PDK_ECLIPSE_ID : $PDK_ECLIPSE_ID"
675 echo " RTSC_PLATFORM_NAME : $RTSC_PLATFORM_NAME"
676 echo " RTSC_TARGET : $RTSC_TARGET"
677 echo " CCS_DEVICE : $CCS_DEVICE"
678 # *****************************************************************************
679 # *****************************************************************************
680 # Please do NOT change anything below this
681 # *****************************************************************************
682 # *****************************************************************************
684 # export auto create command by default for use with CCSv8
685 export AUTO_CREATE_COMMAND=eclipse/ccstudio
687 # export project for Silicon or QT by default
688 export SIMULATOR_SUPPORT_DEFINE=
690 echo "*****************************************************************************"
691 echo "Detecting all projects in PDK and importing them in the workspace $MY_WORKSPACE"
694 export RTSC_PRODUCTS="com.ti.rtsc.SYSBIOS:$BIOS_VERSION;$PDK_ECLIPSE_ID:$PDK_VERSION"
696 if [ -d ${SDK_INSTALL_PATH}/edma3_lld_${EDMA_VERSION//./_} ]; then
697 export RTSC_EDMA=";com.ti.sdo.edma3:$EDMA_VERSION"
698 fi
700 if [[ "$SOC" != "AM335x" && "$SOC" != "AM437x" ]]; then
701 if [ -d ${SDK_INSTALL_PATH}/ipc_${IPC_VERSION//./_} ]; then
702 export RTSC_IPC=";com.ti.rtsc.IPC:$IPC_VERSION"
703 fi
704 fi
706 if [ -d ${SDK_INSTALL_PATH}/ndk_${NDK_VERSION//./_} ]; then
707 export RTSC_NDK=";com.ti.rtsc.NDK:${NDK_VERSION}-eng"
708 fi
709 if [ -d ${SDK_INSTALL_PATH}/uia_${UIA_VERSION//./_} ]; then
710 export RTSC_UIA=";com.ti.uia:$UIA_VERSION"
711 fi
713 export RTSC_PRODUCTS="${RTSC_PRODUCTS}${RTSC_EDMA}${RTSC_IPC}${RTSC_NDK}${RTSC_UIA}"
715 # Set MODULE to null string so it picks up all projects of PROCESSOR
716 if [ "$MODULE" = "all" ]; then
717 MODULE=""
718 fi
720 # Set BOARD to equal the SOC if BOARD is set to "all". All projects for the
721 # SOC will be picked up
722 # Additionally for AM335x, check for AMIC110 board
723 export AMIC110BOARD=
724 if [ "$BOARD" = "all" ]; then
725 BOARD="$SOC"
726 if [ "$SOC" = "AM335x" ]; then
727 AMIC110BOARD="-o -iname *$MODULE*AMIC110*arm*roject.txt"
728 fi
729 fi
731 # Set PROJECT_TYPE to null string so it picks up all project types
732 if [ "$PROJECT_TYPE" = "all" ]; then
733 PROJECT_TYPE=""
734 fi
736 if [ "$SOC" = "OMAPL137" ]; then
737 export LINKER_OPT=""
738 export COMPILER_OPT=""
739 export COMPILER=$CGT_VERSION_ARM9
740 elif [ "$SOC" = "OMAPL138" ]; then
741 export LINKER_OPT=""
742 export COMPILER_OPT=""
743 export COMPILER=$CGT_VERSION_ARM9
744 elif [ "$SOC" = "am65xx" ]; then
745 export LINKER_OPT=""
746 export COMPILER_OPT=""
747 export COMPILER="$CGT_VERSION_ARM_A53"
748 else
749 export LINKER_OPT=\"-L\${BIOS_CG_ROOT}/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard\ --specs=nano.specs\"
750 export COMPILER_OPT=\"-I\${CG_TOOL_ROOT}/arm-none-eabi/include/newlib-nano\"
751 export COMPILER=$CGT_VERSION_ARM
752 fi
754 ccs_create_dsp()
755 {
756 echo Detected Project $1
757 textfile=${1#*/}
759 ccs_proj_name=${textfile%.*}
760 # If the board is in secure mode , a few lines need to be added to sysbios config file for the application
761 if [ "$SEC_CFG_FILE_UPDATE_NEEDED" == "yes" ]; then
762 # For SECUREMODE=yes, the cc projects are appended with _HS so that they can coexist with non-HS projects
763 ccs_proj_name=$ccs_proj_name"_HS"
764 # Check if the secure device configuration exists on the application sysbios config file.
765 # if not add it to the config file.
766 cfgfile=$(grep "\.cfg" $textfile| sed -e 's/.*\/ti/\/ti/'|sed -e 's/"//g'| sed -e "s|\.*\/ti|${PDK_INSTALL_PATH}\/ti|g")
767 securecfg_occurance=$(grep -c "Start of lines added for secure device" $cfgfile)
768 if [ $securecfg_occurance -eq 0 ]; then
769 echo "Adding secure device configuration file for sysbios configuration file $cfgfile .."
770 echo "${RTSCCFG_ENTRY_SECUREMODE_DSP}" >> $cfgfile
771 fi
772 fi
774 $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
776 echo "Copying macros.ini"
777 cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${ccs_proj_name}
778 }
780 ccs_create_arm()
781 {
782 echo Detected Project $1
783 textfile=${1#*/}
784 ccs_proj_name=${textfile%.*}
785 # If the board is in secure mode , a few lines need to be added to sysbios config file for the application
786 if [ "$SEC_CFG_FILE_UPDATE_NEEDED" == "yes" ]; then
787 # For SECUREMODE=yes, the cc projects are appended with _HS so that they can coexist with non-HS projects
788 ccs_proj_name=$ccs_proj_name"_HS"
789 # Check if the secure device configuration exists on the application sysbios config file.
790 # if not add it to the config file.
791 cfgfile=$(grep "\.cfg" $textfile| sed -e 's/.*\/ti/\/ti/'|sed -e 's/"//g'| sed -e "s|\.*\/ti|${PDK_INSTALL_PATH}\/ti|g")
792 securecfg_occurance=$(grep -c "Start of lines added for secure device" $cfgfile)
793 if [ $securecfg_occurance -eq 0 ]; then
794 echo "Adding secure device configuration file for sysbios configuration file $cfgfile .."
795 echo "${RTSCCFG_ENTRY_SECUREMODE_ARM}" >> $cfgfile
796 fi
797 fi
799 #Run CCS create command specific to baremetal and OS projects
800 if [[ "$textfile" =~ "nonOS" ]]; then
801 $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion "$COMPILER" -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep $(CG_TOOL_ROOT)/bin/arm-none-eabi-objcopy -O binary ${ccs_proj_name}.out ${ccs_proj_name}.bin
803 #REM Deletes the startup file generated defaultly by CCS tool
804 rm $MY_WORKSPACE/${ccs_proj_name}/*.S
805 else
806 $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${ccs_proj_name} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setLinkerOptions "$LINKER_OPT" -ccs.setCompilerOptions "$COMPILER_OPT" -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion "$COMPILER" -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
807 fi
809 echo "Copying macros.ini"
810 cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${ccs_proj_name}
811 }
813 ccs_create_m4()
814 {
815 echo Detected Project $1
816 textfile=${1#*/}
818 $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${textfile%.*} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_M4_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
820 echo "Copying macros.ini"
821 cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${textfile%.*}
822 }
823 ccs_create_r5()
824 {
825 echo Detected Project $1
826 textfile=${1#*/}
828 $CCS_INSTALL_PATH/$AUTO_CREATE_COMMAND -nosplash -data $MY_WORKSPACE -application com.ti.ccstudio.apps.projectCreate -ccs.cmd "" -ccs.name ${textfile%.*} -ccs.outputFormat $OUTPUT_FORMAT -ccs.setCompilerOptions "-DUSE_BIOS" -ccs.device "$CCS_DEVICE" -ccs.endianness $ENDIAN -ccs.kind executable -ccs.cgtVersion $CGT_M4_VERSION -rtsc.xdcVersion $XDC_VERSION -rtsc.enableDspBios -rtsc.biosVersion $BIOS_VERSION -rtsc.buildProfile "debug" -rtsc.products "$RTSC_PRODUCTS" -rtsc.platform "$RTSC_PLATFORM_NAME" -rtsc.target $RTSC_TARGET -ccs.rts libc.a libgcc.a libuart.a libm.a libnosys.a -ccs.args $textfile -ccs.overwrite full -ccs.setPostBuildStep "\${TI_PDK_INSTALL_DIR}/packages/pdkAppImageCreate.sh \${TI_PDK_INSTALL_DIR}/packages \${CG_TOOL_ROOT} \${PROJECT_LOC}/\${ConfigName} \${ProjName} $SOC $PROCESSOR" \;
830 echo "Copying macros.ini"
831 cp $PDK_SHORT_NAME/macros.ini $MY_WORKSPACE/${textfile%.*}
832 }
834 export -f ccs_create_dsp
835 export -f ccs_create_arm
836 export -f ccs_create_m4
838 if [ "$PROCESSOR" = "dsp" ]; then
839 find -iname "*$MODULE*$BOARD*$DSP_TYPE*$PROJECT_TYPE*roject.txt" -execdir bash -c 'ccs_create_dsp {}' \;
840 if [ $(find -iname "*$MODULE*$BOARD*$DSP_TYPE*$PROJECT_TYPE*roject.txt" | wc -l) -eq 0 ]; then
841 echo "No projects detected"
842 fi
843 elif [ "$PROCESSOR" = "arm" ] || [ "$PROCESSOR" = "mpu" ]; then
844 find \( -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" $AMIC110BOARD \) -execdir bash -c 'ccs_create_arm {}' \;
845 if [ $(find \( -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" $AMIC110BOARD \) | wc -l) -eq 0 ]; then
846 echo "No projects detected"
847 fi
848 elif [ "$PROCESSOR" = "m4" ]|| [ "$PROCESSOR" = "mcu" ]; then
849 find -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" -execdir bash -c 'ccs_create_m4 {}' \;
850 if [ $(find -iname "*$MODULE*$BOARD*$PROCESSOR*$PROJECT_TYPE*roject.txt" | wc -l) -eq 0 ]; then
851 echo "No projects detected"
852 fi
853 else
854 echo "$PROCESSOR is an invalid processor"
855 fi
857 echo "Project generation complete"
858 echo "*****************************************************************************"