Can we start running an OpenVX application automatically at Linux Boot
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
In order to start an OpenVX application automatically during Linux boot, you could call the application in a service.
Please follow the below steps to achieve this
Step 1: Boot the EVM and login as 'root'
Step 2: Create a shell script in which you call the executable for your application along with its dependencies
(A sample shell script (appl.sh) is as shown below which loads the TIDL demo)
/cfs-file/__key/communityserver-discussions-components-files/1132/1856.appl.sh
Step 3: Save this shell script in /etc/init.d/
Step 4: Create a Systemd Unit File in /lib/systemd/system/ as shown below
sudo vi /lib/systemd/system/application.service
Step 5: Add the following contents and save the file
[Unit] Description=My Shell Script
[Service] ExecStart=/etc/init.d/appl.sh
[Install] WantedBy=multi-user.target
Step 6: Enable the new service as shown below
sudo systemctl daemon-reload
sudo systemctl enable application.service
sudo systemctl start application.service
Step 7: Verify the script is up and running with the below command
sudo systemctl status application.service
==============================
The output should look like below
==============================
* application.service - My Shell Script
Loaded: loaded (/lib/systemd/system/application.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-08-30 11:43:32 UTC; 11min ago
Main PID: 697 (appl.sh)
Tasks: 9 (limit: 16491)
Memory: 45.4M
CGroup: /system.slice/application.service
|-697 /bin/sh /etc/init.d/appl.sh
|-698 /opt/vision_apps/vx_app_arm_remote_log.out
`-746 /opt/vision_apps/vx_app_tidl.out --cfg /opt/vision_apps/app_oc.cfg
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_1 ] 702.612181 s: APP: Run ... Done !!!
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_1 ] 702.613379 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[x] C7X_1[s] C7X_2[P]
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_1 ] 702.625081 s: IPC: Echo status: mpu1_0[x] mcu2_0[x] mcu2_1[P] C7X_1[s] C7X_2[P]
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_1 ] 702.666312 s: IPC: Echo status: mpu1_0[x] mcu2_0[P] mcu2_1[P] C7X_1[s] C7X_2[P]
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963430 s: CIO: Init ... Done !!!
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963445 s: ### CPU Frequency = 1000000000 Hz
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963456 s: APP: Init ... !!!
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963464 s: SCICLIENT: Init ... !!!
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963584 s: SCICLIENT: DMSC FW version [8.4.1--v08.04.01 (Jolly Jellyfi]
Aug 30 11:43:33 j721s2-evm appl.sh[698]: [C7x_2 ] 693.963599 s: SCICLIENT: DMSC FW revision 0x8
==============================
Step 8: Reboot the EVM and your OpenVX application automatically runs during Linux boot
Regards,
Nikhil