-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
executable file
·233 lines (215 loc) · 8.76 KB
/
Taskfile.yml
File metadata and controls
executable file
·233 lines (215 loc) · 8.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# T3 Foundation Gemstone Project [t3gemstone.org]
# SPDX-License-Identifier: Apache-2.0
version: '3'
dotenv: ['.env']
vars:
BUILD_DIR: "{{ .ROOT_DIR }}/build"
DOWNLOAD_DIR: "{{ .BUILD_DIR }}/downloads"
TOOLCHAINS_DIR: "{{ .BUILD_DIR }}/${DISTRO_BASE}-${DISTRO_SUITE}"
TI_INSTALL_DIR: "{{ .BUILD_DIR }}/ti"
MAKE_CMD:
sh: echo make -j $(nproc)
URLS:
map: {
toolchains: "https://github.com/t3gemstone/toolchains/releases/latest/download/t3gemstone-toolchains-${DISTRO_BASE}-${DISTRO_SUITE}.tar.gz",
face_detection_yunet: "https://github.com/opencv/opencv_zoo/raw/refs/heads/main/models/face_detection_yunet/face_detection_yunet_2023mar_int8.onnx",
face_detection_sample: "https://github.com/intel-iot-devkit/sample-videos/raw/refs/heads/master/face-demographics-walking.mp4",
ti_j722s_rtos_sdk: "https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-1bSfTnVt5d/10.01.00.04/ti-processor-sdk-rtos-j722s-evm-10_01_00_04.tar.gz",
ti_j722s_mcusw_sdk: "https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-1bSfTnVt5d/10.01.00.04/MCUSW_J722S_10.01.00.03.zip",
ti_sysconfig: "https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.20.0.3587/sysconfig-1.20.0_3587-setup.run",
ti_cgt_c7000: "https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-707zYe3Rik/4.1.0.LTS/ti_cgt_c7000_4.1.0.LTS_linux-x64_installer.bin",
ti_cgt_armllvm: "https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-ayxs93eZNN/3.2.2.LTS/ti_cgt_armllvm_3.2.2.LTS_linux-x64_installer.bin",
gcc_arm: "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz",
}
env:
PROJDIR: "{{ .ROOT_DIR }}"
PROCESSOR_SDK_PATH: "{{ .TI_INSTALL_DIR }}/ti-processor-sdk-rtos-j722s-evm-10_01_00_04"
CGT_TI_ARM_CLANG_PATH: "{{ .TI_INSTALL_DIR }}/ti-cgt-armllvm_3.2.2.LTS"
CGT_TI_C7000_PATH: "{{ .TI_INSTALL_DIR }}/ti-cgt-c7000_4.1.0.LTS"
GCC_ARM_PATH: "{{ .TI_INSTALL_DIR }}/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf"
MCU_PLUS_SDK_PATH: "${PROCESSOR_SDK_PATH}/mcu_plus_sdk_j722s_10_01_00_22"
MCUSW_PATH: "{{ .TI_INSTALL_DIR }}/MCUSW_J722S_10.01.00.03"
SYSCFG_PATH: "{{ .TI_INSTALL_DIR }}/sysconfig_1.20.0"
TOOLS_PATH: "{{ .TI_INSTALL_DIR }}"
COLOR_ERR: \033[0;31m
COLOR_RESET: \033[0m
tasks:
default:
silent: true
cmds:
- task --list-all --summary
- echo
- echo "Environment:"
- echo " MACHINE = ${MACHINE}"
- echo " DISTRO_BASE = ${DISTRO_BASE}"
- echo " DISTRO_SUITE = ${DISTRO_SUITE}"
- echo " DISTRO_TYPE = ${DISTRO_TYPE}"
- echo " PROJECT = ${PROJECT}"
- echo " CROSS_COMPILE = ${CROSS_COMPILE}"
- echo
- echo "TI Environment:"
- echo " PROFILE = ${PROFILE}"
- echo " SYSCONFIG_TARGET = ${SYSCONFIG_TARGET}"
- echo " MCU_TARGETS = ${MCU_TARGETS}"
- echo
wget:
internal: true
silent: true
cmds:
- mkdir -p $(dirname "{{ .PATH }}")
- wget --no-clobber --continue --quiet --show-progress -O "{{ .PATH }}" "{{ .URL }}" || true
requires:
vars: [ URL, PATH ]
status:
- test -f "{{ .PATH }}"
fetch:
silent: true
cmds:
- task: wget
vars:
URL: '{{ get .URLS "toolchains" }}'
PATH: "{{ .DOWNLOAD_DIR }}/t3gemstone-toolchains-${DISTRO_BASE}-${DISTRO_SUITE}.tar.gz"
- task: wget
vars:
URL: '{{ get .URLS "face_detection_yunet" }}'
PATH: "{{ .DOWNLOAD_DIR }}/face_detection_yunet_2023mar_int8.onnx"
- task: wget
vars:
URL: '{{ get .URLS "face_detection_sample" }}'
PATH: "{{ .DOWNLOAD_DIR }}/face_detection_sample.mp4"
- |
if [ ! -d "{{ .TOOLCHAINS_DIR }}" ]; then
mkdir -p "{{ .TOOLCHAINS_DIR }}"
tar xf "{{ .DOWNLOAD_DIR }}/t3gemstone-toolchains-${DISTRO_BASE}-${DISTRO_SUITE}.tar.gz" --directory "{{ .TOOLCHAINS_DIR }}"
fi
destroy:
prompt: 'T3 Gemstone Toolchains will be deleted. Do you want to continue?'
cmds:
- rm -f "{{ .DOWNLOAD_DIR }}/t3gemstone-toolchains-${DISTRO_BASE}-${DISTRO_SUITE}.tar.gz"
- rm -rf "{{ .TOOLCHAINS_DIR }}"
fetch-ti:
silent: true
cmds:
- task: fetch
- task: wget
vars:
URL: '{{ get .URLS "ti_j722s_rtos_sdk" }}'
PATH: "{{ .DOWNLOAD_DIR }}/ti-j722s-rtos-sdk.tar.gz"
- task: wget
vars:
URL: '{{ get .URLS "ti_j722s_mcusw_sdk" }}'
PATH: "{{ .DOWNLOAD_DIR }}/mcusw-j722s.zip"
- task: wget
vars:
URL: '{{ get .URLS "ti_sysconfig" }}'
PATH: "{{ .DOWNLOAD_DIR }}/sysconfig.run"
- task: wget
vars:
URL: '{{ get .URLS "ti_cgt_c7000" }}'
PATH: "{{ .DOWNLOAD_DIR }}/ti_cgt_c7000.bin"
- task: wget
vars:
URL: '{{ get .URLS "ti_cgt_armllvm" }}'
PATH: "{{ .DOWNLOAD_DIR }}/ti_cgt_armllvm.bin"
- task: wget
vars:
URL: '{{ get .URLS "gcc_arm"}}'
PATH: "{{ .DOWNLOAD_DIR }}/gcc_arm.tar.xz"
- mkdir -p "{{ .TI_INSTALL_DIR }}"
- |
if [ ! -d "${PROCESSOR_SDK_PATH}" ]; then
tar xf "{{ .DOWNLOAD_DIR }}/ti-j722s-rtos-sdk.tar.gz" --directory "{{ .TI_INSTALL_DIR }}"
fi
- |
if [ ! -d "${MCUSW_PATH}" ]; then
unzip -q "{{ .DOWNLOAD_DIR }}/mcusw-j722s.zip" -d "{{ .TI_INSTALL_DIR }}"
fi
- |
if [ ! -d "${SYSCFG_PATH}" ]; then
chmod +x "{{ .DOWNLOAD_DIR }}/sysconfig.run"
"{{ .DOWNLOAD_DIR }}/sysconfig.run" --mode unattended --prefix "${SYSCFG_PATH}"
fi
- |
if [ ! -d "${CGT_TI_C7000_PATH}" ]; then
chmod +x "{{ .DOWNLOAD_DIR }}/ti_cgt_c7000.bin"
"{{ .DOWNLOAD_DIR }}/ti_cgt_c7000.bin" --mode unattended --prefix "{{ .TI_INSTALL_DIR }}"
fi
- |
if [ ! -d "${CGT_TI_ARM_CLANG_PATH}" ]; then
chmod +x "{{ .DOWNLOAD_DIR }}/ti_cgt_armllvm.bin"
"{{ .DOWNLOAD_DIR }}/ti_cgt_armllvm.bin" --mode unattended --prefix "{{ .TI_INSTALL_DIR }}"
fi
- |
if [ ! -d "${GCC_ARM_PATH}" ]; then
tar xf "{{ .DOWNLOAD_DIR }}/gcc_arm.tar.xz" --directory "{{ .TI_INSTALL_DIR }}"
fi
- |
{{ .MAKE_CMD }} -C mcu libs >/dev/null
preconditions:
- sh: /usr/sbin/ldconfig -p | grep -i libtinfo.so.5
msg: |
libtinfo5 library is needed, install it from your package manager. For Ubuntu:
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
sysconfig:
cmds:
- task: fetch-ti
- |
{{ .MAKE_CMD }} -C mcu sysconfig
build:
cmds:
- task: fetch
- |
if [ "${CROSS_COMPILE}" == "true" ]; then
pushd "{{ .TOOLCHAINS_DIR }}" >/dev/null && source ./env && popd >/dev/null
fi
{{ .MAKE_CMD }} -C "${PROJECT}"
clean:
cmds:
- task: fetch
- |
if [ "${CROSS_COMPILE}" == "true" ]; then
pushd "{{ .TOOLCHAINS_DIR }}" >/dev/null && source ./env && popd >/dev/null
fi
{{ .MAKE_CMD }} -C "${PROJECT}" clean
create-virtual-camera:
silent: true
cmds:
- |
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback devices=1 video_nr=0 exclusive_caps=1 card_label="Virtual Camera"
camera_index=$(ls /dev/video* | tail -n 1)
echo Streaming video in a loop to virtual camera "${camera_index}"...
echo Press [q] to quit.
ffmpeg -stream_loop -1 -re -i "{{ .DOWNLOAD_DIR }}/face_detection_sample.mp4" -vf format=yuv420p -f v4l2 "${camera_index}" &>/dev/null
sudo rmmod v4l2loopback
preconditions:
- sh: modinfo v4l2loopback
msg: "v4l2loopback kernel module is needed, install it from your package manager"
create-virtual-can:
silent: true
cmds:
- sudo modprobe -r vcan
- sudo modprobe vcan
- sudo ip link add dev vcan0 type vcan
- sudo ip link set vcan0 up
preconditions:
- sh: modinfo vcan
msg: "vcan kernel module is needed"
create-virtual-tty:
silent: true
cmds:
- sudo modprobe -r tty0tty
- sudo udevadm control --reload-rules
- sudo depmod
- sudo modprobe tty0tty
preconditions:
- sh: modinfo tty0tty
msg: "tty0tty kernel module is needed, download and compile from: https://github.com/freemed/tty0tty"
py-notebook:
dir: python-notebook
cmds:
- marimo --yes edit notebook.py --port 8001
py-bundle:
cmds:
- uv run pyinstaller --onefile --noconfirm --windowed --specpath=build --name gcs gui/gcs.py