This is a cache of https://discuss.96boards.org/t/attaching-op-tee-on-hikey-to-ds-5/437. It is a snapshot of the page at 2024-09-28T04:18:08.735+0000.
Attaching op-tee on hikey to DS-5 - HiKey - 96Boards Forum

Attaching op-tee on hikey to DS-5

I’m having trouble with attaching OP-TEE (tee.elf) and kernel (vmlinux) to ARM DS-5 (v5.23.1).

In DS-5 studio, my debug configuration is
– in Connection tab :
Cortex-A53x8 SMP (select target)
DSTREAM (target connection)
(I also sold the jtag on the board)

– in Debugger tab:
connect only (run contol)

          //execute debugger commnads (here I'm trying to load the symbols by using below commands...
          add-symbol-file samsung_iot\optee_os\out\arm-plat-hikey\core\tee.elf EL1S:0x0
          add-symbol-file samsung_iot\vmlinux EL1N:0x0

Currently, I connect J1-J2 and J5-J6 on Hikey board, so I can see the booting selection menu such as fastboot, boot from eMMC, boot from SD card…

I chose “boot from eMMC”, and I tried to connect the board during the UEFI is executing…
Sometimes, I see the error mesg (Unable to connect to device CSCTI_5) during connecting, but keep trying it, I connect to the board.

However, the only message I can see the commands window is “Target Message: Could not determine target state”. Also, I cannot pause the target. (When I tried to pause the core, it returns the msg “ERROR(TAD9-NAL90):
! Unable to stop device Cortex-A53x8 SMP, ! An unknown error was received.”

So I tried to attach the board with other debug configurations.
For example,
—in Files tab: I loaded vmlinux and tee.elf files with “Load symbols from file”
—in Debugger tab: I chose “Debug from entry point” or “Debug from sumbol :main”
with those configuration, when the board is booting, I can see the execution is stopped at some starting point of the source code. However, when I run (button) the board is failed to boot…

Please see the message---------------------------------------------------------------------
Signals handled by operating system
Stopping running target 96 Boards - HiKey on USB:005022 on connection
Connected to running target 96 Boards - HiKey on USB:005022
Execution stopped in EL1h mode at EL1N:0xFFFFFFC0000965C8
On core Cortex-A53_0 (ID 0)
EL1N:0xFFFFFFC0000965C8 RET
cd “C:\Users\ccs\Documents\DS-5 Workspace”
Working directory “C:\Users\ccs\Documents\DS-5 Workspace”
Execution stopped in EL1h mode at EL1N:0xFFFFFFC0000965C8
On core Cortex-A53_0 (ID 0)
EL1N:0xFFFFFFC0000965C8 RET
file “C:\Users\ccs\Documents\DS-5 Workspace\iot\vmlinux”
add-symbol-file “C:\Users\ccs\Documents\DS-5 Workspace\iot\optee_os\out\arm-plat-hikey\core\tee.elf”
WARNING(ROS60): Could not enable OS support as the OS does not appear to be initialized. This might be caused by a mismatch between the loaded symbols and the code on the target or because the OS is not up and running. Enabling OS support will be re-attempted when the target next stops.
directory “C:\Users\ccs\Documents\DS-5 Workspace\iot”
Source directories searched: C:\Users\ccs\Documents\DS-5 Workspace\iot;$cdir;$cwd
set debug-from *$ENTRYPOINT
start
Starting target with image C:\Users\jisjang\Documents\DS-5 Workspace\iot\vmlinux
Running from entry point
wait
WARNING(ROS60): Could not enable OS support as the OS does not appear to be initialized. This might be caused by a mismatch between the loaded symbols and the code on the target or because the OS is not up and running. Enabling OS support will be re-attempted when the target next stops.
Execution stopped in EL1h mode at EL1N:0xFFFFFFC000080000
On core Cortex-A53_0 (ID 0)
In head.S
EL1N:0xFFFFFFC000080000 112,0 add x13, x18, #0x16
hbreak -d -p *EL1N:0x000000003F000000
Hardware breakpoint 2 at EL1N:0x000000003F000000
on file generic_entry_a64.S, line 38
condition 2
break-script 2 “”
ignore 2 0
break-stop-on-cores 2
unsilence 2
Breakpoint 2 unsilenced
break-stop-on-vmid 2
run
Starting target with image C:\Users\jisjang\Documents\DS-5 Workspace\iot\vmlinux
Running from entry point
Execution stopped in EL1h mode at EL1N:0xFFFFFFC000080000
On core Cortex-A53_0 (ID 0)
EL1N:0xFFFFFFC000080000 112,0 add x13, x18, #0x16
Target Message: Could not determine target state
Target Message: Could not determine target state
Target Message: Could not determine target state
Target Message: Could not determine target state
Target Message: Could not determine target state
Target Message: Could not determine target state
Target Message: Could not determine target state


Hi,

Are you still having problems with this? I’m not familiar with DS-5 but afaik it will not support debugging OP-TEE on HiKey. I think the only available options currently are debug prints and JTAG. You can find some HiKey JTAG references here:

Thank you for your reply. Currently, I’m using OpenOCD & Flyswatter instead of DS-5. However, I still have some problem with printing ARM core registers such as CPSR, TTBR, and etc. In case of general registers, it works well.