Difference between revisions of "DS 015 Development"

From ESS-WIKI
Jump to: navigation, search
 
(20 intermediate revisions by the same user not shown)
Line 13: Line 13:
  
 
== Flash Mac Address ==
 
== Flash Mac Address ==
First, you need to add a patch to the device tree{ Commit da11ea0d: [LAN] Enable Ethernet Controller I225-LM/I225-V support }
+
First need to add a patch to the device tree{ Commit da11ea0d: [LAN] Enable Ethernet Controller I225-LM/I225-V support }
  
 
=== Download I226 tool to Device ===
 
=== Download I226 tool to Device ===
Line 24: Line 24:
  
 
=== Flash ===
 
=== Flash ===
<span style="color:#FF0000;">'''The MAC address can only be burned in once'''</span>
+
Attention : <span data-darkreader-inline-color="" style="color: rgb(205, 0, 0); --darkreader-inline-color: #ff3d3d;">The MAC address can only be burned in once</span>
  
 
Please make sure mac address and set in : -mac=<XXXXXXXXXXXX>  
 
Please make sure mac address and set in : -mac=<XXXXXXXXXXXX>  
Line 41: Line 41:
  
 
==Burnin==
 
==Burnin==
 +
[[DS_015_Burnin|DS-015 Burnin]]
  
 
==BootCount==
 
==BootCount==
Line 109: Line 110:
  
 
==== '''Audio''' ====
 
==== '''Audio''' ====
 +
Line-Out : Codec Mixer Controls
 +
<pre>
 +
$ amixer -c APE cset name="I2S1 Mux" 0
 +
$ amixer -c APE cset name="I2S2 Mux" "ADMAIF1"
 +
$ amixer -c APE cset name="CVB-RT DAC MIXL INF1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT DAC MIXR INF1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT Stereo DAC MIXL DAC L1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT Stereo DAC MIXR DAC R1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT DAC1 Playback Volume" "175,175"
 +
$ amixer -c APE cset name="CVB-RT LOUT MIX DAC L1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT LOUT MIX DAC R1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT OUT Playback Switch" "on,on"
 +
$ amixer -c APE cset name="CVB-RT OUT Playback Volume" "31"
 +
</pre>
 +
 
Line-Out
 
Line-Out
 
<pre>
 
<pre>
$ aplay -D hw:1,0 &lt;WAV file&gt;
+
$ aplay -D hw:APE,0 <in_wav>
 
</pre>
 
</pre>
  
 +
Mic-In : Codec Mixer Controls
 +
<pre>
 +
$ amixer -c APE cset name="ADMAIF1 Mux" "I2S2"
 +
$ amixer -c APE cset name="CVB-RT RECMIXL BST1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT RECMIXR BST2 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT IN1 Boost" 8
 +
$ amixer -c APE cset name="CVB-RT IN2 Boost" 8
 +
$ amixer -c APE cset name="CVB-RT Stereo ADC1 Mux" "ADC"
 +
$ amixer -c APE cset name="CVB-RT Stereo ADC MIXL ADC1 Switch" "on"
 +
$ amixer -c APE cset name="CVB-RT Stereo ADC MIXR ADC1 Switch" "on"
 +
</pre>
 +
 +
Mic-In
 +
<pre>
 +
$ arecord -D hw:APE,0 -r 44100 -c 2 -f S16_LE output.wav
 +
</pre>
  
 
==== '''TPM''' ====
 
==== '''TPM''' ====
Line 122: Line 154:
  
 
(1)產生randon code
 
(1)產生randon code
 +
<pre>$ sudo su
 +
</pre>
 
<pre>root@linux:/home/ubuntu# tpm2_getrandom --hex 20
 
<pre>root@linux:/home/ubuntu# tpm2_getrandom --hex 20
 
</pre>
 
</pre>
Line 181: Line 215:
  
 
===== '''RS-232''' =====
 
===== '''RS-232''' =====
COM1&nbsp;: COM1_SW1 OFF-OFF-OFF-OFF
+
COM1_SW1 OFF-OFF-OFF-OFF
 
<pre>
 
<pre>
 
$ sudo su
 
