ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 🧩 AllwinnerTech T507 Android BSP Build Guide
    Android BSP 2025. 10. 11. 00:11

    This post explains how to build the Android BSP for AllwinnerTech (AW) T507.
    Most BSPs distributed by Allwinner follow a very similar structure,
    so the same process can generally be used for other SoCs as well
    (except for SoC- or board-specific configurations).


    🧰 Recommended Build Environment

    • Operating System: Ubuntu 16.04 (officially recommended by AW)
    • SDK Folder Structure:
      • android/ → Android framework and AOSP sources
      • longan/ → U-Boot, kernel, device tree, and related build scripts

    ⚙️ 0. Install Required Packages

    Run the following commands to install all dependencies needed for the build.

    $ sudo apt-get install git-core gnupg flex bison gperf build-essential \
    zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
    lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
    libgl1-mesa-dev libxml2-utils xsltproc unzip
    
    $ sudo apt-get install u-boot-tools

     


    🚀 1. Build U-Boot

    (Option 1) Using build.sh

     
    $ cd longan/brandy/brandy-2.0
    $ ./build.sh -p sun50iw9p1

    (Option 2) Manual Build

     
    $ cd longan/brandy/brandy-2.0/u-boot-2018
    $ make distclean && make sun50iw9p1_config && make -j32

    🧩 2. Build the Kernel

    Run the configuration script to set the platform and board type.

     
    $ cd longan
    $ ./build.sh config

    Example Configuration Steps

    Welcome to mkscript setup progress
    All available platform:
      0. android
      1. linux
    Choice [android]: 0
    
    All available ic:
      t507
    Choice [t507]: 0
    
    All available board:
      0. demo
      ...
    Choice [demo]: 0

    After configuration, build the kernel:

     
    $ ./build.sh

    📱 3. Build Android

     
    $ cd android
    $ source build/envsetup.sh
    $ lunch

    You’ll see a list of available build targets.
    Choose the one matching your kernel board configuration, for example:

     
    33. mercury_demo-user
    34. mercury_demo-userdebug

    Select 34 (mercury_demo-userdebug).

     
    $ extract-bsp
    $ make installclean   # Run only once
    $ make -j8

    📦 4. Package the Final Image (pack)

    After building, package the OS into a single .img file using the pack tool.
    The available options control debug output and secure boot settings.

    $ pack          # Debug messages output via UART0
    $ pack -d       # Debug messages output via CARD0
    $ pack -v       # Enable security (signed image)
    $ pack -d -v    # Security enabled + CARD0 debug output
     

    💡 If secure boot isn’t required, a simple pack command is sufficient.


    🔐 Security Image Packaging

    If you’re building a secure image, you must generate encryption keys first:

     
    $ cd longan/build
    $ ./createkeys

    Without generating keys, pack will fail with a security-related error.


    ✅ Build Complete

    Once packaging is finished, you’ll get the final firmware image:

     
    t507_android10_demo_uart0.img

    You can now flash this image onto your board and boot it successfully 🎉


    🧩 Summary

    StepDescription
    0 Install required packages
    1 Build U-Boot
    2 Build kernel
    3 Build Android
    4 Package image (pack)

     

    댓글

Designed by Tistory.