This is a cache of It is a snapshot of the page at 2020-02-10T23:35:38.605+0000.
Building AOSP + OPTEE for Hikey 960 - HiKey 960 - 96Boards Forum

Building AOSP + OPTEE for Hikey 960


I am looking at the instructions on Given that OPTEE now has support for Hikey 960, I wanted to ask if the following steps would work for building Android + OPTEE for Hikey 960:

  1. Repo init:
    repo init -u -b android-8.1.0_r7 -g “default,-non-default,-device,hikey”

  2. Overlay:
    cd .repo
    git clone -b linaro-oreo local_manifests
    cd local_manifests
    rm -f swg.xml
    cd …/…/

  3. Sync: repo sync -j24

  4. repo manifest -r -o pinned-manifest.xml

  5. AOSP Patches:
    tar xzf arm-hikey960-OPR-cf4e0c80.tgz

  6. OPTEE patches:

  7. source ./build/

  8. lunch hikey960-userdebug

  9. Run AOSP Build:

    setprop sys.usb.configfs 1



No, the steps are for hikey620 and so will not work for hikey960.
Op-tee hasn’t been properly integrated into hikey960 aosp yet.
There are temporary instructions @ but the last time I tried, even though I was able to boot and run xtest to completion, there were constant errors scrolling on the console output similar to those in Don’t think those are op-tee related errors though.

I will try your suggested list of steps and let you know how it goes.

Thank you !

You’re welcome. Just a note of caution that even the regular (non-optee) hikey960 aosp components are still under constant development/improvement so please don’t expect this to have any semblance of a working condition similar to that of the hikey620 which is more mature.

I ran the following steps:

repo init -u -b master
cd .repo
git clone -b wip local_manifests
cd …
repo sync
tar xzf arm-hikey960-NOU-7ad3cccc.tgz

I use the following build script:

I am getting the compilation errors for fip.bin. The error began as shown below:

The compilation stopped showing the error below:

@vchong can you please check if you are also getting this error ? Do you know how to fix this build error ?

Thank you.

@vchong I tried to sync the branch again and tried a compilation using the steps mentioned above. I get the following error:

I wanted to ask if you have seen this error before and if you know how to fix it ?

Thank you

@a2t2 Yes sorry looks like the build is broken atm. I’ll try to get to it when possible but the priority is not high.

@vchong Okay. Let me know once its working. Thank you.

@at2t As a workaround, make below change and rebuild:

In external/optee_test/,
change LOCAL_CFLAGS += -g3
to LOCAL_CFLAGS += -g3 -Wno-error.

@at2t Even with above workaround there’s still another error so please wait for update.

@vchong Would it more stable to build if a particular branch number (like android 8.1) is used, instead of using the master branch ?

@at2t No. Not all 8.* branches/trees support hikey960. Even if some do, they’re not so ‘stable’ either. See for example.

@vchong Okay. I will wait till you get the build working. Thanks.

@a2t2 Sorry for the wait and thanks for your patience. Try adding below line to the bottom of the device/linaro/hikey/sepolicy/tee.te file and rebuild.

typeattribute tee_data_file core_data_file_type;

@a2t2 @vchong I’m wondering if this works now. I’d also like to build aosp and op-tee together for hikey960.

@steveyko tbh i haven’t tried the build since so i don’t really know, but my best guess is it’s too old to work now.

@vchong ok, thanks for your reply! How about the other post (OpTEE + Android in Hikey960)? Does that work? More specifically, what @rabindranath-derebac did (OpTEE + Android in Hikey960).

Hi@vchong, thanks for your work. Currently we are doing project that need build optee with Android. Hikey board is no longer available for purchasing and we had to choose Hikey960. But I tried every thread that tells how to port optee to Android but they all failed, either because code changed since the thread was posted and/or not correct branch/version that is not compatible. Can you post some instructions on how to port the optee to Android on Hikey960 with specific branch and version that works? Thank you very much!

@cheney One of our community users, @bensup, has kindly shared his implementations here: For those who are interested, please give it a try. There are some known issues so please contribute back patches if possible. A big thank you to @bensup! Thanks!

Thank you for your reply @vchong . I have tried his implementation and it works! Thank you @vchong @bensup .