$ sudo su
Line 190: Line 224:
  
 
===== '''RS-422''' =====
 
===== '''RS-422''' =====
COM1&nbsp;: COM1_SW1 ON-OFF-OFF-OFF<br/>
+
<Receive> In terminal, run below command
 +
<br/> COM1_SW1 ON-OFF-ON-OFF
 +
<pre>
 +
$ sudo su
 +
# stty -F /dev/ttyTHS1 speed 115200
 +
# cat /dev/ttyTHS1 &
 +
# echo "1234" > /dev/ttyTHS1
 +
</pre>
 +
 
 +
<Transmit> In other device terminal, run below command
 +
<br/> COM1_SW1 ON-OFF-ON-OFF
 
<pre>
 
<pre>
stty -F /dev/ttyTHS1 speed 115200
+
$ sudo su
cat /dev/ttyTHS1 &
+
# stty -F /dev/ttyTHS1 speed 115200
echo "1234" > /dev/ttyTHS1
+
# cat /dev/ttyTHS1 &
 +
# echo "1234" > /dev/ttyTHS1
 
</pre>
 
</pre>
  
 
===== '''RS-485''' =====
 
===== '''RS-485''' =====
[Hardware flow control]<br/>
+
<Receive> In terminal, run below command
<Receive>
+
<br/> COM1_SW1 ON-ON-ON-ON
<br/> COM1_SW1 ON-ON-ON-ON, COM2_SW1&nbsp;ON-ON-ON-OFF
+
<pre>
<pre>stty -F /dev/ttyTHS1 speed 115200
+
$ sudo su
stty -F /dev/ttyTHS0 speed 115200
+
# stty -F /dev/ttyTHS1 speed 115200 raw -echo
cat /dev/ttyTHS1 &
+
# cat /dev/ttyTHS1 &
echo "1234" > /dev/ttyTHS0
+
# echo "1234" > /dev/ttyTHS1
 
</pre>
 
</pre>
  
<Transmit>
+
<Transmit> In other device terminal, run below command
<br/> COM1_SW1 ON-ON-ON-OFF, COM2_SW1&nbsp;ON-ON-ON-ON
+
<br/> COM1_SW1 ON-ON-ON-OFF
<pre>stty -F /dev/ttyTHS0 speed 115200
+
<pre>
stty -F /dev/ttyTHS1 speed 115200
+
$ sudo su
cat /dev/ttyTHS0 &
+
# stty -F /dev/ttyTHS1 speed 115200 raw -echo
echo "1234" > /dev/ttyTHS1
+
# cat /dev/ttyTHS1 &
 +
# echo "1234" > /dev/ttyTHS1
 +
</pre>
 +
 
 +
==== '''GMSL''' ====
 +
 
 +
===== '''APPROPHO Camera''' =====
 +
 
 +
Camera type : AR0822
 +
<br/>
 +
HW setting : Camera link to GMSL port
 +
<br/>
 +
[[File:Appro-gmsl.jpg|600px|border]]
 +
<br/>
 +
Please install camera driver first
 +
<br/>
 +
Attention : <span data-darkreader-inline-color="" style="color: rgb(205, 0, 0); --darkreader-inline-color: #ff3d3d;">can only be executed once command to setup camera </span>
 +
<br/>
 +
Then system will reboot
 +
<br/>
 +
<pre>
 +
$ cd /usr/local/bin/approcam
 +
$ sudo ./set_approcam.sh
 +
</pre>
 +
 
 +
Check Video channel "video0" "video1"
 +
<pre>
 +
$ ls /dev/video*
 +
</pre>
 +
Preview command
 +
<pre>
 +
$ cd /home/ubuntu
 +
$ sudo ./enable-approcamera-4k.sh
 
</pre>
 
</pre>
  
 
== Reference ==
 
== Reference ==
 +
[[DS-015|DS-015]]

Latest revision as of 10:15, 3 October 2025

Attention

Account & Password

Account number

ubuntu

In device used "sudo" or "sudo su" to root. Password required.

ubuntu

Flash Mac Address

First need to add a patch to the device tree{ Commit da11ea0d: [LAN] Enable Ethernet Controller I225-LM/I225-V support }

