การใช้บอร์ดอ้างอิง

จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ

คุณสามารถสร้างรุ่นสำหรับอุปกรณ์ Nexus และ Pixel โดยใช้รุ่น Android Open Source Project (AOSP) และไบนารีเฉพาะฮาร์ดแวร์ที่เกี่ยวข้อง สำหรับรุ่น Android และอุปกรณ์เป้าหมาย โปรดดู แท็กซอร์สโค้ดและรุ่น

คุณยังสามารถสร้างงานสร้างสำหรับบอร์ดอ้างอิง Android ของ DragonBoard 845c , HiKey 960 , Khadas VIM3 และ Qualcomm Robotics Board RB5 ซึ่งออกแบบมาเพื่อช่วยผู้จำหน่ายส่วนประกอบที่ไม่ใช่มือถือในการพัฒนาและพอร์ตไดรเวอร์ไปยัง Android ที่เผยแพร่ การใช้กระดานอ้างอิงสามารถลดความพยายามในการอัปเกรด ลดเวลาออกสู่ตลาดสำหรับอุปกรณ์ Android ใหม่ ลดต้นทุนอุปกรณ์โดยทำให้ ODM/OEM สามารถเลือกส่วนประกอบที่เข้ากันได้ที่หลากหลายขึ้น และเพิ่มความเร็วของนวัตกรรมในหมู่ซัพพลายเออร์ส่วนประกอบ

Google รองรับ บอร์ดอ้างอิง DragonBoard 845c , HiKey 960 , Khadas VIM3 และ Qualcomm Robotics Board RB5 Android AOSP ให้การสนับสนุนเคอร์เนลซอร์สและบอร์ดสำหรับบอร์ดเหล่านี้ ดังนั้นนักพัฒนาจึงสามารถสร้างและดีบักไดรเวอร์อุปกรณ์ต่อพ่วง ทำการพัฒนาเคอร์เนล และทำงานอื่นๆ ได้โดยง่ายโดยมีภาระผูกพันจาก OEM น้อยลง

ดราก้อนบอร์ด 845c

DragonBoard 845c เป็นส่วนหนึ่งของแพลตฟอร์ม RB3 และเข้าถึงได้จาก 96boards.org

ภาพกระดานมังกร

รูปที่ 1. ดราก้อนบอร์ด 845c

กำลังรวบรวมพื้นที่ผู้ใช้

ใช้คำสั่งต่อไปนี้เพื่อดาวน์โหลดและสร้าง Android บน DragonBoard 845c

  1. ดาวน์โหลดแผนผังแหล่งที่มาของ Android:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. ดาวน์โหลดแพ็คเกจผู้จำหน่ายปัจจุบัน:

    ./device/linaro/dragonboard/fetch-vendor-package.sh
    
  3. สร้าง AOSP:

    . ./build/envsetup.sh
    lunch db845c-userdebug
    make -j24
    

การติดตั้งอิมเมจในเครื่อง

  1. บูต db845c เข้าสู่โหมด fastboot

  2. เรียกใช้คำสั่งต่อไปนี้:

    ./device/linaro/dragonboard/installer/db845c/flash-all-aosp.sh
    

หากจำเป็น คุณสามารถดำเนินการกู้คืนบอร์ด QDL ได้โดยการรันสคริปต์ต่อไปนี้หลังจากบูท db845c ในโหมดแฟลช USB (ดูที่ DragonBoard Recovery ):

./device/linaro/dragonboard/installer/db845c/recovery.sh

สร้างเคอร์เนล

การสร้างสิ่งประดิษฐ์เคอร์เนล DragonBoard db845c Android Generic Kernel Image (GKI):

  1. รันคำสั่งต่อไปนี้เพื่อโคลนซอร์สเคอร์เนลและสร้าง toolchains ของ Android และสร้างสคริปต์ล่วงหน้า

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
    repo sync -j8 -c
    rm -rf out
    tools/bazel run //common:db845c_dist -- --dist_dir=$DIST_DIR
    
  1. ลบวัตถุทั้งหมดใน ${AOSP_TOPDIR}device/linaro/dragonboard-kernel/android-mainline/ จากนั้นคัดลอกการสร้างสิ่งประดิษฐ์จาก out/android-mainline/dist/ ไปยัง ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/ จากนั้นสร้างพื้นที่ผู้ใช้ใหม่ด้วย:

    make TARGET_KERNEL_USE=mainline -j24
    

    และแฟลชอุปกรณ์ด้วย boot.img และ super.img ที่เป็นผลลัพธ์ (ดูที่การ คอมไพล์ userspace )

  2. ทดสอบเคอร์เนล GKI:

    1. ดู kernel_aarch64 build ล่าสุด

    2. ใน สิ่งประดิษฐ์ ให้ดาวน์โหลดรูปภาพ

    3. Gzip รูปภาพ

      gzip Image
      
    4. คัดลอกไปที่ ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/

    5. สร้าง AOSP ใหม่และแฟลชอุปกรณ์ด้วย boot.img ใหม่ (ดูที่การ คอมไพล์ userspace )

