Difference between revisions of "IoTGateway/BSP/Linux/Linux BSP User Guide Debian9 for rk"

From ESS-WIKI
Jump to: navigation, search
(Created page with "== <span style="color:#0070c0">Linux BSP Version</span> == Debian9 == <span style="color:#0070c0">Get Docker Image</span> == <br/><syntaxhighligh...")
 
 
(60 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== &lt;span style="color:#0070c0"&gt;Linux BSP Version&lt;/span&gt; ==
+
== <span style="color:#0070c0">Linux BSP Version</span> ==
  
 
Debian9
 
Debian9
  
== &lt;span style="color:#0070c0"&gt;Get Docker Image&lt;/span&gt; ==
+
== <span style="color:#0070c0">Linux BSP Document</span> ==
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$docker pull advrisc/u16.04-rklbv1<br/>&lt;/syntaxhighlight&gt;<br/>== &lt;span style="color:#0070c0"&gt;Run Docker example&lt;/span&gt; ==
+
[https://github.com/rockchip-linux/docs Rockchip Linux Document]
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$docker run -it --name rk_linux --privileged -v /home/adv/rk3399_v20:/home/adv/BSP:rw advrisc/u16.04-rklbv1:latest /bin/bash&nbsp;<br/>&lt;/syntaxhighlight&gt;
+
== <span style="color:#0070c0">Get Docker Image</span> ==
  
<br/>== &lt;span style="color:#0070c0"&gt;Install Some tools For Rockchip Linux v2.07 version&lt;/span&gt; ==
 
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$sudo apt-get install ibssl-dev&nbsp;<br/>$sudo apt-get install texinfo<br/>$sudo apt-get install liblz4-tool&nbsp;<br/>$sudo apt-get install genext2fs<br/>$sudo apt-get install time<br/>&lt;/syntaxhighlight&gt;<br/>== &lt;span style="color:#0070c0"&gt;Build U-boot&lt;/span&gt; ==
+
<syntaxhighlight lang="bash">$ docker pull advrisc/u16.04-rklbv1
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Run Docker example</span> ==
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$cd u-boot/<br/>$./make.sh evb-rk3399<br/>&lt;/syntaxhighlight&gt;<br/>== &lt;span style="color:#0070c0"&gt;Build Kernel&lt;/span&gt; ==
 
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$cd kernel<br/>$make ARCH=arm64 rockchip_ds100_defconfig<br/>$make ARCH=arm64 rk3399-ds100.img -j8<br/>&lt;/syntaxhighlight&gt;<br/>== &lt;span style="color:#0070c0"&gt;Build Recovery&lt;/span&gt; ==
+
<syntaxhighlight lang="bash">$docker run -it --name rk_linux --privileged -v /home/adv/rk3399_v20:/home/adv/BSP:rw advrisc/u16.04-rklbv1:latest /bin/bash 
 +
</syntaxhighlight>
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$./build.sh recovery<br/>&lt;/syntaxhighlight&gt;In /output/rockchip_rk3399_recovery/images create recovery.img<br/>== &lt;span style="color:#0070c0"&gt;Build Buildroot rootfs&lt;/span&gt; ==
 
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$./build.sh rootfs<br/>&lt;/syntaxhighlight&gt;<br/>== &lt;span style="color:#0070c0"&gt;Build Rootfs&lt;/span&gt; ==
+
== <span style="color:#0070c0">Install Some tools For Rockchip Linux v2.07 version</span> ==
  
=== &lt;span style="color:#0070c0"&gt;Building base debian system by ubuntu-build-service from linaro&lt;/span&gt; ===
 
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$cd rootfs/<br/>$sudo apt-get install binfmt-support qemu-user-static live-build<br/>$sudo dpkg -i ubuntu-build-service/packages/*<br/>$sudo apt-get install -f<br/>$RELEASE=stretch TARGET=desktop ARCH=arm64 ./mk-base-debian.sh<br/>&lt;/syntaxhighlight&gt;In rootfs creat linaro-stretch-alip-xxxxx-1.tar.gz<br/>=== &lt;span style="color:#0070c0"&gt;Building rk-debian rootfs&lt;/span&gt; ===
+
<syntaxhighlight lang="bash">$sudo apt-get install libssl-dev
 +
$sudo apt-get install texinfo
 +
$sudo apt-get install liblz4-tool
 +
$sudo apt-get install genext2fs
 +
$sudo apt-get install time
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Getting Debian Source Code</span> ==
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$VERSION=debug ARCH=arm64 ./mk-rootfs-stretch-arm64.sh<br/>&lt;/syntaxhighlight&gt;<br/>=== &lt;span style="color:#0070c0"&gt;Creating the ext4 image(&lt;/span&gt; ===
+
<span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small>Step1&nbsp;: To pull down the Linux source tree to your working directory from the repositories as specified in the default manifest</small></span>'''</span>
 +
<syntaxhighlight lang="bash">$ mkdir rk3399
 +
$ mkdir bin
 +
$ cd rk3399/
 +
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ../bin/repo
 +
$ chmod a+x ../bin/repo
 +
$ ../bin/repo init -u https://github.com/ADVANTECH-Rockchip/linux-manifest.git -b rk3399_linux_v2.0
 +
$ ../bin/repo sync
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Build U-boot</span> ==
  
<br/>&lt;syntaxhighlight lang="bash"&gt;$./mk-image.sh<br/>&lt;/syntaxhighlight&gt; check All Debian Image in rockimg folder
+
 
 +
<syntaxhighlight lang="bash">$cd rk3399/u-boot/
 +
$./make.sh evb-rk3399
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Build Kernel</span> ==
 +
 
 +
== <span style="color:#0070c0">Build DS-100 Kernel</span> ==
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$cd rk3399/kernel/
 +
$make ARCH=arm64 rockchip_ds100_defconfig
 +
$make ARCH=arm64 rk3399-ds100.img -j8
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Build DS-100Lite Kernel</span> ==
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$cd rk3399/kernel/
 +
$make ARCH=arm64 rockchip_ds100l_defconfig
 +
$make ARCH=arm64 rk3399-ds100l.img -j8
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Build Recovery</span> ==
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$./build.sh recovery
 +
</syntaxhighlight>In /output/rockchip_rk3399_recovery/images create recovery.img
 +
== <span style="color:#0070c0">Build Buildroot rootfs</span> ==
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$./build.sh rootfs
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Build Rootfs</span> ==
 +
 
 +
=== <span style="color:#0070c0">Building base debian system by ubuntu-build-service from linaro</span> ===
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$cd rootfs/
 +
$sudo apt-get install binfmt-support qemu-user-static live-build
 +
$sudo dpkg -i ubuntu-build-service/packages/*
 +
$sudo apt-get install -f
 +
$RELEASE=stretch TARGET=desktop ARCH=arm64 ./mk-base-debian.sh
 +
</syntaxhighlight>In rootfs creat linaro-stretch-alip-xxxxx-1.tar.gz
 +
=== <span style="color:#0070c0">Building rk-debian rootfs</span> ===
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$VERSION=debug ARCH=arm64 ./mk-rootfs-stretch-arm64.sh
 +
</syntaxhighlight>
 +
=== <span style="color:#0070c0">Creating the ext4 image</span> ===
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$./mk-image.sh
 +
$cd ..
 +
$./mkfirmware.sh debian
 +
</syntaxhighlight> Then please check Image in rockdev folder
 +
== <span style="color:#0070c0">How to do about update DS100 and DS100L Platform?</span> ==
 +
 
 +
If DS100 in Linux(Debian9), you want to upgrade to Linux(Debian9)
 +
 
 +
*[[IoTGateway/BSP/Linux/Update_SOP1_Image_DS100_and_DS100Lite|Update&nbsp;Image DS100 and DS100Lite]]
 +
 
 +
If DS100 in Android(7.1.2), you want to upgrade to Linux(Debian9)
 +
 
 +
*[[IoTGateway/BSP/Linux/Update_SOP2_Image_DS100_and_DS100Lite|Update&nbsp;Image DS100 and DS100Lite]]
 +
 
 +
 
 +
 
 +
== <span style="color:#0070c0">Download DS100 Debian Demo Images</span> ==
 +
 
 +
*[https://www.dropbox.com/s/pqi08ptkvap76y2/DIV0004_DS100_20181107.7z?dl=0 DS100 Debain Demo Image]
 +
 
 +
== <span style="color:#0070c0">Boot From SD Card Image (DS100-Lite/DMS-53)</span> ==
 +
 
 +
=== Step1 Download&nbsp; ===
 +
 
 +
&nbsp; <small>&nbsp; Download tool'''''<big>rockdev.tar.gz</big>''''' and '''''<big>SDDiskTool_v1.56.7z</big>.'''''</small>
 +
 
 +
<small>&nbsp; &nbsp; Download path&nbsp;: </small>[https://github.com/ADVANTECH-Rockchip/rk3399_tools/tree/linux_4.4 https://github.com/ADVANTECH-Rockchip/rk3399_tools/tree/linux_4.4]
 +
 
 +
=== Step2&nbsp;Create Upadte Image (In Linux env) ===
 +
 
 +
<span style="color:#FF0000;">'''If you linux env is 64 bits, you need to Install some tool.'''</span>
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$sudo dpkg --add-architecture i386
 +
$sudo apt-get update
 +
$sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
 +
</syntaxhighlight> &nbsp; step 2-1&nbsp; $tar zxvf rockdev.tar.gz &nbsp; step 2-2&nbsp; Copy all linux Image to rockdev/Image folder
 +
&nbsp; step 2-3&nbsp; Check your Image path&nbsp;in rk3399-package-file
 +
 
 +
&nbsp; step 2-4&nbsp; $./rk3399-mkupdate.sh
 +
 
 +
&nbsp; step 2-5&nbsp; Creat the update.img&nbsp; in rockdev/update.img
 +
 
 +
=== Step3&nbsp;Create SD Card (In Windows env) ===
 +
 
 +
&nbsp; step 3-1&nbsp; Unzip SDDiskTool_v1.56
 +
 
 +
&nbsp; step 3-2&nbsp; Run SD_Firmware_Tool
 +
 
 +
&nbsp; step 3-3&nbsp; Insert the SD card to your PC and push the botton&nbsp;"Resotore"
 +
 
 +
&nbsp; step 3-4 Choose firmware (choose the update.img)&nbsp;
 +
 
 +
&nbsp; step 3-5&nbsp;Chooes the SD Boot and&nbsp; push the botton "Create"
 +
 
 +
&nbsp; step 3.6 Finished
 +
 
 +
== <span style="color:#0070c0">Upgrade OS Image on EMMC from a SD card</span> ==
 +
 
 +
=== '''Produce update.img''' ===
 +
 
 +
Please make sure there are included resource.img, misc.img&nbsp; and recovery.img in the Image folder. ( So does the package-file ).
 +
 
 +
PS: Both&nbsp;resource.img and misc.img derived from DS100 Android build.
 +
 
 +
=== '''Make an EMMC downloader SD card''' ===
 +
 
 +
Every step described as above.&nbsp;on "Second: Choose function mode", please check&nbsp;the checkbox "Upgrade Firmware".
 +
 
 +
=== '''Update OS image on EMMC.''' ===
 +
 
 +
#Insert the&nbsp;EMMC downloader SD card on a booted DUT.
 +
#Enter command "boot recovery".
 +
#The system will do a recovery step.
 +
#Turn off the DUT after the yellow text disappears on screen.
 +
#Removing the SD card and turn on DUT.
 +
#The system will remove user data and reboot.
 +
 
 +
== <span style="color:#0070c0">Modules</span> ==
 +
 
 +
=== EWM-C117-4G Module ===
 +
 
 +
*[[:File:EWM-C117_for_RK3399_ds100.docx|EWM-C117_for_RK3399_ds100.docx]]
 +
 
 +
=== EWM-W163M201E ===
 +
 
 +
*[[:File:EWM-W163M201E_porting_guide_on_DS100.docx|EWM-W163M201E_porting_guide_on_DS100.docx]]
 +
 
 +
*[[:File:EWM-W163_firmware.7z|EWM-W163_Firmware]]
 +
 
 +
=== EWM-W188 ===
 +
 
 +
*[[:File:EWM-W188_Bluetooth_porting_guide_for_ds100-debian.docx|EWM-W188_Bluetooth_porting_guide_for_ds100-debian.docx]]
 +
 
 +
=== EWM-C145-4G Module ===
 +
 
 +
*[[:File:EWM-4G_porting_guide_on_DS100_new.docx|EWM-4G_Porting_Guide_On_DS100]]
 +
 
 +
== <span style="color:#0070c0">Add CIFS</span> ==
 +
 
 +
=== Support CIFS ===
 +
 
 +
 
 +
<syntaxhighlight lang="bash">Add CIFS config in kernel config 
 +
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
 +
CONFIG_TMPFS=y
 +
CONFIG_TMPFS_POSIX_ACL=y
 +
+CONFIG_CIFS=y
 +
+CONFIG_CIFS_XATTR=y
 +
+CONFIG_CIFS_POSIX=y
 +
CONFIG_SQUASHFS=y
 +
CONFIG_NFS_FS=y
 +
CONFIG_NFS_V3_ACL=y
 +
</syntaxhighlight><syntaxhighlight lang="bash">$sudo apt-get update
 +
$sudo apt-get install cifs-utils
 +
$mkdir /tmp_mount
 +
$sudo mount.cifs //xxx.xxx.xx.xx/clayder /tmp_mount -o username=clayder<--example
 +
</syntaxhighlight>
 +
*//xxx.xxx.xx.xx/clayder Network PC share folder
 +
*/tmp_mount DS100 target folder
 +
 
 +
 
 +
 
 +
== <span style="color:#0070c0">Video player Test</span> ==
 +
 
 +
Player 4K Video Example
 +
 
 +
 
 +
<syntaxhighlight lang="bash"># export DISPLAY=:0.0
 +
# su linaro -c "gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4  ! rkximagesink" </syntaxhighlight>

Latest revision as of 03:07, 7 November 2019

Linux BSP Version

Debian9

Linux BSP Document

Rockchip Linux Document

Get Docker Image

$ docker pull advrisc/u16.04-rklbv1

Run Docker example

$docker run -it --name rk_linux --privileged -v /home/adv/rk3399_v20:/home/adv/BSP:rw advrisc/u16.04-rklbv1:latest /bin/bash 


Install Some tools For Rockchip Linux v2.07 version

$sudo apt-get install libssl-dev
$sudo apt-get install texinfo
$sudo apt-get install liblz4-tool 
$sudo apt-get install genext2fs
$sudo apt-get install time

Getting Debian Source Code

Step1 : To pull down the Linux source tree to your working directory from the repositories as specified in the default manifest

$ mkdir rk3399
$ mkdir bin
$ cd rk3399/
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ../bin/repo
$ chmod a+x ../bin/repo
$ ../bin/repo init -u https://github.com/ADVANTECH-Rockchip/linux-manifest.git -b rk3399_linux_v2.0
$ ../bin/repo sync

Build U-boot

$cd rk3399/u-boot/
$./make.sh evb-rk3399

Build Kernel

Build DS-100 Kernel

$cd rk3399/kernel/
$make ARCH=arm64 rockchip_ds100_defconfig
$make ARCH=arm64 rk3399-ds100.img -j8

Build DS-100Lite Kernel

$cd rk3399/kernel/
$make ARCH=arm64 rockchip_ds100l_defconfig
$make ARCH=arm64 rk3399-ds100l.img -j8

Build Recovery

$./build.sh recovery
In /output/rockchip_rk3399_recovery/images create recovery.img

Build Buildroot rootfs

$./build.sh rootfs

Build Rootfs

Building base debian system by ubuntu-build-service from linaro

$cd rootfs/
$sudo apt-get install binfmt-support qemu-user-static live-build
$sudo dpkg -i ubuntu-build-service/packages/*
$sudo apt-get install -f
$RELEASE=stretch TARGET=desktop ARCH=arm64 ./mk-base-debian.sh
In rootfs creat linaro-stretch-alip-xxxxx-1.tar.gz

Building rk-debian rootfs

$VERSION=debug ARCH=arm64 ./mk-rootfs-stretch-arm64.sh

Creating the ext4 image

$./mk-image.sh
$cd ..
$./mkfirmware.sh debian
Then please check Image in rockdev folder

How to do about update DS100 and DS100L Platform?

If DS100 in Linux(Debian9), you want to upgrade to Linux(Debian9)

If DS100 in Android(7.1.2), you want to upgrade to Linux(Debian9)


Download DS100 Debian Demo Images

Boot From SD Card Image (DS100-Lite/DMS-53)

Step1 Download 

    Download toolrockdev.tar.gz and SDDiskTool_v1.56.7z.

    Download path : https://github.com/ADVANTECH-Rockchip/rk3399_tools/tree/linux_4.4

Step2 Create Upadte Image (In Linux env)

If you linux env is 64 bits, you need to Install some tool.


$sudo dpkg --add-architecture i386
$sudo apt-get update
$sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
  step 2-1  $tar zxvf rockdev.tar.gz   step 2-2  Copy all linux Image to rockdev/Image folder

  step 2-3  Check your Image path in rk3399-package-file

  step 2-4  $./rk3399-mkupdate.sh

  step 2-5  Creat the update.img  in rockdev/update.img

Step3 Create SD Card (In Windows env)

  step 3-1  Unzip SDDiskTool_v1.56

  step 3-2  Run SD_Firmware_Tool

  step 3-3  Insert the SD card to your PC and push the botton "Resotore"

  step 3-4 Choose firmware (choose the update.img) 

  step 3-5 Chooes the SD Boot and  push the botton "Create"

  step 3.6 Finished

Upgrade OS Image on EMMC from a SD card

Produce update.img

Please make sure there are included resource.img, misc.img  and recovery.img in the Image folder. ( So does the package-file ).

PS: Both resource.img and misc.img derived from DS100 Android build.

Make an EMMC downloader SD card

Every step described as above. on "Second: Choose function mode", please check the checkbox "Upgrade Firmware".

Update OS image on EMMC.

  1. Insert the EMMC downloader SD card on a booted DUT.
  2. Enter command "boot recovery".
  3. The system will do a recovery step.
  4. Turn off the DUT after the yellow text disappears on screen.
  5. Removing the SD card and turn on DUT.
  6. The system will remove user data and reboot.

Modules

EWM-C117-4G Module

EWM-W163M201E

EWM-W188

EWM-C145-4G Module

Add CIFS

Support CIFS

Add CIFS config in kernel config 
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_CIFS=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
CONFIG_SQUASHFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
$sudo apt-get update
$sudo apt-get install cifs-utils
$mkdir /tmp_mount
$sudo mount.cifs //xxx.xxx.xx.xx/clayder /tmp_mount -o username=clayder<--example
  • //xxx.xxx.xx.xx/clayder Network PC share folder
  • /tmp_mount DS100 target folder


Video player Test

Player 4K Video Example


# export DISPLAY=:0.0
# su linaro -c "gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4  ! rkximagesink"