Difference between revisions of "AIR 021 Development"
(→APPROPHO Camera) |
|||
| (23 intermediate revisions by 2 users not shown) | |||
| Line 165: | Line 165: | ||
# cansend can0 123#abcdabcd | # cansend can0 123#abcdabcd | ||
</pre> | </pre> | ||
| + | |||
| + | ==== '''DIO 8bit''' ==== | ||
| + | Hardware setting | ||
| + | <br/> | ||
| + | [[File:Air-021-DIO.jpg|600px|border]] | ||
| + | <br/> | ||
| + | * The TCA9555 is identical to the TCA9535, except for the inclusion of the internal I/O pull-up resistor, which pulls the I/O to a default high when configured as an input and undriven. | ||
| + | Pin table with DIO expander number | ||
| + | <br/> | ||
| + | Pin1-->300, Pin5-->308 | ||
| + | <br/>Pin2-->301, Pin6-->309 | ||
| + | <br/>Pin3-->302, Pin7-->310 | ||
| + | <br/>Pin4-->303, Pin8-->311 | ||
| + | <br/> | ||
| + | For example set Pin1 direction out, value high | ||
| + | <pre> | ||
| + | $ sudo su | ||
| + | # echo 300 > /sys/class/gpio/export | ||
| + | # echo out > /sys/class/gpio/gpio300/direction | ||
| + | # echo 1 > /sys/class/gpio/gpio300/value | ||
| + | </pre> | ||
| + | For example set Pin5 direction in | ||
| + | <pre> | ||
| + | $ sudo su | ||
| + | # echo 308 > /sys/class/gpio/export | ||
| + | # echo in > /sys/class/gpio/gpio308/direction | ||
| + | </pre> | ||
| + | |||
==== '''UART''' ==== | ==== '''UART''' ==== | ||
===== '''Switch to 232, 422, 485''' ===== | ===== '''Switch to 232, 422, 485''' ===== | ||
| Line 180: | Line 208: | ||
===== RS-232 ===== | ===== RS-232 ===== | ||
| + | Hardware setting : COM1 link loopback jig | ||
| + | <br/> | ||
COM1_SW1 OFF-OFF-OFF-OFF | COM1_SW1 OFF-OFF-OFF-OFF | ||
<pre> | <pre> | ||
| Line 188: | Line 218: | ||
</pre> | </pre> | ||
| + | Hardware setting : COM2 link loopback jig | ||
| + | <br/> | ||
COM2_SW1 OFF-OFF-OFF-OFF | COM2_SW1 OFF-OFF-OFF-OFF | ||
<pre> | <pre> | ||
| Line 197: | Line 229: | ||
===== RS-422 ===== | ===== RS-422 ===== | ||
| + | Hardware setting : COM1 link COM2 | ||
| + | <br/> | ||
<Receive> In terminal, run below command | <Receive> In terminal, run below command | ||
<br/> COM1_SW1 ON-OFF-ON-OFF | <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> | ||
| Line 208: | Line 243: | ||
<br/> COM2_SW1 ON-OFF-ON-OFF | <br/> COM2_SW1 ON-OFF-ON-OFF | ||
<pre> | <pre> | ||
| − | stty -F /dev/ttyTHS2 speed 115200 | + | $ sudo su |
| − | cat /dev/ttyTHS2 & | + | # stty -F /dev/ttyTHS2 speed 115200 |
| − | echo "1234" > /dev/ttyTHS2 | + | # cat /dev/ttyTHS2 & |
| + | # echo "1234" > /dev/ttyTHS2 | ||
</pre> | </pre> | ||
===== RS-485 ===== | ===== RS-485 ===== | ||
| + | Hardware setting : COM1 link COM2 | ||
| + | <br/> | ||
<Receive> In terminal, run below command | <Receive> In terminal, run below command | ||
<br/> COM1_SW1 ON-ON-ON-ON | <br/> COM1_SW1 ON-ON-ON-ON | ||
| Line 234: | Line 272: | ||
==== '''AIW Tool''' ==== | ==== '''AIW Tool''' ==== | ||
===== AIW-356 ===== | ===== AIW-356 ===== | ||
| − | First need to soft link | + | First need to soft link source for build driver |
<pre> | <pre> | ||
$ cd /lib/modules/<kernel version>/build/arch/ | $ cd /lib/modules/<kernel version>/build/arch/ | ||
| Line 247: | Line 285: | ||
<br/> | <br/> | ||
Please reference AIW [https://docs.aiw-module.advantech.com/assets/files/AIW-Tool_UserGuide_v1.0-cc56524ec46f5992c290edbe56f94bf3.pdf Document] | Please reference AIW [https://docs.aiw-module.advantech.com/assets/files/AIW-Tool_UserGuide_v1.0-cc56524ec46f5992c290edbe56f94bf3.pdf Document] | ||
| + | |||
| + | ===== AIW-170 ===== | ||
| + | First need to install WIFI module | ||
| + | <pre> | ||
| + | $ cd /usr/local/bin/AIW-170 | ||
| + | $ sudo su | ||
| + | # modprobe cfg80211 | ||
| + | # insmod wlan_cnss_core_pcie.ko | ||
| + | # insmod wlan.ko | ||
| + | </pre> | ||
| + | |||
| + | ==== '''GMSL''' ==== | ||
| + | ===== '''APPROPHO Camera''' ===== | ||
| + | |||
| + | Camera type : AR0822 | ||
| + | <br/> | ||
| + | HW setting : Camera link to MIPI Type C | ||
| + | <br/> | ||
| + | [[File:Air021 cam 1.jpg|600px|border]] | ||
| + | <br/> | ||
| + | Please install camera driver first | ||
| + | <br/> | ||
| + | Then system needs to reboot to take effect after setting camera interface done | ||
| + | |||
| + | <br/> | ||
| + | Setup driver with MIPI | ||
| + | <pre> | ||
| + | $ cd /usr/local/bin/approcam/mipi/ | ||
| + | $ sudo ./set_approcam_mipi.sh | ||
| + | </pre> | ||
| + | Setup driver with GMSL | ||
| + | <pre> | ||
| + | $ cd /usr/local/bin/approcam/gmsl/ | ||
| + | $ sudo ./set_approcam_gmsl.sh | ||
| + | </pre> | ||
| + | Check Video channel "video0" "video1" ~ "videoX" | ||
| + | <pre> | ||
| + | $ ls /dev/video* | ||
| + | </pre> | ||
| + | Preview command | ||
| + | <pre> | ||
| + | $ cd /home/ubuntu | ||
| + | [usage] enable-approcamera.sh width height | ||
| + | $ sudo ./enable-approcamera.sh 1920 1080 // enable camera with resolution 1920x1080 | ||
| + | $ sudo ./enable-approcamera.sh 3840 2160 // enable camera with resolution 3840x2160 (4k) | ||
| + | </pre> | ||
== Reference == | == Reference == | ||
[[AIR-021|AIR-021]] | [[AIR-021|AIR-021]] | ||
Latest revision as of 09:09, 16 October 2025
Contents
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 682f22e8: [LAN] Enable Ethernet Controller I225-LM/I225-V support }
Download I226 tool to Device
Extract file
$ sudo tar zxvf LAN_I226_AIR-021.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_AIR-021/I226_Flash_Tool $ sudo su # ./EepromAccessTool # lspci # setpci -s 0009:01:00.0 COMMAND=0007 # ./EepromAccessTool -nic=1 -f=FXVL_125B_LM_2MB_2.23.bin -mac=XXXXXXXXXXXX
Power off and restart
Cold reboot the device.
Bootloader Version
Check device boot up in debugport log
Burnin
BootCount
Choose ATX or AT mode
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.
![]()
Reset the boot count please remove bootCount.tt.
$ rm bootCount.tt
Tools
Test Command
JP6.2
HDMI
Set on debug port
$ export DISPLAY=:0 $ xrandr
Image resolution : Full HD 1920 x 1080 pixels
$ xrandr -d :0 --output HDMI-0 --mode 1920x1080 -r 60.00
Image resolution : 4K 3840 x 2160 pixels
$ xrandr -d :0 --output HDMI-0 --mode 3840x2160 -r 60.00
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
CAN
<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
DIO 8bit
- The TCA9555 is identical to the TCA9535, except for the inclusion of the internal I/O pull-up resistor, which pulls the I/O to a default high when configured as an input and undriven.
Pin table with DIO expander number
Pin1-->300, Pin5-->308
Pin2-->301, Pin6-->309
Pin3-->302, Pin7-->310
Pin4-->303, Pin8-->311
For example set Pin1 direction out, value high
$ sudo su # echo 300 > /sys/class/gpio/export # echo out > /sys/class/gpio/gpio300/direction # echo 1 > /sys/class/gpio/gpio300/value
For example set Pin5 direction in
$ sudo su # echo 308 > /sys/class/gpio/export # echo in > /sys/class/gpio/gpio308/direction
UART
Switch to 232, 422, 485
Select the mode and refer to the table
COM1_SW1
COM2_SW1
RS-232
Hardware setting : COM1 link loopback jig
COM1_SW1 OFF-OFF-OFF-OFF
$ sudo su # stty -F /dev/ttyTHS1 speed 115200 raw -echo # cat /dev/ttyTHS1 & # echo "1234" > /dev/ttyTHS1
Hardware setting : COM2 link loopback jig
COM2_SW1 OFF-OFF-OFF-OFF
$ sudo su # stty -F /dev/ttyTHS2 speed 115200 raw -echo # cat /dev/ttyTHS2 & # echo "1234" > /dev/ttyTHS2
RS-422
Hardware setting : COM1 link COM2
<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 terminal, run below command
COM2_SW1 ON-OFF-ON-OFF
$ sudo su # stty -F /dev/ttyTHS2 speed 115200 # cat /dev/ttyTHS2 & # echo "1234" > /dev/ttyTHS2
RS-485
Hardware setting : COM1 link COM2
<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 terminal, run below command
COM2_SW1 ON-ON-ON-OFF
$ sudo su # stty -F /dev/ttyTHS2 speed 115200 raw -echo # cat /dev/ttyTHS2 & # echo "1234" > /dev/ttyTHS2
AIW Tool
AIW-356
First need to soft link source for build driver
$ cd /lib/modules/<kernel version>/build/arch/ $ sudo ln -s arm64 aarch64
Tar file
$ cd /usr/local/bin/AIW-356 $ sudo tar -xvf AIWS00LTX0317.tar.bz2
Build driver
Please reference AIW Document
AIW-170
First need to install WIFI module
$ cd /usr/local/bin/AIW-170 $ sudo su # modprobe cfg80211 # insmod wlan_cnss_core_pcie.ko # insmod wlan.ko
GMSL
APPROPHO Camera
Camera type : AR0822
HW setting : Camera link to MIPI Type C
Please install camera driver first
Then system needs to reboot to take effect after setting camera interface done
Setup driver with MIPI
$ cd /usr/local/bin/approcam/mipi/ $ sudo ./set_approcam_mipi.sh
Setup driver with GMSL
$ cd /usr/local/bin/approcam/gmsl/ $ sudo ./set_approcam_gmsl.sh
Check Video channel "video0" "video1" ~ "videoX"
$ ls /dev/video*
Preview command
$ cd /home/ubuntu [usage] enable-approcamera.sh width height $ sudo ./enable-approcamera.sh 1920 1080 // enable camera with resolution 1920x1080 $ sudo ./enable-approcamera.sh 3840 2160 // enable camera with resolution 3840x2160 (4k)