บอร์ด HiKey 960

บอร์ด HiKey 960 มีจำหน่ายที่ Amazon และ Lenovator

ภาพบอร์ด HiKey 960

รูปที่ 2 บอร์ด HiKey 960 โดย Lenovator

กำลังรวบรวมพื้นที่ผู้ใช้

ใช้คำสั่งต่อไปนี้เพื่อดาวน์โหลดและสร้าง Android บนบอร์ด HiKey 960

  1. ดาวน์โหลดแผนผังแหล่งที่มาของ Android

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. ดาวน์โหลดแพ็คเกจผู้ขายปัจจุบัน

    ./device/linaro/hikey/fetch-vendor-package.sh
    
  3. สร้าง

    . ./build/envsetup.sh
    lunch hikey960-userdebug
    make -j24
    

การติดตั้งอิมเมจในเครื่อง

  1. เลือกโหมด fastboot โดยเปิดสวิตช์ 3 (สำหรับรายละเอียด โปรดดูที่ คู่มือเริ่มต้นใช้งาน HiKey 960 )

  2. จ่ายไฟให้กับบอร์ด

  3. ภาพแฟลชในเครื่อง:

    ./device/linaro/hikey/installer/hikey960/flash-all.sh
    
  4. ปิดสวิตช์ 3 และเปิดปิดบอร์ด

สร้างเคอร์เนล

ในการสร้างสิ่งประดิษฐ์เคอร์เนล HiKey960 Android GKI:

  1. เรียกใช้คำสั่งต่อไปนี้:

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android12-5.4
    repo sync -j8 -c
    rm -rf out
    BUILD_CONFIG=common/build.config.hikey960 build/build.sh
    
  2. ลบวัตถุทั้งหมดใน ${AOSP_TOPDIR}device/linaro/hikey-kernel/hikey960/5.4/ จากนั้นคัดลอกการสร้างสิ่งประดิษฐ์จากเคอร์เนล build in out/android12-5.4/dist/ ไปยัง ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/

  3. เชื่อมต่อ DTB:

    cat device/linaro/hikey-kernel/hikey960/5.4/Image.gz
    device/linaro/hikey-kernel/hikey960/5.4/hi3660-hikey960.dtb  > 
    device/linaro/hikey-kernel/hikey960/5.4/Image.gz-dtb
    
  4. สร้างพื้นที่ผู้ใช้ Android

    lunch hikey960-userdebug
    make TARGET_KERNEL_USE=5.4 HIKEY_USES_GKI=true -j24
    

    และแฟลชอุปกรณ์ด้วยเคอร์เนลใหม่ (ดูที่การ คอมไพล์ userspace )

  5. ทดสอบเคอร์เนล Generic Kernel Image (GKI)

    • ดู kernel_aarch64 build ล่าสุด

    • ใน artifacts ให้ดาวน์โหลดไฟล์ Image และคัดลอกไปที่ ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/

    • บีบอัดภาพและเชื่อมต่อ DTB

    gzip ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image
    cat ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image.gz
    ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/hi3660-hikey960.dtb  >
    ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image.gz-dtb
    
    • สร้างและแฟลชอุปกรณ์ด้วยเคอร์เนลใหม่ (ดูที่การ คอมไพล์ userspace )

การตั้งค่าหมายเลขซีเรียล

ในการตั้งค่าหมายเลขซีเรียลแบบสุ่ม ให้เรียกใช้:

  fastboot getvar nve:SN@16\_DIGIT\_NUMBER

