Using OpenOCD JTAG in Android Kernel Debugging – Android Builder Summit 2012

Orange Pi Development Boards

Mike Anderson, CTO and Chief Scientist for The PTR Group, gives a tutorial about Linux kernel debugging in Android with OpenOCD JTAG at the Android Builder Summit in February 2012.

Abstract:

Owing to the use of the Linux kernel, Android device drivers can be debugged using many of the same techniques as Linux. Still, much of the user-space interface code typically found in Linux is missing in Android. This complicates the debugging of kernel driver code. This presentation will demonstrate the use of the open on-chip debug (OpenOCD) software and an inexpensive JTAG to debug Android kernel code. The target audience for this presentation are platform developers looking to debug their kernel code such as device drivers. This presentation is targeted at intermediate-level developers with some understanding of kernel code development.

You can also download the presentation slides on linuxfoundation.org website.

Support CNX Software - Donate via PayPal or become a Patron on Patreon

12
Leave a Reply

avatar
11 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
OpenOCD: Hardware Debugging and More – ELCE 2012josecnxsoft Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
jose
Guest

Just a newbie question guys.
Not actually about openocd but something similar.
I’m running android from adeneo release 4.2 on iMX53qsb and im using ubuntu image from freescale on a windows 7 machine.
When i issue a gdbserver command on the target it always says ‘[1] segmentation fault’ even just a simple/plain ‘gdbserver’
I’m using the jtagkey2p from Amontec and jlink from Segger but gdbserver still spits the same error.
Any help would be appreciated guys, Thank you so much.

jose
Guest

@ cnxsoft
But I’m using a prebuilt image from Adeneo so i assumed they issue a properly compiled gdbserver?

jose
Guest

@ cnxsoft
Whoever you are, thank you so much for the link and for the advice.
But would it be enough if i use this in kernel hacking/debugging and device driver development?

By the way do you also have a tutorial link about the emulator you’re using?
I’ve been trying to use QEMU so i can start working while waiting for the hardware but i can’t make it to work i actually don’t know how to use it and what options i should give.

jose
Guest

Thank you again ‘cnxsoft’.
Yah i just thought about that haha… I was thinking i can develop drivers using QEMU but it can’t simulate the GPIOs for the iMX platform right? Or is there a platform option that i can issue on QEMU so it can like simulate the platform’s pads or pins?
Sorry I’m assuming too much, this whole thing is so alien to me. I haven’t used any full-blown devkit, I’ve only used PIC MCUs and a simulator to test the output with the IDE to debug.
Could you advice me on what proper setup i should have without the hardware to dev. drivers? Or i couldn’t until i have the target with the JTAG?

jose
Guest

Thank you again cnxsoft, great help.
By the way best site for beginners like me.

jose
Guest

I’m trying OpenOCD-0.5.0 now and I have the jtagkey2p from Amontec.
I did this:
1. $ ./configure –enable-ft2232_libftdi
2. make
3. make install
4. sudo openocd -f ./tcl/interface/jtagkey2p.cfg -f ./tcl/target/imx53.cfg
5. I get this error

Error: The specified debug interface was not found (ft2232)
The following debug interfaces are available:
Runtime Error: ./tcl/interface/jtagkey2p.cfg:7:
in procedure ‘script’
at file “embedded:startup.tcl”, line 58
in procedure ‘interface’ called at file “./tcl/interface/jtagkey2p.cfg”, line 7

Now this is the inside of jtagkey2p.cfg
——– jtagkey2p.cfg ————————–
1. #
2. # Amontec JTAGkey2P
3. #
4. # http://www.amontec.com/jtagkey2p.shtml
5. #
6
7. interface ft2232
8. ft2232_device_desc “Amontec JTAGkey-2P”
9. ft2232_layout jtagkey
10. ft2232_vid_pid 0x0403 0xCFF8
———————————————–

Any comments guys?
Thanks in advance.

trackback

[…] slides are not available, but you may want to have a look at the presentation slides for “Using OpenOCD JTAG in Android Kernel Debugging” by Mike Anderson, the PTR group. The video in the previous link at very bad audio […]