Difference between revisions of "AIR 030 Development"

From ESS-WIKI
Jump to: navigation, search
Line 2: Line 2:
 
== Flash Image ==
 
== Flash Image ==
  
Keep pressing recovery button and press power button.<br/> [[File:Air030 recovery button.jpg|200px|Air030 recovery button.jpg]]<br/> Connect a linux OS host wired usb-otg with AIR-030.<br/> In the Host PC, make sure the AIR-030 (<span style="color:#0070c0">'''NVidia Corp'''</span>) has detectd.
+
Keep pressing recovery button and press power button.<br/> [[File:Air030 recovery button.jpg|200px|Air030 recovery button.jpg]]<br/> Connect a linux OS host wired AIR-030 with usb-otg cable.<br/> In the Host PC, make sure the AIR-030 (<span style="color:#0070c0">'''NVidia Corp'''</span>) has detectd.
 
<pre>[ubuntu@linux 11:55:43 ~]$ lsusb
 
<pre>[ubuntu@linux 11:55:43 ~]$ lsusb
 
Bus 002 Device 002: ID 8087:8000 Intel Corp.
 
Bus 002 Device 002: ID 8087:8000 Intel Corp.

Revision as of 07:57, 10 November 2022

Flash Image

Keep pressing recovery button and press power button.
Air030 recovery button.jpg
Connect a linux OS host wired AIR-030 with usb-otg cable.
In the Host PC, make sure the AIR-030 (NVidia Corp) has detectd.

[ubuntu@linux 11:55:43 ~]$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0bda:0161 Realtek Semiconductor Corp. Mass Storage Device
Bus 001 Device 024: ID 0955:7223 NVidia Corp.
Bus 001 Device 002: ID 8087:8008 Intel Corp.

Extract image

$ tar -zxvf air030_image_XXXXXX.tar.gz

Flash image

$ cd bootloader
$ sudo -s
# source flashcmd.txt

Tools

Test Command

GPIO Expander

Test GPIO high/low
Air030 gpio expander io.png
1).Switch to root

ubuntu@localhost:~ sudo -s

2).Commnad : where <GPIO> : GPIO0(GPIO300)~GPIO15(GPIO315) and <LEVEL> : high(1)/low(0)
For example, pull up GPIO0 to high.

root@localhost:/home/ubuntu# echo 300 > /sys/class/gpio/export
root@localhost:/home/ubuntu# echo out > /sys/class/gpio/gpio300/direction
root@localhost:/home/ubuntu# echo 1 > /sys/class/gpio/gpio300/value

TPM

(1)產生randon code

root@imx8mprom5722a1:~# tpm2_getrandom --hex 20

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

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

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

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

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

root@imx8mprom5722a1:~# tpm2_nvreadpublic > nv.out
root@imx8mprom5722a1:~# 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@imx8mprom5722a1:~# tpm2_nvundefine 0x1500031

UART

Air030 uart mapping table.jpg

RS232 (COMX_SW1 : OFF-OFF-X-X)

COM Port Command (Please switch to root first before test)
COM1 stty -F /dev/ttyTHS0 speed 115200 raw -echo &
cat /dev/ttyTHS0 &
echo "1234" > /dev/ttyTHS0
COM2 stty -F /dev/ttyTHS4 speed 115200 raw -echo &
cat /dev/ttyTHS4 &
echo "1234" > /dev/ttyTHS4
COM4 stty -F /dev/ttyTHS3 speed 115200 raw -echo &
cat /dev/ttyTHS3 &
echo "1234" > /dev/ttyTHS3
COM5 stty -F /dev/ttyTHS1 speed 115200 raw -echo &
cat /dev/ttyTHS1 &
echo "1234" > /dev/ttyTHS1

Audio

HDMI output

$ aplay -D hw:0,3 xxx.wav

Line-Out

$ aplay -D hw:1,0 xxx.wav

FAN

Change PWM value ${PWM} from 1 ~ 255.

ubuntu@localhost:~$ sudo -s
root@localhost:/home/ubuntu# echo ${PWM} > /sys/class/hwmon/hwmon3/pwm1

CAN

$ modprobe can
$ modprobe can-dev
$ modprobe mttcan
$ ip link set can0 type can bitrate 500000
$ ip link set can0 up
$ ip link set can1 type can bitrate 500000
$ ip link set can1 up

In other terminal, run below command

$ candump can1

then run

$ cansend can0 123#abcdabcd

Flash Mac

I225 Flash Tool
Copy and extract I225_Flash_Tool.zip in the device.

ubuntu@localhost:~$ unzip I225_Flash_Tool.zip

Chanage the tool execution permission.

<pre>ubuntu@localhost:~$ sudo chmod a+x ./EepromAccessTool