Download I226 tool to Device

I226 Flash Tool

Extract file

$ sudo tar zxvf LAN_I226_DS-015.tar.gz

Flash

Attention : The MAC address can only be burned in once

Please make sure mac address and set in : -mac=<XXXXXXXXXXXX>

$ cd LAN_I226_DS-015/I226_Flash_Tool
$ sudo su
# ./EepromAccessTool
# lspci
# setpci -s 0007:01:00.0 COMMAND=0007
# ./EepromAccessTool -nic=1 -f=FXVL_125C_V_2MB_2.27.bin -mac=XXXXXXXXXXXX

Power off and restart

Cold reboot the device.

Burnin

DS-015 Burnin

BootCount

BootCount tool install

In first time please install bootcount tool

$ cd /usr/local/bin/BootCount+shutdown
$ sudo chmod a+x install.sh
$ sudo ./install.sh
$ cd /home/ubuntu
$ sudo ./bootCount.sh

Default enter the OS 30s will poweroff

Boot On Off

The boot count message will be printed before log-in.
Air030 bootcount.jpg
Reset the boot count please remove bootCount.tt.

$ rm bootCount.tt

Tools

Test Command

JP6.2

CAN

Hardware setting
Canbus ds015 4.png

Set JPCAN1 Jumper to Can mode
Canbus ds015.png

Switch SW3 to ON
Canbus ds015 1.png

<Receive> In terminal, run below command

$ sudo su
# modprobe can
# modprobe can-dev
# modprobe mttcan
# ip link set can0 type can bitrate 500000
# ip link set can0 up
# candump can0

<Transmit> In other device terminal, run below command

$ sudo su
# modprobe can
# modprobe can-dev
# modprobe mttcan
# ip link set can0 type can bitrate 500000
# ip link set can0 up
# cansend can0 123#abcdabcd

WatchDog

$ sudo su
# sync; sleep 2; sync; echo c > /proc/sysrq-trigger

Audio

Line-Out : Codec Mixer Controls

$ amixer -c APE cset name="I2S1 Mux" 0 
$ amixer -c APE cset name="I2S2 Mux" "ADMAIF1"
$ amixer -c APE cset name="CVB-RT DAC MIXL INF1 Switch" "on"
$ amixer -c APE cset name="CVB-RT DAC MIXR INF1 Switch" "on"
$ amixer -c APE cset name="CVB-RT Stereo DAC MIXL DAC L1 Switch" "on"
$ amixer -c APE cset name="CVB-RT Stereo DAC MIXR DAC R1 Switch" "on"
$ amixer -c APE cset name="CVB-RT DAC1 Playback Volume" "175,175"
$ amixer -c APE cset name="CVB-RT LOUT MIX DAC L1 Switch" "on"
$ amixer -c APE cset name="CVB-RT LOUT MIX DAC R1 Switch" "on"
$ amixer -c APE cset name="CVB-RT OUT Playback Switch" "on,on"
$ amixer -c APE cset name="CVB-RT OUT Playback Volume" "31"

Line-Out

$ aplay -D hw:APE,0 <in_wav>

Mic-In : Codec Mixer Controls

$ amixer -c APE cset name="ADMAIF1 Mux" "I2S2"
$ amixer -c APE cset name="CVB-RT RECMIXL BST1 Switch" "on"
$ amixer -c APE cset name="CVB-RT RECMIXR BST2 Switch" "on"
$ amixer -c APE cset name="CVB-RT IN1 Boost" 8
$ amixer -c APE cset name="CVB-RT IN2 Boost" 8
$ amixer -c APE cset name="CVB-RT Stereo ADC1 Mux" "ADC"
$ amixer -c APE cset name="CVB-RT Stereo ADC MIXL ADC1 Switch" "on"
$ amixer -c APE cset name="CVB-RT Stereo ADC MIXR ADC1 Switch" "on"

Mic-In

$ arecord -D hw:APE,0 -r 44100 -c 2 -f S16_LE output.wav

TPM

Pre-install TPM-tools

$ sudo apt install --yes tpm2-tools

(1)產生randon code

$ sudo su
root@linux:/home/ubuntu# tpm2_getrandom --hex 20

