OpTEE + Android in Hikey960

Yes, of course. I hope you’ll get better soon. I’ll re-post it next monday.

@tesmnorth Sorry for the delay and thank you for your patience!

Yes, you’re right about changing GCC49 to GCC5. I’ve made the changes so please do:

cd device/linaro/hikey
repo sync .
cd ../../../
rebuild

Were you able to resolve all the other (3?) issues you’d posted previously but later deleted?

@vchong welcome :). I hope you are well now.

I contined to build after changes. In %90, I took following error.(I couldnt resolve it by myself) But, I deleted it. Because, errors are mixed. sometimes we dont understand errors. So, I want to go step by step with you.

external/optee_test/host/xtest/regression_1000.c:1279: error: undefined reference to 'sdp_basic_test'
external/optee_test/host/xtest/regression_1000.c:1285: error: undefined reference to 'sdp_basic_test'
external/optee_test/host/xtest/regression_1000.c:1291: error: undefined reference to 'sdp_basic_test'
external/optee_test/host/xtest/regression_1000.c:1297: error: undefined reference to 'sdp_basic_test'
external/optee_test/host/xtest/aes_perf.c:277: error: undefined reference to 'allocate_ion_buffer'
external/optee_test/host/xtest/aes_perf.c:292: error: undefined reference to 'allocate_ion_buffer'
external/optee_test/host/xtest/xtest_main.c:100: error: undefined reference to 'sdp_basic_runner_cmd_parser'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
[ 90% 69369/76757] target Strip (mini debug info).../obj/EXECUTABLES/showslab_intermediates/showslab)
ninja: build stopped: subcommand failed.
22:45:12 ninja failed with: exit status 1

#### failed to build some targets (02:45:26 (hh:mm:ss)) ####

I hope you are well now.

Better. Thanks for asking!

I contined to build after changes. In %90, I took following error.(I couldnt resolve it by myself) But, I deleted it. Because, errors are mixed. sometimes we dont understand errors. So, I want to go step by step with you.

Yes, it’s not a good idea to continue building after errors, especially if you’re running parallel builds. Better to check the errors one by one.

Wrt error above, I forgot the kernel doesn’t support SDP so we need to disable it in the build command. Please try again with:

make TARGET_BUILD_UEFI=true TARGET_TEE_IS_OPTEE=true CFG_SECURE_DATA_PATH=n

ok, I am trying again. After flashing to Hikey960, we work on optee errors from xtest output?

yes but let’s cross that bridge when we get there ;s

@vchong Building is ok. While using cc comand, I took this error: ../../../device/linaro/l-loader/cc: 225: ../../../device/linaro/l-loader/cc: abootimg: not found. So, I installed abootimg with sudo apt-get install abootimg
Then, while flashing:
Just waiting with following log:

$ sudo ./flash-all.sh 
android out dir:./../../../../..//out/target/product/hikey960
target reported max download size of 134217728 bytes
sending 'ptable' (24 KB)...

Did you put the board in fastboot/recovery mode first? See https://github.com/96boards-hikey/tools-images-hikey960 and https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-ATF-UEFI-build-from-source.md.

Like hikey board, you should be able to see the board serial id when running fastboot devices on your PC, before you run the flash-all.sh script.

I think, I need to do everything in two links?

Yes, I see board serial when running fastboot devices.

I need to do everything in two links?

No. Just make sure you have the correct dip switch settings (1 and 3 on, 2 off). The flash-all.sh script is basically just the list of flash commands found in those 2 links.

Yes, I see board serial when running fastboot devices.

In that case you should be able to go ahead and flash images. Maybe try each of the fastboot flash commands at the bottom of flash-all.sh one by one manually first to verify that the fastboot flash command actually works.

If it doesn’t work, you might have to try going through recovery mode, in which case those 2 links above will show you how to run the hikey_idt command for recovery.

$ sudo ./flash-all.sh 
android out dir:./../../../../..//out/target/product/hikey960
target reported max download size of 471859200 bytes
sending 'ptable' (24 KB)...
OKAY [  0.007s]
writing 'ptable'...
OKAY [  0.025s]
finished. total time: 0.032s
target reported max download size of 471859200 bytes
error: cannot load './sec_xloader.img': No such file or directory

target reported max download size of 471859200 bytes
sending 'fastboot' (1056 KB)...
OKAY [  0.034s]
writing 'fastboot'...
OKAY [  0.017s]
finished. total time: 0.051s
target reported max download size of 471859200 bytes
sending 'fip' (1474 KB)...
OKAY [  0.047s]
writing 'fip'...
OKAY [  0.021s]
finished. total time: 0.068s
target reported max download size of 471859200 bytes
sending 'boot' (21504 KB)...
OKAY [  0.587s]
writing 'boot'...
OKAY [  0.143s]
finished. total time: 0.730s
target reported max download size of 471859200 bytes
sending 'cache' (56 KB)...
OKAY [  0.008s]
writing 'cache'...
OKAY [  0.054s]
finished. total time: 0.063s
target reported max download size of 471859200 bytes
sending 'userdata' (4888 KB)...
OKAY [  0.129s]
writing 'userdata'...
OKAY [  1.712s]
finished. total time: 1.841s
target reported max download size of 471859200 bytes
sending sparse 'system' (460796 KB)...
OKAY [ 12.290s]
writing 'system'...
OKAY [  3.318s]
sending sparse 'system' (421200 KB)...
OKAY [ 10.884s]
writing 'system'...
OKAY [  2.667s]
sending sparse 'system' (115176 KB)...
OKAY [  2.992s]
writing 'system'...
OKAY [  0.748s]
finished. total time: 32.900s

I think, there is no sec_xloader.img in building out. But I have hisi-sec_xloader.img

I think, there is no sec_xloader.img in building out. But I have hisi-sec_xloader.img

No, don’t use hisi-sec_xloader.img. It’s old. Please use the one in device/linaro/tools-images-hikey960. Copy it to the installer/hikey960 folder so you can run the script without errors. Thanks.

Then, sec_xloader.img is already exiting image. Because, after building and cc command, sec_xloader.img didnt create.

I copied it and flashing without error. Then, I just switched switch 1 as on. But, HiKey is not working. not booting not any light.

Yes it’s an existing image. No need to build.

Hikey or hikey960 not working? Please be clear.

Do you have console cable to look at the boot logs?

Sorry, it means hikey960.

Did you mean UART module or UART cable?

Yes, UART module or cable.

I ordered it yesterday from China. I think, I’ll receive it after December,1. :frowning:

@vchong until waiting UART module, Can I say mention what I want to do with OPTEE?