Bootloader ส่งออกหมายเลขซีเรียลที่สร้างขึ้นไปยังเคอร์เนลโดยใช้ androidboot.serialno= พารามิเตอร์นี้ส่งผ่านบรรทัดคำสั่งเคอร์เนลใน Android 11 และต่ำกว่า และผ่าน bootconfig ใน Android 12 ที่มีเคอร์เนลเวอร์ชัน 5.10 หรือสูงกว่า

การตั้งค่าความละเอียดของจอภาพ

แก้ไขพารามิเตอร์ device/linaro/hikey/hikey960/BoardConfig.mk BOARD_KERNEL_CMDLINE และกำหนดการตั้งค่า video ตัวอย่างเช่น การตั้งค่าสำหรับจอภาพขนาด 24 นิ้วคือ video=HDMI-A-1:1280x800@60

บอร์ด VIM3 และ VIM3L

บอร์ด Vim3 และ VIM3L โดย Khadas มีให้จาก เว็บไซต์ Khadas

ภาพบอร์ด VIM3

รูปที่ 3 บอร์ด VIM3 โดย Khadas

กำลังรวบรวมพื้นที่ผู้ใช้

ใช้คำสั่งต่อไปนี้เพื่อดาวน์โหลดและสร้าง Android บนบอร์ด VIM3

  1. ดาวน์โหลดแผนผังแหล่งที่มาของ Android:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. สร้าง:

    . ./build/envsetup.sh
    lunch yukawa-userdebug
    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3=true -j24
    

    ตามค่าเริ่มต้น Android สร้างขึ้นด้วยเคอร์เนล 5.10 หากต้องการใช้เคอร์เนล 5.4 ที่สร้างไว้ล่วงหน้า:

    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3=true TARGET_KERNEL_USE=5.4 -j24
    

    สำหรับ VIM3L ให้ใช้:

    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3L=true -j24
    

การติดตั้งภาพเริ่มต้น

  1. ให้บอร์ดอยู่ในโหมดอัปเกรด USB ตาม คำแนะนำการแฟลช VIM3

  2. แฟลชภาพเริ่มต้นไปที่ RAM:

    cd path/to/aosp/device/amlogic/yukawa/bootloader/
    ./tools/update write u-boot_kvim3_noab.bin 0xfffa0000 0x10000
    ./tools/update run 0xfffa0000
    ./tools/update bl2_boot u-boot_kvim3_noab.bin
    
    • หากคุณพบปัญหาเกี่ยวกับสิทธิ์ โปรดดู ส่วนกฎ udev เพื่อเพิ่มกฎ USB ที่เหมาะสม
    • หาก tools/update ไม่ทำงาน ให้ใช้ เครื่องมือ pyamlboot เพื่อแฟลชบอร์ดแทน
  3. หลังจาก U-Boot บู๊ตและรัน fastboot ให้รันคำสั่งต่อไปนี้:

    fastboot oem format
    fastboot flash bootloader u-boot_kvim3_noab.bin
    fastboot erase bootenv
    fastboot reboot bootloader
    
  4. ถอดปลั๊กและเสียบสายไฟ

บอร์ดควรบูตเข้าสู่ U-boot ที่เพิ่งกะพริบและเข้าสู่โหมด fastboot

ภาพกระพริบ

  1. เข้าสู่โหมด fastboot (ดูคำแนะนำในส่วนก่อนหน้า)

  2. แฟลชรูปภาพ Android ทั้งหมด:

    cd out/target/product/yukawa
    fastboot flash boot boot.img
    fastboot flash super super.img
    fastboot flash cache cache.img
    fastboot flash userdata userdata.img
    fastboot flash recovery recovery.img
    fastboot flash dtbo dtbo-unsigned.img
    fastboot reboot
    

สร้างเคอร์เนล