(2) 對指定檔案 msg.dat 加密

root@linux:/home/ubuntu# tpm2_createprimary -C p -c platform_primary.ctx
root@linux:/home/ubuntu# tpm2_create -C platform_primary.ctx -G rsa2048 -u key.pub -r key.priv
root@linux:/home/ubuntu# tpm2_load -C platform_primary.ctx -u key.pub -r key.priv -c key.ctx
root@linux:/home/ubuntu# echo "my test" >msg.dat
root@linux:/home/ubuntu# tpm2_rsaencrypt -c key.ctx -o msg.enc msg.dat
root@linux:/home/ubuntu# cat msg.enc
root@linux:/home/ubuntu# tpm2_rsadecrypt -c key.ctx -o msg.ptext msg.enc
root@linux:/home/ubuntu# cat msg.ptext 
root@linux:/home/ubuntu# cat msg.dat

(3) 將資料儲存至 tpm 內存

root@linux:/home/ubuntu# tpm2_nvdefine -Q 0x1500031 -C o -s 32 -a "ownerread|policywrite|ownerwrite"
root@linux:/home/ubuntu# echo "write_tpm_adv" >  adv.data
root@linux:/home/ubuntu# tpm2_nvwrite -Q 0x1500031 -C o -i adv.data
root@linux:/home/ubuntu# tpm2_nvread -Q 0x1500031 -C o -s 32 -o read.data
root@linux:/home/ubuntu# cat read.data

(4) 確認已經寫入儲存區域 

root@linux:/home/ubuntu# tpm2_nvreadpublic > nv.out
root@linux:/home/ubuntu# cat nv.out

Error

ERROR: Esys_NV_DefineSpace(0x14C) - tpm:error(2.0): NV Index or persistent object already defined
ERROR: Failed to create NV index 0x1500031.

fixed

root@linux:/home/ubuntu# tpm2_nvundefine 0x1500031

RTC

1. Please remove all internet.

$ sudo su
# date 010610452023 && hwclock -w && date
# date 010100002000 && hwclock -r && date
# hwclock -s && date
# reboot
$ sudo su
# hwclock -s && date

UART

Orin-Nano COM1: ttyTHS1
Uart ds015.png

Switch to 232, 422, 485

Select the mode and refer to the table

Uart ds015 1.png

RS-232

COM1_SW1 OFF-OFF-OFF-OFF

$ sudo su
# stty -F /dev/ttyTHS1 speed 115200 raw -echo
# cat /dev/ttyTHS1 &
# echo "1234" > /dev/ttyTHS1
RS-422

<Receive> In terminal, run below command
COM1_SW1 ON-OFF-ON-OFF

$ sudo su
# stty -F /dev/ttyTHS1 speed 115200
# cat /dev/ttyTHS1 &
# echo "1234" > /dev/ttyTHS1

<Transmit> In other device terminal, run below command
COM1_SW1 ON-OFF-ON-OFF

$ sudo su
# stty -F /dev/ttyTHS1 speed 115200
# cat /dev/ttyTHS1 &
# echo "1234" > /dev/ttyTHS1
RS-485

<Receive> In terminal, run below command
COM1_SW1 ON-ON-ON-ON

$ sudo su
# stty -F /dev/ttyTHS1 speed 115200 raw -echo
# cat /dev/ttyTHS1 &
# echo "1234" > /dev/ttyTHS1

<Transmit> In other device terminal, run below command
COM1_SW1 ON-ON-ON-OFF

$ sudo su
# stty -F /dev/ttyTHS1 speed 115200 raw -echo
# cat /dev/ttyTHS1 &
# echo "1234" > /dev/ttyTHS1

GMSL

APPROPHO Camera

Camera type : AR0822
HW setting : Camera link to GMSL port
Appro-gmsl.jpg
Please install camera driver first
Attention : can only be executed once command to setup camera
Then system will reboot

$ cd /usr/local/bin/approcam
$ sudo ./set_approcam.sh

Check Video channel "video0" "video1"

$ ls /dev/video*

Preview command

$ cd /home/ubuntu
$ sudo ./enable-approcamera-4k.sh

Reference

DS-015