Hi folks,
For anyone who is interested there is a open source OpenOCD / GDB WIP debug solution available for HiKey.
I've created a wiki page here https://github.com/96boards/documentation/wiki/JTAG-on-HiKey
Which documents the hardware setup, where you can get the code, and a overview of what is currently working.
Thanks to Philip Attfield who has already provided some patches to overcome several issues I was facing with read_memory and GDB config.
Please feel free to update the wiki page with any additional info you find out (thanks to Dan Thompson for already doing this), and patches making OpenOCD support for HiKey even better are most welcome :)
regards,
Peter.
Hi Peter & Philip,
JTAG works on my hikey platform. Great thanks for your work.
But it seems that there're still some issues on supporting aarch64.
1. After linux booted, I use "halt" command to stop kernel. Then use "reg" command. ===== arm v8 registers (34) x0 (/64): 0x0000000039613818 (dirty) (35) x1 (/64): 0x0000000000000066 (36) x2 (/64): 0x0000000000000039 (37) x3 (/64): 0x00000000004ACAC4 (38) x4 (/64): 0x0000000000000301 (39) x5 (/64): 0x0000000000BF0778 (40) x6 (/64): 0x0000000000BF3295 (41) x7 (/64): 0x00000000642D6973 (42) x8 (/64): 0x0000000065757165 (43) x9 (/64): 0x0000000000000000 (44) x10 (/64): 0x0000000000000006 (45) x11 (/64): 0x00000000000000EE (46) x12 (/64): 0x0000000030402070 (47) x13 (/64): 0x0000000000000006 (48) x14 (/64): 0x0000000030306632 (49) x15 (/64): 0x0000000000000003 (50) x16 (/64): 0x0000000000A4FCD0 (51) x17 (/64): 0x0000000000000004 (52) x18 (/64): 0x0000000000000001 (53) x19 (/64): 0x0000000000BF3290 (54) x20 (/64): 0x0000000000BF3296 (55) x21 (/64): 0x0000000039613818 (56) x22 (/64): 0x00000000004ACAC4 (57) x23 (/64): 0x00000000007F4000 (58) x24 (/64): 0x0000000000A21E00 (59) x25 (/64): 0x000000003D65B8F0 (60) x26 (/64): 0x0000000000BF2D30 (61) x27 (/64): 0x000000000000004E (62) x28 (/64): 0x0000000000000006 (63) x29 (/64): 0x000000003D2979D0 (64) x30 (/64): 0x00000000004A1028 (65) sp (/64): 0x000000003D2979D0 (66) pc (/64): 0x00000000004ACAD0 (67) CPSR (/32): 0x200000C5
PC value is wrong. I think that it should be 0xffffffc000xxxxxx.
2. Fail to resume after halting at linux kernel.
3. "virt2phys" command isn't supported.
4. How to load symbol table when I debug firmware or linux kernel?
Best Regards Haojian
Date: Fri, 31 Jul 2015 12:38:59 +0100 From: peter.griffin@linaro.org To: dev@lists.96boards.org CC: philip.attfield@linaro.org Subject: [Dev] HiKey and OpenOCD
Hi folks,
For anyone who is interested there is a open source OpenOCD / GDB WIP debug solution available for HiKey.
I've created a wiki page here https://github.com/96boards/documentation/wiki/JTAG-on-HiKey
Which documents the hardware setup, where you can get the code, and a overview of what is currently working.
Thanks to Philip Attfield who has already provided some patches to overcome several issues I was facing with read_memory and GDB config.
Please feel free to update the wiki page with any additional info you find out (thanks to Dan Thompson for already doing this), and patches making OpenOCD support for HiKey even better are most welcome :)
regards,
Peter.
_______________________________________________ Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev
On 09/08/15 11:06, Haojian Zhuang wrote:
Hi Peter & Philip,
JTAG works on my hikey platform. Great thanks for your work.
But it seems that there're still some issues on supporting aarch64.
- After linux booted, I use "halt" command to stop kernel. Then use
"reg" command. ===== arm v8 registers (34) x0 (/64): 0x0000000039613818 (dirty)
<snip> (65) sp (/64): 0x000000003D2979D0 (66) pc (/64): 0x00000000004ACAD0 (67) CPSR (/32): 0x200000C5
PC value is wrong. I think that it should be 0xffffffc000xxxxxx.
I believe the register view is chopping off the top 32-bits.
I *think*, based on some experiments I have done, that the low order bits are trustworthy so the register dump might still be useful for a *really* desperate developers who just want to know where the machine crashed.
There are more recent versions of the armv8 patches than the one Pete used. These correctly show the registers but are broken in other serious ways (for example will not halt the hikey).
As time permits I'll try to merge together the best of both builds but don't count on my finding the time...
- How to load symbol table when I debug firmware or linux kernel?
Use gdb for that (see gdbinit file in openocd-code). However with the register state broken I'd stick to assembler level debug for now...