ในการสร้างส่วนเคอร์เนลสำหรับ VIM3 หรือ VIM3L:

  1. ดาวน์โหลด toolchains เพิ่มเติม:

    git clone https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ${AOSP_TOPDIR}/prebuilts/gas/linux-x86
    
  2. โคลนแหล่งที่มาของเคอร์เนล:

    # for 4.19
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-4.19
    # for 5.4
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.4
    # for 5.10
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.10
    # for 5.15
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.15
    
  3. ส่งออกตัวแปร build:

    export PATH=${AOSP_TOPDIR}/prebuilts/clang/host/linux-x86/clang-r445002/bin:$PATH
    export PATH=${AOSP_TOPDIR}/prebuilts/gas/linux-x86:$PATH
    export PATH=${AOSP_TOPDIR}/prebuilts/misc/linux-x86/lz4:$PATH
    export ARCH=arm64
    export CROSS_COMPILE=aarch64-linux-gnu-
    export LLVM=1
    
  4. สร้างเคอร์เนล:

    cd hikey-linaro
    make meson_defconfig
    make DTC_FLAGS="-@" -j24
    
  5. บีบอัดเคอร์เนลและคัดลอก build_artifacts ไปยัง ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel :

    lz4c -f arch/arm64/boot/Image arch/arm64/boot/Image.lz4
    KERN_VER=4.19 # for 4.19 kernel
    KERN_VER=5.4  # for 5.4 kernel
    KERN_VER=5.10 # for 5.10 kernel
    KERN_VER=5.15 # for 5.15 kernel
    for f in arch/arm64/boot/dts/amlogic/*{g12b-a311d,sm1}-khadas-vim3*.dtb; do
        cp -v -p $f ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/${KERN_VER}/$(basename $f)
    done
    cp -v -p arch/arm64/boot/Image.lz4 ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/${KERN_VER}/Image.lz4
    
  6. สร้างพื้นที่ผู้ใช้ Android ใหม่ (ดูที่การ รวบรวม พื้นที่ผู้ใช้) และแฟลชเคอร์เนลใหม่ (ดู ภาพที่กะพริบ )

บอร์ด Qualcomm Robotics RB5

Robotics Board RB5 มีให้ที่ 96boards.org

rb5_board

รูปที่ 4 บอร์ดหุ่นยนต์ RB5

กำลังรวบรวมพื้นที่ผู้ใช้

ใช้คำสั่งต่อไปนี้เพื่อดาวน์โหลดและสร้าง Android บน RB5

  1. ดาวน์โหลดแผนผังแหล่งที่มาของ Android:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. ดาวน์โหลดแพ็คเกจผู้จำหน่ายปัจจุบัน:

    ./device/linaro/dragonboard/fetch-vendor-package.sh
    
  3. สร้าง AOSP:

    . ./build/envsetup.sh
    lunch rb5-userdebug
    make -j24
    

การติดตั้งอิมเมจในเครื่อง

  1. บูต RB5 เข้าสู่โหมด fastboot

  2. เรียกใช้คำสั่งต่อไปนี้:

    ./device/linaro/dragonboard/installer/rb5/flash-all-aosp.sh
    

หากจำเป็น คุณสามารถดำเนินการกู้คืนบอร์ด QDL ได้โดยการรันสคริปต์ต่อไปนี้หลังจากบูต RB5 ในโหมดแฟลช USB (ดู การ กู้คืน RB5 ):

   ./device/linaro/dragonboard/installer/rb5/recovery.sh

สร้างเคอร์เนล

วิธีสร้างสิ่งประดิษฐ์เคอร์เนล RB5 Android Generic Kernel Image (GKI):

  1. เรียกใช้คำสั่งต่อไปนี้เพื่อโคลนซอร์สเคอร์เนลและ toolchains ของ Android ที่สร้างไว้ล่วงหน้าและสร้างสคริปต์:

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
    repo sync -j8 -c
    rm -rf out
    BUILD_CONFIG=common/build.config.db845c ./build/build.sh
    
  2. ลบวัตถุทั้งหมดใน ${AOSP_TOPDIR}device/linaro/dragonboard-kernel/android-mainline/ จากนั้นคัดลอกการสร้างสิ่งประดิษฐ์จาก out/android-mainline/dist/ ไปยัง ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/ แล้วสร้างพื้นที่ผู้ใช้ใหม่ด้วย:

    make TARGET_KERNEL_USE=mainline -j24
    

    และแฟลชอุปกรณ์ด้วย boot.img และ super.img ที่เป็นผลลัพธ์ (ดูที่การ คอมไพล์ userspace )

  3. ทดสอบเคอร์เนล GKI:

    1. ดู kernel_aarch64 build ล่าสุด
    2. ใน สิ่งประดิษฐ์ ให้ดาวน์โหลดรูปภาพ
    3. Gzip รูปภาพ

      gzip Image
      
    4. คัดลอกไปที่ ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/

    5. สร้าง AOSP ใหม่และแฟลชอุปกรณ์ด้วย boot.img ใหม่ (ดูที่การ คอมไพล์ userspace )