Check All Intel-226 Module in PCI bus, The BDF(bus number/device number/function number) value will be first column.

ubuntu@localhost:~$ lspci
0004:00:00.0 PCI bridge: NVIDIA Corporation Device 229c (rev a1)
0004:01:00.0 PCI bridge: ASMedia Technology Inc. Device 2806 (rev 01)
0004:02:00.0 PCI bridge: ASMedia Technology Inc. Device 2806 (rev 01)
0004:02:06.0 PCI bridge: ASMedia Technology Inc. Device 2806 (rev 01)
0004:02:0e.0 PCI bridge: ASMedia Technology Inc. Device 2806 (rev 01)
0004:04:00.0 Ethernet controller: Intel Corporation Device 15f2 (rev 03)
0004:05:00.0 Ethernet controller: Intel Corporation Device 15f2 (rev 03)

Check NIC value with EepromAccessTool tool.

ubuntu@localhost:~$ ./EepromAccessTool
Intel(R) EEPROM Access Tool NVM/OTP Programming Example Tool   Version 0.8.0
Provided under the terms of a CNDA.  Do Not Distribute.
Copyright(C) 2017-2020 by Intel(R) Corporation
NIC     BUS     DEV     FUN     Silicon Memory Type Present
===     ===     ===     ===     =====   ======================
Check Command open to write error
 1      4        0       0      I225         FLASH
Check Command open to write error
 2      5        0       0      I225         FLASH

Flash Mac Address To get -nic value and BDF value please using above method.

$ sudo -s
# setpci -s 0004:04:00.0 COMMAND=0007
# ./EepromAccessTool -nic=1 -f=FXVL_15F2_LM_2MB_ARK_1.82_D.bin -mac=D4E5F6123456

The other Intel-I226

#setpci -s 0004:05:00.0 COMMAND=0007 
#./EepromAccessTool -nic=2 -f=FXVL_15F2_LM_2MB_ARK_1.82_D.bin -mac=D4E5F6123457 

Please do cold reboot after flash mac address.

How to check whether the flash proccess is success or not

  • lspci command - If it is 0x125f value, it failed.
  • ifconfig -a - Check the nerwork interface is available. ex: eth0, eth1 and so on.

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

Burning

Install prerequisite packages

$ sudo apt install --yes nvidia-jetpack

pva engine

/opt/nvidia/vpi2/samples/05-benchmark/vpi_sample_05_benchmark

GPU
matrixMul (Depreciated)

/usr/local/cuda-11.4/samples/0_Simple/matrixMul/

More power consumption version (nVidia suggestion + 0001-half-matrixMulCUBLAS.patch)
matrixMulCUBLAS

/usr/local/cuda-11.4/samples/0_Simple/matrixMulCUBLAS/

emc  engine

sudo apt install mbw

cpu

sudo apt install stress

dla0 dla1  engine

/usr/src/tensorrt/bin/trtexec

nvenc engine - USB camera

$ gst-launch-1.0  v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nvvidconv ! 'video/x-raw(memory:NVMM)' ! nvv4l2h264enc ! fakesink

nvdec engine - play 4K H264 video

gst-launch-1.0 filesrc location=/usr/local/bin/4k264.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! queue ! fakesink

ape  engine

aplay -D hw:1,0 /usr/local/bin/1kHz.wav

Module

AW-CB375NF(EWM-W159M201E)

Adjust dip switch

  • LAN3_MKE_SW1 - SW1 : ON
  • UART5_SW1 - SW1 : OFF

Wi-Fi
Start interface

$ sudo ifconfig wlan0 up

$ Scan AP

$ sudo iw dev wlan0 scan ap-force

Bluetooth

$ bluetoothctl
[bluetooth]# agent on
[bluetooth]# scan on

AW-CB511NF

Adjust dip switch

  • LAN3_MKE_SW1 - SW1 : ON
  • UART5_SW2 - SW1 : OFF

Wi-Fi
Start interface

$ sudo ifconfig wlan0 up

$ Scan AP

$ sudo iw dev wlan0 scan ap-force

Bluetooth

$ sudo -s
# hciattach /dev/ttyTHS1 bcm43xx 3000000 flow -t 20
# bluetoothctl
[bluetooth]# agent on
[bluetooth]# scan on

Image

The test image is available HERE. The 1st and 2nd image is only available for AGX-ORIN devkit.

  Image Release Note
1 air030_image_20221006.tar.gz The first boot up image verified on AGX-ORIN Devkit.
2 air030_image_20221006_bootonoff.tar.gz Based on air030_image_20221006.tar.gz added boot on off feature (The system will power off after 40 seconnds)
3 air030_image_20221020_burning_test.tar.gz For power/thermal/SI power sequence used
Testing SOP