https://elinux.org/api.php?action=feedcontributions&user=Guil&feedformat=atomeLinux.org - User contributions [en]2024-03-19T01:43:25ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=Profilers&diff=86120Profilers2012-01-18T12:24:48Z<p>Guil: </p>
<hr />
<div>Linux systems count with a wide variety of profilers each of with their pros and cons, there is no magic bullet, it's recommended to use more than one tool when analyzing your application, I recommend you to use at least OProfile and Valgrind.<br />
<br />
== OProfile ==<br />
<br />
[http://oprofile.sourceforge.net/about OProfile] is a non-obtrusive system-wide profiler for Linux, it can use system's performance counters to give you insights on where to optimize your code.<br />
<br />
Helper script for simple runs (remember to run <code>opcontrol --setup ...</code> once before this script):<br />
<br />
#!/bin/sh<br />
sudo opcontrol --init<br />
sudo opcontrol --start<br />
sudo opcontrol --dump<br />
sudo opcontrol --reset<br />
$@<br />
sudo opcontrol --stop<br />
opreport --symbols > oprof.txt<br />
<br />
see also [http://oprofile.sourceforge.net/doc/oprofile-gui.html oprof_start]<br />
<br />
=== User Interfaces ===<br />
<br />
==== oprof_start ====<br />
<br />
Qt3 GUI for OProfile, ships in official distribution, see http://oprofile.sourceforge.net/doc/oprofile-gui.html<br />
<br />
==== KCachegrind ====<br />
<br />
One can use reports that are usable by kcachegrind with (for more instruction see http://docs.kde.org/kde3/en/kdesdk/kcachegrind/using-kcachegrind.html): <br />
<br />
opreport -gdf | op2callgrind <br />
<br />
==== OProfileUI ====<br />
<br />
Another useful application is [http://labs.o-hand.com/oprofileui/ OProfileUI], it provides a GTK+2 user interface to run and show statistics, including basic call graph.<br />
<br />
=== Documentation ===<br />
<br />
In depth explanation can be found at:<br />
* [http://www-128.ibm.com/developerworks/linux/library/l-oprof.html IBM DeveloperWorks]<br />
* [http://oprofile.sourceforge.net/doc/index.html OProfile Manual]<br />
* [http://oprofile.sourceforge.net/faq/ OProfile FAQ]<br />
<br />
=== Caveats ===<br />
<br />
* JFFS2 does not provide OProfile requirements, running OProfile to output data into JFFS2 partition will fail, instead use a ramfs or some external card with ext2/3:<br />
mkdir /var/lib/oprofile<br />
# ram<br />
mount -t ramfs none /var/lib/oprofile<br />
# ext3<br />
mount -t ext3 /dev/sda1 /var/lib/oprofile<br />
* settings event counter too low or too high may hang your test machine. Check the recommended value for each event on specific platforms.<br />
<br />
<br />
== GProf ==<br />
<br />
Unlike OProfile, GProf requires applications to be compiled with special flag <code>-pg</code> so compiler will introduce marks in generated binary to measure runs. After run the <code>gmon.out</code> file will be created with measured data, this file can be viewed with tools like gprof or kprof.<br />
<br />
=== User Interfaces ===<br />
<br />
==== KProf ====<br />
<br />
Outdated, but exists: http://kprof.sourceforge.net/<br />
<br />
=== Documentation ===<br />
<br />
* [http://sourceware.org/binutils/docs/gprof/index.html GProf Manual]<br />
<br />
=== Caveats ===<br />
<br />
* Imprecise<br />
* Huge overhead<br />
<br />
== ARM Streamline ==<br />
<br />
[http://www.arm.com/streamline ARM Streamline] is a commercial sample-based system performance analyzer which brings together performance counters from the core(s) and OS, time- and event-based profiling, context switch tracepoints, and instrumented messages (like printf) to provide developers with a system-to-instruction drill-down ability.<br />
<br />
Streamline is a component of the ARM DS-5 suite, which has a [http://www.arm.com/products/tools/software-tools/ds-5/ds-5-downloads.php 30-day evaluation] version available for download. <br />
<br />
<br />
== Valgrind Cachegrind/Callgrind ==<br />
<br />
[http://valgrind.org/info/about.html Valgrind] is tool suite for debugging and profiling. It's most famous for it's '''memcheck''' tool to check for memory leaks, invalid access, double frees and more, but also ships with interesting callgrind and cachegrind.<br />
<br />
'''cachegrind''' will accurately simulate L1, L2 and D1 CPU caches so you can figure out what in your code is trashing your memory access.<br />
<br />
'''callgrind''' is an extension of cachegrind that will collect call graphs.<br />
<br />
=== User Interfaces ===<br />
<br />
==== KCachegrind ====<br />
The most famous user interface is [http://kcachegrind.sourceforge.net/cgi-bin/show.cgi/KcacheGrindIndex KCachegrind]<br />
<br />
=== Documentation ===<br />
<br />
* [[Valgrind|Valgrind information in this wiki]]<br />
* [http://valgrind.org/docs/manual/manual.html Valgrind Manual]<br />
* [http://valgrind.org/docs/manual/FAQ.html FAQ]<br />
* http://docs.kde.org/kde3/en/kdesdk/kcachegrind/using-kcachegrind.html<br />
<br />
=== Caveats ===<br />
<br />
* Since these are simulators, your application will run very slow, from 20 to 100 times or more.<br />
<br />
[[Category:Tools]]</div>Guilhttps://elinux.org/index.php?title=JTAG&diff=86072JTAG2012-01-18T12:09:10Z<p>Guil: /* Hardware (emulators) */</p>
<hr />
<div>Joint Test Action Group, referring to IEEE Standard 1149.1: Four-pin (plus power/ground) interface designed to test connections between chips. Interface is serial (clocked via the TCK pin). Configuration is performed by manipulating a state machine one bit at a time (via TMS pin), then transferring one bit of data in and out per TCK clock (via TDI and TDO pins, respectively). Different instruction modes can be loaded to read the chip ID, sample input pins, drive (or float) output pins, manipulate chip functions, or bypass (pipe TDI to TDO to logically shorten chains of multiple chips). Operating frequency varies per chip, but is typically 10-100MHz TCK (10-100ns per bit time). The description of how JTAG is implemented for a specific device is described in a file specific to that device called a [[BSDL]] file.<br />
<br />
=== Information ===<br />
* http://en.wikipedia.org/wiki/JTAG<br />
* http://www.asset-intertech.com/products/free_resources.htm - various resources<br />
* [http://www.openjtag.net openjtag wiki]<br />
* [[media:JTAGpinouts.pdf|Common JTAG Pinouts]]<br />
* [http://www.macraigor.com/jscan.htm Macraigor JSCAN]<br />
* [http://www.eetimes.com/design/embedded-internet-design/4019860/JTAG-101--Part-1-Overview-and-On-Chip-Debug-Methods Overview of On Chip Debug Methods]<br />
* [http://www.gojtag.com/ gojtag] - needs to be ported to Linux<br />
<br />
=== Tutorial ===<br />
[[Media:boundryscan_tutorial.pdf|Tutorial from Asset Intertech]]<br />
<br />
[http://tree.celinuxforum.org/CelfPubWiki/ELC2009Presentations?action=AttachFile&do=get&target=DebuggingWithJtagCelf2009.pdf Embedded Linux JTAG debugging (CELF presentation)]<br />
<br />
=== Hardware (emulators) ===<br />
* [[Holly Gates]] wiggler - Parallel Port<br />
* [[Cheap Tag]] 5v only parallel port<br />
* [[Flyswatter]]- USB<br />
* [http://www.arm.com/ds5 ARM DS-5] - DS-5 and DSTREAM provide embedded Linux developers with a full professional development suite<br />
* [http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice gnICE] - USB w/full schematics<br />
* [http://www.section5.ch/icebear ICEbear JTAG] - USB<br />
* [http://www.renaelectronics.com/2007Fall/product_x_cable.htm JTAG Blue] - Parallel Port<br />
* http://wiki.openwrt.org/JTAG_Cables<br />
* http://hri.sourceforge.net/tools/ - Macraigor compatible wiggler<br />
* http://www.sparkfun.com/shop/index.php?shop=1&cart=201362&cat=74&<br />
* http://www.ocdemon.net/hwproducts.htm - $150-$1800 par,usb,serial,ethernet<br />
* http://www.dlpdesign.com/usb/2232m.shtml - USB module<br />
* http://www.corelis.com/products/index.htm - Emulators, Testing and Programming<br />
* http://www.amontec.com/jtagkey.shtml - USB<br />
* http://www.sparkfun.com/commerce/product_info.php?products_id=7834 - USB<br />
* http://www.ronetix.at/peedi.html - JTAG/BDM Emulator and Flash Programmer<br />
* http://www.mentor.com/products/embedded_software/majic-jtag-probe/ - JTAG Emulator, Flash Programmer, Hardware Bring-up<br />
* [http://www.armkits.com/Product/unetice.asp Embest UNetICE] - USB and Ethernet based JTAG Emualtor for ARM7 and ARM9 processors<br />
* [http://www.armkits.com/Product/xds100.asp XDS100v2] - USB JTAG emulator for TI processor available from [http://www.armkits.com Embest]<br />
<br />
=== Tools ===<br />
* [[JTAG_Finder]]<br />
* [[UsingJtagTools]]<br />
* http://openwince.sourceforge.net/jtag/<br />
* http://fjtag.sourceforge.net/<br />
* http://jtagtools.sourceforge.net/<br />
* http://www.lart.tudelft.nl/projects/jtag/jflash-linux.tar.gz<br />
* http://lapwww.epfl.ch/dev/arm/jelie/index.php<br />
* http://cvs.arm.linux.org.uk/cgi/viewcvs.cgi/jtag/<br />
* http://jtager.sourceforge.net/<br />
* http://openocd.berlios.de/web/<br />
* http://urjtag.org/<br />
* http://opencollector.org database contains a list of opensource JTAG SW tools<br />
<br />
[[Category:Development Tools]]</div>Guilhttps://elinux.org/index.php?title=JTAG&diff=86066JTAG2012-01-18T12:08:45Z<p>Guil: /* Hardware (emulators) */</p>
<hr />
<div>Joint Test Action Group, referring to IEEE Standard 1149.1: Four-pin (plus power/ground) interface designed to test connections between chips. Interface is serial (clocked via the TCK pin). Configuration is performed by manipulating a state machine one bit at a time (via TMS pin), then transferring one bit of data in and out per TCK clock (via TDI and TDO pins, respectively). Different instruction modes can be loaded to read the chip ID, sample input pins, drive (or float) output pins, manipulate chip functions, or bypass (pipe TDI to TDO to logically shorten chains of multiple chips). Operating frequency varies per chip, but is typically 10-100MHz TCK (10-100ns per bit time). The description of how JTAG is implemented for a specific device is described in a file specific to that device called a [[BSDL]] file.<br />
<br />
=== Information ===<br />
* http://en.wikipedia.org/wiki/JTAG<br />
* http://www.asset-intertech.com/products/free_resources.htm - various resources<br />
* [http://www.openjtag.net openjtag wiki]<br />
* [[media:JTAGpinouts.pdf|Common JTAG Pinouts]]<br />
* [http://www.macraigor.com/jscan.htm Macraigor JSCAN]<br />
* [http://www.eetimes.com/design/embedded-internet-design/4019860/JTAG-101--Part-1-Overview-and-On-Chip-Debug-Methods Overview of On Chip Debug Methods]<br />
* [http://www.gojtag.com/ gojtag] - needs to be ported to Linux<br />
<br />
=== Tutorial ===<br />
[[Media:boundryscan_tutorial.pdf|Tutorial from Asset Intertech]]<br />
<br />
[http://tree.celinuxforum.org/CelfPubWiki/ELC2009Presentations?action=AttachFile&do=get&target=DebuggingWithJtagCelf2009.pdf Embedded Linux JTAG debugging (CELF presentation)]<br />
<br />
=== Hardware (emulators) ===<br />
* [[Holly Gates]] wiggler - Parallel Port<br />
* [[Cheap Tag]] 5v only parallel port<br />
* [[Flyswatter]]- USB<br />
* [http://www.arm.com/ds5 ARM DS-5] - DS-5 and DSTREAM provide embedded Linux developers with a full professional development suite including Linux-aware JTAG debugger, 4GB non-intrusive trace buffer, the ARM Compiler, accurate ARM virtual platforms, and [http://www.arm.com/streamline Streamline performance analyzer] for Linux<br />
* [http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice gnICE] - USB w/full schematics<br />
* [http://www.section5.ch/icebear ICEbear JTAG] - USB<br />
* [http://www.renaelectronics.com/2007Fall/product_x_cable.htm JTAG Blue] - Parallel Port<br />
* http://wiki.openwrt.org/JTAG_Cables<br />
* http://hri.sourceforge.net/tools/ - Macraigor compatible wiggler<br />
* http://www.sparkfun.com/shop/index.php?shop=1&cart=201362&cat=74&<br />
* http://www.ocdemon.net/hwproducts.htm - $150-$1800 par,usb,serial,ethernet<br />
* http://www.dlpdesign.com/usb/2232m.shtml - USB module<br />
* http://www.corelis.com/products/index.htm - Emulators, Testing and Programming<br />
* http://www.amontec.com/jtagkey.shtml - USB<br />
* http://www.sparkfun.com/commerce/product_info.php?products_id=7834 - USB<br />
* http://www.ronetix.at/peedi.html - JTAG/BDM Emulator and Flash Programmer<br />
* http://www.mentor.com/products/embedded_software/majic-jtag-probe/ - JTAG Emulator, Flash Programmer, Hardware Bring-up<br />
* [http://www.armkits.com/Product/unetice.asp Embest UNetICE] - USB and Ethernet based JTAG Emualtor for ARM7 and ARM9 processors<br />
* [http://www.armkits.com/Product/xds100.asp XDS100v2] - USB JTAG emulator for TI processor available from [http://www.armkits.com Embest]<br />
<br />
=== Tools ===<br />
* [[JTAG_Finder]]<br />
* [[UsingJtagTools]]<br />
* http://openwince.sourceforge.net/jtag/<br />
* http://fjtag.sourceforge.net/<br />
* http://jtagtools.sourceforge.net/<br />
* http://www.lart.tudelft.nl/projects/jtag/jflash-linux.tar.gz<br />
* http://lapwww.epfl.ch/dev/arm/jelie/index.php<br />
* http://cvs.arm.linux.org.uk/cgi/viewcvs.cgi/jtag/<br />
* http://jtager.sourceforge.net/<br />
* http://openocd.berlios.de/web/<br />
* http://urjtag.org/<br />
* http://opencollector.org database contains a list of opensource JTAG SW tools<br />
<br />
[[Category:Development Tools]]</div>Guilhttps://elinux.org/index.php?title=ARMCompilers&diff=86042ARMCompilers2012-01-18T12:01:38Z<p>Guil: /* The ARM Compiler (formerly RVCT) */</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
This page is about compilers ([[Toolchains|toolchains]]) for ARM (Linux) based boards, mainly focussed to [[BeagleBoard#Cortex_A8_ARM_features|ARM Cortex A8]] on [[BeagleBoard]].<br />
<br />
== GCC compiler ==<br />
<br />
=== Recommendations ===<br />
[http://www.codesourcery.com/ CodeSourcery] [http://www.codesourcery.com/gnu_toolchains/arm/download.html '''ARM GNU/Linux''' tool chain] is the version with the support for the latest ARM architecture. Mainline [http://gcc.gnu.org/ gcc] also has stable ARM support. Enhancements are made in the Codesourcery version first, and are then pushed back to mainline.<br />
<br />
As of August 2009, [http://www.codesourcery.com/sgpp/lite/arm/portal/release858 2009q1-203 version] is recommended. If you look for native tool chain, you can also install a native tool-chain from Angstrom. More recent versions from 2011 (such as [http://www.codesourcery.com/sgpp/lite/arm/portal/release1803 2011.03-41 version]) should work just fine as well.<br />
<br />
Note: If you will use only [[BeagleBoardAndOpenEmbeddedGit|OpenEmbedded (OE)]] to build code for your Beagle, you don't need to download the CodeSourcery compiler. OE builds a cross-compiler from source as part of the bitbake process.<br />
<br />
The [http://free-electrons.com/blog/beagle-labs/ Free Electrons] Beagle [http://free-electrons.com/doc/training/beagle/labs.pdf training material] uses [http://ymorin.is-a-geek.org/projects/crosstool Crosstool-ng].<br />
<br />
=== Limitations===<br />
<br />
Note: Some users report problems using Linux installer version. If installer doesn't work for you, download tar version (section ''Advanced Packages''), copy extracted ''arm-2007q3'' directory to ''/opt/codesourcery/arm-none-linux-gnueabi/'' and add ''/opt/codesourcery/arm-none-linux-gnueabi/arm-2007q3/bin'' to your path.<br />
<br />
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3 2007q3] has the following issues:<br />
** Broken -Os option. There is a [http://groups.google.com/group/beagleboard/msg/d4170b16029920ee fix] (needs recompilation)<br />
** Started to [http://marc.info/?l=linux-omap&m=123878607426122&w=2 miscompile Linux kernel] with >= ~2.6.29 ([http://marc.info/?l=linux-omap&m=124027585911690&w=2 analysis by Richard Woodruff]) ([http://marc.info/?l=linux-omap&m=124267322526315&w=2 disabling ARM_UNWIND solves it]).<br />
<br />
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3? 2008q1] has the following issues:<br />
** Vectorization + NEON is broken<br />
** building static binaries with cortex-a8 flag (or any ARMv7a core) is broken<br />
** some armv6 compilations end in ICE.<br />
<br />
* Note: CodeSourcery 2008q3 (now replaced by 2008q3-72) has the following issues:<br />
** [http://hardwarebug.org/2008/10/11/codesourcery-gcc-2008q3-fail/ Broken NEON] support using ''-fmpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -O3''<br />
** It was told to [http://www.beagleboard.org/irclogs/index.php?date=2008-10-11#T20:32:17 miscompile] U-Boot, but this seems to be fixed with recent [[BeagleBoard#U-Boot|U-Boot]] and 2008q3-72 below.<br />
<br />
* Note: CodeSourcery 2008q3-72 has the following issues:<br />
** See [http://hardwarebug.org/2008/11/28/codesourcery-fails-again/ small problem with vectorization].<br />
<br />
* Note: CodeSourcery 2009q1 has the following issues:<br />
** Floating-point code can be slower than with 2007q3, see [http://hardwarebug.org/2009/08/05/arm-compiler-shoot-out/ FFmpeg benchmarks].<br />
<br />
== GDB debugger ==<br />
<br />
gdb supports native debug or 'gdbserver' remote debug. For debug support for VFPv3 and NEON, you must use the 'gdbserver' approach - see [http://groups.google.com/group/beagleboard/browse_thread/thread/4b0e82be1e106242 How to enable VFPv3/NEON debug].<br />
<br />
== The ARM Compiler (formerly RVCT) ==<br />
<br />
ARM has the [http://www.arm.com/ds5 Development Studio 5 (DS-5)], which contains the ARM reference compiler. A 30-day [http://www.arm.com/ds5 evaluation version] is available for download.<br />
<br />
The ARM Compiler toolchain can be used to generate Linux applications and shared-libraries and is generally highly compatible with GCC. It also bundles the industry leading vectorizing compiler for [http://www.arm.com/products/processors/technologies/neon.php ARM NEON-]enabled devices.<br />
<br />
[[Category:Compiler]]</div>Guilhttps://elinux.org/index.php?title=BeagleBoardJTAG&diff=86024BeagleBoardJTAG2012-01-18T11:52:14Z<p>Guil: /* ARM Development Studio 5 (DS-5™) */</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
[[Category:Development Boards]]<br />
[[Category: BeagleBoard]]<br />
The page is about [http://en.wikipedia.org/wiki/JTAG JTAG] on OMAP3530 used at [[BeagleBoard|BeagleBoard]].<br />
<br />
=Beagle JTAG connection=<br />
The [[BeagleBoard]] comes with a 14 pin [[JTAG-TI|TI JTAG]] connector. For JTAG pin out see section 8.16 of [http://www.beagleboard.org/uploads/Beagle_HW_Reference_Manual_B_5.pdf BeagleBoard HW Reference Manual (rev. B5)]. This is the same header interface as used in other TI products and is ''NOT'' the standard 14 pin ARM layout. Depending on your JTAG tool, you'd need a [[JTAG-TI|20-pin to 14-pin TI adapter]].<br />
<br />
'''Attention: JTAG on BeagleBoard uses 1.8V!'''<br />
<br />
The 14-pin TI JTAG connector that is used on BeagleBoard is supported by a large number of JTAG emulation products and has been tested using Lauterbach, Green Hills, Spectrum Digital XDS510USB+ and TI XDS560 emulation pods. Note that it will not work with the Spectrum Digital XDS510USB (non-plus) as it does not support a target with 1.8V JTAG.<br />
<br />
The following picture is from a [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation]:<br />
<br />
[[Image:Ti arm jtag.jpg]]<br />
<br />
Beagle uses the 14-pin TI header.<br />
<br />
Note: TI uses some different pin names. Translation:<br />
* TVD => VREF at Beagle<br />
* TCLKR == RTCK<br />
* TCLKO == TCK<br />
* #### == Key (empty))<br />
* TDIS => GND at Beagle<br />
<br />
See [[OMAP3530_ICEPICK|ICEPICK configuration page]] for more details about how OMAP3 JTAG hardware needs to be configured.<br />
<br />
== Beagle adapter ==<br />
The [[BeagleBoardJTAG#TinCanTools_Flyswatter|Flyswatter]] we plan to use has a 14 pin ARM layout, so we need to create a converter. From [http://www.tincantools.com/assets/JTAG_pin_assignments.pdf JTAG pin assignments] document:<br />
<br />
''' ARM-14-JTAG TI-14-JTAG'''<br />
<br />
VREF 1 - - 2 GND JTAG_TMS 1 - - 2 JTAG_nTRST<br />
JTAG_nTRST 3 - - 4 GND JTAG_TDI 3 - - 4 GND<br />
JTAG_TDI 5 - - 6 GND VREF 5 - x 6 KEY (empty)<br />
JTAG_TMS 7 - - 8 GND JTAG_TDO 7 - - 8 GND<br />
JTAG_TCK 9 - - 10 GND JTAG_RTCK 9 - - 10 GND<br />
JTAG_TDO 11 - - 12 JTAG_SRST_N JTAG_TCK 11 - - 12 GND<br />
VREF 13 - - 14 GND JTAG_EMU0 13 - - 14 JTAG_EMU1<br />
FlySwatter TOP Beagle<br />
<br />
See [[media:flyswatter-ti-jtag.pdf|14 pin ARM to TI adapter]] for a verified JTAG adapter from [http://www.tincantools.com/ TinCanTools].<br />
<br />
* [http://tincantools.com/product.php?productid=16144 TinCanTools BeagleBoard Adapter Kit]<br />
* Nishanth Menon's [http://www.flickr.com/photos/nishanthmenon/2814595201/in/pool-beagleboard adapter] with explanation and [http://nishanthmenon.blogspot.com/2008/08/low-cost-jtag-for-beagle.html Nishanth's blog]<br />
* Lauterbach [http://www.lauterbach.com/frames.html?ord__7748.html JTAG converter to TI Target Adapter 14] (LA-7748) ([[media:Jtag-ti-front.jpg|front]] & [[media:Jtag-ti-back.jpg|back]])<br />
* [http://www.flickr.com/photos/51025379@N00/2822556950/in/photostream/ xdaiabx adapter]<br />
<br />
= Open source JTAG software= <br />
It would be very interesting to get the JTAG working with open source tools. The main open source JTAG software is [http://openocd.berlios.de/web/ OpenOCD]. See [[BeagleBoardOpenOCD|Beagle board OpenOCD page]] about status and usage of OpenOCD for Beagle.<br />
<br />
=JTAG hardware=<br />
<br />
For BeagleBoard JTAG debugging, there are some HW interfaces available. Each is covered below.<br />
<br />
==TinCanTools Flyswatter2==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a new JTAG debugger at [http://www.tincantools.com/product.php?productid=16153&cat=0&page=1&featured Flyswatter2] that has support for OpenOCD and ARM Cortex A8 processors: OMAP3530 BeagleBoard and DM3730 BeagleBoard-xM. The Flyswatter2 is 5 to 10 times faster than the original Flyswatter. <br />
<br />
They also have a [http://www.tincantools.com/product.php?productid=16154&cat=251&page=1 ARM20TI14 JTAG Adapter]. This JTAG adapter board works with the BeagleBoard and BeagleBoard-xM.<br />
<br />
The Flyswatter2 can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
==TinCanTools Flyswatter==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a working JTAG debugger at [http://www.tincantools.com/product.php?productid=16134&cat=0&page=1&featured Flyswatter] that has support for OpenOCD and the OMAP3530 (ARM Cortex A8). They also have a [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit].<br />
<br />
Costs:<br />
<br />
In case you like to order Flyswatter and Adapter Kit international, here an example for Europe (Germany):<br />
<br />
* Flyswatter: US-$ 49.95<br />
* BeagleBoard Adapter Kit: US-$ 18.00<br />
* International shipping: US-$ 27.00 (select USPS, it's the cheapest!)<br />
* Video about using Flyswatter with BeagleBoard<br />
<br />
Sum: US-$ 94.95 => EUR 65.28 + EUR 8.76 VAT (Germany) = EUR 74.04<br />
<br />
Flyswatter can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
'''Attention''': If you use [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit], make sure you plug the JTAG adapter the correct way. There are several possible ways, though. See [http://www.tincantools.com/images/D/Fly%2BBeagle-800x391.JPG?1229714946602 connection picture] how to do it the right way (in contrast to the picture EMU0 & EMU1 jumpers at JTAG adapter should be both at 1-2 position (touching J2) because EMU0 and EMU1 must be set in order for the ICEpick JTAG TAP router within the DM37x to be the only device exposed after power on, which is what OpenOCD expects to see).<br />
<br />
==BDI 2000==<br />
<br />
===Example===<br />
<br />
[http://groups.google.com/group/beagleboard/msg/8463086de562ee00 Chuck Fleming] reports:<br />
<br />
The BDI2000 appears to work with the omap35xx.cfg and regOMAP3500.def files that come with the BDI hardware. I had to modify the 10-pin cable so that the BeagleBoard JTAG header matched the BDI target A connector:<br />
<br />
beagle>reset<br />
- TARGET: processing reset request<br />
- TARGET: BDI executes scan chain init string<br />
- TARGET: Bypass check 0x00000001 => 0x00000002<br />
- TARGET: JTAG exists check passed<br />
- Core#0: ID code is 0x0B6D602F<br />
- Core#0: DP-CSW is 0xF0000000<br />
- Core#0: DBG-AP at 0xD4011000<br />
- Core#0: DIDR is 0x15141012<br />
- TARGET: BDI removes RESET<br />
- TARGET: BDI waits for RESET inactive<br />
- TARGET: Reset sequence passed<br />
- TARGET: resetting target passed<br />
- TARGET: processing target startup ....<br />
- TARGET: processing target startup passed<br />
beagle>halt<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Debug Request<br />
Current PC : 0x40200000<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>rdall<br />
User FIQ Superv Abort IRQ Undef<br />
GPR00: 480029fc 480029fc 480029fc 480029fc 480029fc 480029fc<br />
GPR01: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR02: 00000001 00000001 00000001 00000001 00000001 00000001<br />
GPR03: 00000060 00000060 00000060 00000060 00000060 00000060<br />
GPR04: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR05: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR06: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR07: 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88<br />
GPR08: 80e3ffdc 34484608 80e3ffdc 80e3ffdc 80e3ffdc 80e3ffdc<br />
GPR09: 80e3fec8 26a1c132 80e3fec8 80e3fec8 80e3fec8 80e3fec8<br />
GPR10: 00000018 08040f16 00000018 00000018 00000018 00000018<br />
GPR11: 80e3fecc 3c278260 80e3fecc 80e3fecc 80e3fecc 80e3fecc<br />
GPR12: 0000006e 24200625 0000006e 0000006e 0000006e 0000006e<br />
GPR13: 00000000 00000000 80e3feb0 00000000 00000000 d1868045<br />
GPR14: 00000000 00000000 80e84f44 00000000 00000000 d55a4cc8<br />
PC : 40200000<br />
CPSR : 000001d3<br />
SPSR : 00000000 00000000 00000000 00000000 00000000<br />
beagle>md 0x40200000<br />
40200000 : e320f000 e320f000 e320f000 e320f000 .. ... ... ... .<br />
40200010 : e320f000 e320f000 e320f000 eafffffc .. ... ... .....<br />
40200020 : b6273502 e7aa052b 047694c8 91ca77d8 .5'.+.....v..w..<br />
40200030 : 12b9579e ef2eef1b 00543892 494f9bc1 .W.......8T...OI<br />
40200040 : 3f63013d 82eee656 b7adfe8d 993f1368 =.c?V.......h.?.<br />
40200050 : 51f1cf9b 0464a23e bea76e3c 3d275f5c ...Q>.d.<n..\_'=<br />
40200060 : 76554290 6776c892 a6cd088f 6dd4529a .BUv..vg.....R.m<br />
40200070 : 067261b8 e5f80e9e cb4ea075 25a9dd95 .ar.....u.N....%<br />
40200080 : 779db8c6 0496597b 7d5f8d5a 24f44cd6 ...w{Y..Z._}.L.$<br />
40200090 : 99ab46f9 9ddc06d9 fd34567a 2035bab8 .F......zV4...5<br />
402000a0 : a16b6760 fe863cf7 29046202 39fb0d49 `gk..<...b.)I..9<br />
402000b0 : dc9fd18c e50f536c 09ae66dd cad9ff91 ....lS...f......<br />
402000c0 : c46bdbdb be791808 89ff83fa 2d3bc71e ..k...y.......;-<br />
402000d0 : 43f5a3b6 0aed1747 ba3c4752 6af0573a ...CG...RG<.:W.j<br />
402000e0 : 3570da77 9a1dc961 324b876c 5d592060 w.p5a...l.K2` Y]<br />
402000f0 : b870f487 1277c035 4609dcf4 53b534c4 ..p.5.w....F.4.S<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200004<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200008<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle><br />
<br />
===BDI config===<br />
<br />
The [ftp://94.230.212.16/bdigdb/config/arm/cortex-a/ BDI config files] might help getting OpenOCD to work with BeagleBoard.<br />
<br />
This configuration assumes the "default" EMU 0 and 1 configuration (both not connected/high state). In this EM setup at first only one TAP is exported. A set of commands must be run on the first tap (embedded ICE) <br />
to enable access to the core:<br />
<br />
SCANINIT t1:w1000:t0:w1000: ;toggle TRST,<br />
SCANINIT ch10:w1000: ;clock TCK with TMS high and wait<br />
SCANINIT i6=07:d8=89:i6=02: ;connect and select router<br />
SCANINIT d32=81000080: ;IP control: KeepPowered<br />
SCANINIT d32=a3002048: ;TAP3: DebugConnect, ForcePower, ForceActive<br />
SCANINIT d32=81000081: ;IP control: KeepPowered, SysReset<br />
SCANINIT d32=a3002148: ;enable TAP3<br />
SCANINIT cl10:i10=ffff ;clock 10 times in RTI, scan bypass<br />
<br />
==Lauterbach==<br />
<br />
Lauterbach Debugger supports [http://www.lauterbach.com/news_288.html OMAP3503/15/25/30].<br />
<br />
==XDS100, XDS510, USB560 and CCSV4==<br />
<br />
Texas Instruments (TI) offers a set of JTAG emulators for debugging Beagle Board, and related, targets. These include the low-cost XDS100v2, and the higher-priced XDS510 et al. In addition, there is en Eclipse-based IDE called Code Composer Studio (ccs). As of early 2011, the latest version is [http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide ccsv5], and it can be run on either a [http://processors.wiki.ti.com/index.php/Linux_Host_Support Linux host] or a Windows host. Debugging is possible in both [http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5 run-mode and stop-mode].<br />
<br />
XDS510, BlackHawk USB560 and CCSV4 (code composer studio) can be used to debug OMAP3503/15/25/30.<br />
<br />
Some of these tools can be found on the [http://focus.ti.com/dsp/docs/dspfindtoolswresults.tsp?sectionId=3&tabId=1620&familyId=1526&toolTypeId=12&go=Go TI tools directory]. <br />
<br />
For CCS setup you see [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation], too (start page: 16).<br />
<br />
===BeagleBoard Linux Kernel Aware Debugging using CCSV4===<br />
Linux Aware debugging using CCSV4 is described in [http://tiexpressdsp.com/index.php?title=Linux_Aware_Debug CCSV4 Linux Aware Debugging]. CCSV4 is available for download from [http://tiexpressdsp.com/index.php/Category:Code_Composer_Studio_v4 CCSV4].<br />
<br />
====CCSV4 Current Status ====<br />
* CCSV4 is a Windows based application, which means that Linux Kernel Code compiled an a Linux machine must be shared using NFS for SAMBA.<br />
* Although CCSV4 is based on Eclipse, it will not work on Linux as there are currently no Linux Drivers for the JTAG Emulators. TI are developing Linux Drivers, but have not disclosed a release date<br />
* CCSV4 is based on Eclipse V3.1.0, which means that many of the features added through Eclipse based V3.4.2 are missing<br />
* TI are updating CCSV4 to use Eclipse V3.4.2, but have not disclosed a release date<br />
* When TI release CCSV4 using Eclipse V3.4.2, I expect TI to release a CCSV4 plugin for Code Sourcery<br />
* TI have produced a very good debugger, but there are still several bugs that TI are actively working to resolve and should be released in an update shortly. Most of these bugs are not show stoppers, but merely operational annoyances. <br />
* Blackhawk have released a $99 [http://www.blackhawk-dsp.com/products/usb100.aspx USB100], which is compatible with CCSV4. Please refer to [http://www.tiexpressdsp.com/index.php/XDS100 XDS100] about compatibility. Update: While CCSV4 does support XDB100, XDS100 does not yet support CortexA8 or C64X+. So, 4.02 (due in 11/09) will have XDS100 beagleboard support.<br />
<br />
==PEEDI==<br />
<br />
[http://www.ronetix.at/peedi.html PEEDI] JTAG/BDM Emulator and Flash Programmer of [http://www.ronetix.at Ronetix] supports OMAP3. A configuration file for the Beagleboard can be found here: [http://download.ronetix.info/peedi/cfg_examples/cortex-a8/omap3530.cfg omap3530.cfg]<br />
<br />
PEEDI has a built-in support for GNU gbd based debuggers and a built-in Flash Programmer.<br />
The Flash Programmer is capable to program:<br />
* NOR Flash devices (over 900)<br />
* NAND and OneNAND Flash devices (small page, larger page, 8/16 bit), various methods of ECC calculation, bad block management.<br />
* DataFlash devices<br />
* SPI DataFlash devices<br />
* images located on a TFTP/FTP/HTTP server or a MMC/SD card (which allows standalone mode).<br />
<br />
The PEEDI package includes also an PEEDI to TI14 adapter and an TI20 to TI14 adapter.<br />
<br />
===Linux Kernel Aware Debugging using PEEDI Emulator===<br />
* For Linux Aware debugging, PEEDI is a great solution. Here is what you will need:<br />
* PEEDI JTAG emulator<br />
* Firmware version 9.8.216 or later<br />
* Arm Insight Debugger available on the Ronetix CDROM<br />
<br />
<I>Note: Enter all commands executed from the Linux Kernel build folder.</I><br />
<br />
====Stopping the Debugger at start_kernel====<br />
* In OMAP3530.CFG, change the hardware breakpoint address in the [INIT_LINUX] section to the address of start_kernel<br />
* To obtain the address of start_kernel, use "nm vmlinux |grep -w start_kernel"<br />
* If your u-boot counts down from 10, you will need to extend the debugger timeout<br />
* Two lines down, change the line to "wait 25000 stop"<br />
* Power up the BeagleBoard and PEEDI<br />
* Let u-boot countdown and load the Linux Kernel<br />
* PEEDI will stop at "start_kernel"<br />
====Launching the Insight Debugger====<br />
* Install the ARM Insight Debbugger from the Ronetix CDROM, which is normally installed in the /opt folder<br />
* From the Linux Kernel build folder type "/opt/arm-linux-4.3.3/bin/arm-linux-insight vmlinux &"<br />
* In the Console Window, type "target remote <xxx.xxx.xxx.xxx>:2000, where <xxx.xxx.xxx.xxx> is the BeagleBoard IP address<br />
* Next, type "ni". The Source Window will load /init/main.c and highlight a line in start_kernel<br />
* Step through the code, or enter breakpoints and run the program. <br />
<br />
====Thread List====<br />
* If you are doing multi-threaded debugging, this feature is invaluable<br />
* The PEEDI config file (OMAP3530.CFG) must be setup to read this info from your kernel<br />
* The information needed by Insight GDB is in the [OS_ARM_LINUX_v26] section<br />
* This information is obtained from the Insight GDB Console Window<br />
* print &init_task ; BASE<br />
* print &((struct task_struct*)0)->tasks.next ; NEXT<br />
* print &((struct task_struct*)0)->pid ; PID<br />
* print &((struct task_struct*)0)->comm ; NAME<br />
* print &((struct task_struct*)0)->stack ; second CONTEXT arg<br />
* print &((struct thread_info*)0)->cpu_context ; third CONTEXT arg<br />
<br />
For Linux Kernel v2.6.29, this section looks something like this:<br />
* BASE = 4, 0xC066B110<br />
* NEXT = 4, -0x1B8<br />
* PID = 4, 0x1E4<br />
* NAME = 16, 0x2DB<br />
* CONTEXT = 10*4, 0x4, 0x1C<br />
<br />
Note: the BASE address will most definitely be different to the one provided here, but the other values should be similar.<br />
<br />
Ronetix technical support is excellent and they added features like the Thread List in just over a week. When I reported what seemed like a bug, they fixed most of them in just a few days. Overall, I am very impressed with the PEEDI emulator and it works great with the BeagleBoard. PEEDI is certainly the most responsive emulator I have worked with and what I like most is it is one of the few that works natively within Linux.<br />
<br />
==ARM Development Studio 5 (DS-5™)==<br />
<br />
The reference software development suite from ARM, [http://www.arm.com/ds5 DS-5], supports JTAG-based debug and ETM trace with Linux kernel awareness on OMAP34XX/OMAP35XX/OMAP36XX/OMAP44XX and other ARM-based devices. Its target connection is called [http://www.arm.com/dstream DSTREAM], and is spec'd to provide reliable and fast run-control debug and 4GB of non-intrusive instruction trace.<br />
<br />
For ease of use for Beagle board users, it even provides BB and BB xM [http://www.arm.com/products/tools/software-tools/ds-5/ds-5-downloads.php Linux distribution examples].<br />
<br />
=Linux kernel debugging=<br />
<br />
If you like to debug Linux kernel (with one of the above JTAG tools?) using GDB have a look to [[Debugging The Linux Kernel Using Gdb]] article.</div>Guilhttps://elinux.org/index.php?title=BeagleBoardJTAG&diff=85994BeagleBoardJTAG2012-01-18T11:39:20Z<p>Guil: /* ARM Development Studio 5 (DS-5™) */</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
[[Category:Development Boards]]<br />
[[Category: BeagleBoard]]<br />
The page is about [http://en.wikipedia.org/wiki/JTAG JTAG] on OMAP3530 used at [[BeagleBoard|BeagleBoard]].<br />
<br />
=Beagle JTAG connection=<br />
The [[BeagleBoard]] comes with a 14 pin [[JTAG-TI|TI JTAG]] connector. For JTAG pin out see section 8.16 of [http://www.beagleboard.org/uploads/Beagle_HW_Reference_Manual_B_5.pdf BeagleBoard HW Reference Manual (rev. B5)]. This is the same header interface as used in other TI products and is ''NOT'' the standard 14 pin ARM layout. Depending on your JTAG tool, you'd need a [[JTAG-TI|20-pin to 14-pin TI adapter]].<br />
<br />
'''Attention: JTAG on BeagleBoard uses 1.8V!'''<br />
<br />
The 14-pin TI JTAG connector that is used on BeagleBoard is supported by a large number of JTAG emulation products and has been tested using Lauterbach, Green Hills, Spectrum Digital XDS510USB+ and TI XDS560 emulation pods. Note that it will not work with the Spectrum Digital XDS510USB (non-plus) as it does not support a target with 1.8V JTAG.<br />
<br />
The following picture is from a [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation]:<br />
<br />
[[Image:Ti arm jtag.jpg]]<br />
<br />
Beagle uses the 14-pin TI header.<br />
<br />
Note: TI uses some different pin names. Translation:<br />
* TVD => VREF at Beagle<br />
* TCLKR == RTCK<br />
* TCLKO == TCK<br />
* #### == Key (empty))<br />
* TDIS => GND at Beagle<br />
<br />
See [[OMAP3530_ICEPICK|ICEPICK configuration page]] for more details about how OMAP3 JTAG hardware needs to be configured.<br />
<br />
== Beagle adapter ==<br />
The [[BeagleBoardJTAG#TinCanTools_Flyswatter|Flyswatter]] we plan to use has a 14 pin ARM layout, so we need to create a converter. From [http://www.tincantools.com/assets/JTAG_pin_assignments.pdf JTAG pin assignments] document:<br />
<br />
''' ARM-14-JTAG TI-14-JTAG'''<br />
<br />
VREF 1 - - 2 GND JTAG_TMS 1 - - 2 JTAG_nTRST<br />
JTAG_nTRST 3 - - 4 GND JTAG_TDI 3 - - 4 GND<br />
JTAG_TDI 5 - - 6 GND VREF 5 - x 6 KEY (empty)<br />
JTAG_TMS 7 - - 8 GND JTAG_TDO 7 - - 8 GND<br />
JTAG_TCK 9 - - 10 GND JTAG_RTCK 9 - - 10 GND<br />
JTAG_TDO 11 - - 12 JTAG_SRST_N JTAG_TCK 11 - - 12 GND<br />
VREF 13 - - 14 GND JTAG_EMU0 13 - - 14 JTAG_EMU1<br />
FlySwatter TOP Beagle<br />
<br />
See [[media:flyswatter-ti-jtag.pdf|14 pin ARM to TI adapter]] for a verified JTAG adapter from [http://www.tincantools.com/ TinCanTools].<br />
<br />
* [http://tincantools.com/product.php?productid=16144 TinCanTools BeagleBoard Adapter Kit]<br />
* Nishanth Menon's [http://www.flickr.com/photos/nishanthmenon/2814595201/in/pool-beagleboard adapter] with explanation and [http://nishanthmenon.blogspot.com/2008/08/low-cost-jtag-for-beagle.html Nishanth's blog]<br />
* Lauterbach [http://www.lauterbach.com/frames.html?ord__7748.html JTAG converter to TI Target Adapter 14] (LA-7748) ([[media:Jtag-ti-front.jpg|front]] & [[media:Jtag-ti-back.jpg|back]])<br />
* [http://www.flickr.com/photos/51025379@N00/2822556950/in/photostream/ xdaiabx adapter]<br />
<br />
= Open source JTAG software= <br />
It would be very interesting to get the JTAG working with open source tools. The main open source JTAG software is [http://openocd.berlios.de/web/ OpenOCD]. See [[BeagleBoardOpenOCD|Beagle board OpenOCD page]] about status and usage of OpenOCD for Beagle.<br />
<br />
=JTAG hardware=<br />
<br />
For BeagleBoard JTAG debugging, there are some HW interfaces available. Each is covered below.<br />
<br />
==TinCanTools Flyswatter2==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a new JTAG debugger at [http://www.tincantools.com/product.php?productid=16153&cat=0&page=1&featured Flyswatter2] that has support for OpenOCD and ARM Cortex A8 processors: OMAP3530 BeagleBoard and DM3730 BeagleBoard-xM. The Flyswatter2 is 5 to 10 times faster than the original Flyswatter. <br />
<br />
They also have a [http://www.tincantools.com/product.php?productid=16154&cat=251&page=1 ARM20TI14 JTAG Adapter]. This JTAG adapter board works with the BeagleBoard and BeagleBoard-xM.<br />
<br />
The Flyswatter2 can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
==TinCanTools Flyswatter==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a working JTAG debugger at [http://www.tincantools.com/product.php?productid=16134&cat=0&page=1&featured Flyswatter] that has support for OpenOCD and the OMAP3530 (ARM Cortex A8). They also have a [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit].<br />
<br />
Costs:<br />
<br />
In case you like to order Flyswatter and Adapter Kit international, here an example for Europe (Germany):<br />
<br />
* Flyswatter: US-$ 49.95<br />
* BeagleBoard Adapter Kit: US-$ 18.00<br />
* International shipping: US-$ 27.00 (select USPS, it's the cheapest!)<br />
* Video about using Flyswatter with BeagleBoard<br />
<br />
Sum: US-$ 94.95 => EUR 65.28 + EUR 8.76 VAT (Germany) = EUR 74.04<br />
<br />
Flyswatter can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
'''Attention''': If you use [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit], make sure you plug the JTAG adapter the correct way. There are several possible ways, though. See [http://www.tincantools.com/images/D/Fly%2BBeagle-800x391.JPG?1229714946602 connection picture] how to do it the right way (in contrast to the picture EMU0 & EMU1 jumpers at JTAG adapter should be both at 1-2 position (touching J2) because EMU0 and EMU1 must be set in order for the ICEpick JTAG TAP router within the DM37x to be the only device exposed after power on, which is what OpenOCD expects to see).<br />
<br />
==BDI 2000==<br />
<br />
===Example===<br />
<br />
[http://groups.google.com/group/beagleboard/msg/8463086de562ee00 Chuck Fleming] reports:<br />
<br />
The BDI2000 appears to work with the omap35xx.cfg and regOMAP3500.def files that come with the BDI hardware. I had to modify the 10-pin cable so that the BeagleBoard JTAG header matched the BDI target A connector:<br />
<br />
beagle>reset<br />
- TARGET: processing reset request<br />
- TARGET: BDI executes scan chain init string<br />
- TARGET: Bypass check 0x00000001 => 0x00000002<br />
- TARGET: JTAG exists check passed<br />
- Core#0: ID code is 0x0B6D602F<br />
- Core#0: DP-CSW is 0xF0000000<br />
- Core#0: DBG-AP at 0xD4011000<br />
- Core#0: DIDR is 0x15141012<br />
- TARGET: BDI removes RESET<br />
- TARGET: BDI waits for RESET inactive<br />
- TARGET: Reset sequence passed<br />
- TARGET: resetting target passed<br />
- TARGET: processing target startup ....<br />
- TARGET: processing target startup passed<br />
beagle>halt<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Debug Request<br />
Current PC : 0x40200000<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>rdall<br />
User FIQ Superv Abort IRQ Undef<br />
GPR00: 480029fc 480029fc 480029fc 480029fc 480029fc 480029fc<br />
GPR01: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR02: 00000001 00000001 00000001 00000001 00000001 00000001<br />
GPR03: 00000060 00000060 00000060 00000060 00000060 00000060<br />
GPR04: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR05: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR06: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR07: 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88<br />
GPR08: 80e3ffdc 34484608 80e3ffdc 80e3ffdc 80e3ffdc 80e3ffdc<br />
GPR09: 80e3fec8 26a1c132 80e3fec8 80e3fec8 80e3fec8 80e3fec8<br />
GPR10: 00000018 08040f16 00000018 00000018 00000018 00000018<br />
GPR11: 80e3fecc 3c278260 80e3fecc 80e3fecc 80e3fecc 80e3fecc<br />
GPR12: 0000006e 24200625 0000006e 0000006e 0000006e 0000006e<br />
GPR13: 00000000 00000000 80e3feb0 00000000 00000000 d1868045<br />
GPR14: 00000000 00000000 80e84f44 00000000 00000000 d55a4cc8<br />
PC : 40200000<br />
CPSR : 000001d3<br />
SPSR : 00000000 00000000 00000000 00000000 00000000<br />
beagle>md 0x40200000<br />
40200000 : e320f000 e320f000 e320f000 e320f000 .. ... ... ... .<br />
40200010 : e320f000 e320f000 e320f000 eafffffc .. ... ... .....<br />
40200020 : b6273502 e7aa052b 047694c8 91ca77d8 .5'.+.....v..w..<br />
40200030 : 12b9579e ef2eef1b 00543892 494f9bc1 .W.......8T...OI<br />
40200040 : 3f63013d 82eee656 b7adfe8d 993f1368 =.c?V.......h.?.<br />
40200050 : 51f1cf9b 0464a23e bea76e3c 3d275f5c ...Q>.d.<n..\_'=<br />
40200060 : 76554290 6776c892 a6cd088f 6dd4529a .BUv..vg.....R.m<br />
40200070 : 067261b8 e5f80e9e cb4ea075 25a9dd95 .ar.....u.N....%<br />
40200080 : 779db8c6 0496597b 7d5f8d5a 24f44cd6 ...w{Y..Z._}.L.$<br />
40200090 : 99ab46f9 9ddc06d9 fd34567a 2035bab8 .F......zV4...5<br />
402000a0 : a16b6760 fe863cf7 29046202 39fb0d49 `gk..<...b.)I..9<br />
402000b0 : dc9fd18c e50f536c 09ae66dd cad9ff91 ....lS...f......<br />
402000c0 : c46bdbdb be791808 89ff83fa 2d3bc71e ..k...y.......;-<br />
402000d0 : 43f5a3b6 0aed1747 ba3c4752 6af0573a ...CG...RG<.:W.j<br />
402000e0 : 3570da77 9a1dc961 324b876c 5d592060 w.p5a...l.K2` Y]<br />
402000f0 : b870f487 1277c035 4609dcf4 53b534c4 ..p.5.w....F.4.S<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200004<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200008<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle><br />
<br />
===BDI config===<br />
<br />
The [ftp://94.230.212.16/bdigdb/config/arm/cortex-a/ BDI config files] might help getting OpenOCD to work with BeagleBoard.<br />
<br />
This configuration assumes the "default" EMU 0 and 1 configuration (both not connected/high state). In this EM setup at first only one TAP is exported. A set of commands must be run on the first tap (embedded ICE) <br />
to enable access to the core:<br />
<br />
SCANINIT t1:w1000:t0:w1000: ;toggle TRST,<br />
SCANINIT ch10:w1000: ;clock TCK with TMS high and wait<br />
SCANINIT i6=07:d8=89:i6=02: ;connect and select router<br />
SCANINIT d32=81000080: ;IP control: KeepPowered<br />
SCANINIT d32=a3002048: ;TAP3: DebugConnect, ForcePower, ForceActive<br />
SCANINIT d32=81000081: ;IP control: KeepPowered, SysReset<br />
SCANINIT d32=a3002148: ;enable TAP3<br />
SCANINIT cl10:i10=ffff ;clock 10 times in RTI, scan bypass<br />
<br />
==Lauterbach==<br />
<br />
Lauterbach Debugger supports [http://www.lauterbach.com/news_288.html OMAP3503/15/25/30].<br />
<br />
==XDS100, XDS510, USB560 and CCSV4==<br />
<br />
Texas Instruments (TI) offers a set of JTAG emulators for debugging Beagle Board, and related, targets. These include the low-cost XDS100v2, and the higher-priced XDS510 et al. In addition, there is en Eclipse-based IDE called Code Composer Studio (ccs). As of early 2011, the latest version is [http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide ccsv5], and it can be run on either a [http://processors.wiki.ti.com/index.php/Linux_Host_Support Linux host] or a Windows host. Debugging is possible in both [http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5 run-mode and stop-mode].<br />
<br />
XDS510, BlackHawk USB560 and CCSV4 (code composer studio) can be used to debug OMAP3503/15/25/30.<br />
<br />
Some of these tools can be found on the [http://focus.ti.com/dsp/docs/dspfindtoolswresults.tsp?sectionId=3&tabId=1620&familyId=1526&toolTypeId=12&go=Go TI tools directory]. <br />
<br />
For CCS setup you see [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation], too (start page: 16).<br />
<br />
===BeagleBoard Linux Kernel Aware Debugging using CCSV4===<br />
Linux Aware debugging using CCSV4 is described in [http://tiexpressdsp.com/index.php?title=Linux_Aware_Debug CCSV4 Linux Aware Debugging]. CCSV4 is available for download from [http://tiexpressdsp.com/index.php/Category:Code_Composer_Studio_v4 CCSV4].<br />
<br />
====CCSV4 Current Status ====<br />
* CCSV4 is a Windows based application, which means that Linux Kernel Code compiled an a Linux machine must be shared using NFS for SAMBA.<br />
* Although CCSV4 is based on Eclipse, it will not work on Linux as there are currently no Linux Drivers for the JTAG Emulators. TI are developing Linux Drivers, but have not disclosed a release date<br />
* CCSV4 is based on Eclipse V3.1.0, which means that many of the features added through Eclipse based V3.4.2 are missing<br />
* TI are updating CCSV4 to use Eclipse V3.4.2, but have not disclosed a release date<br />
* When TI release CCSV4 using Eclipse V3.4.2, I expect TI to release a CCSV4 plugin for Code Sourcery<br />
* TI have produced a very good debugger, but there are still several bugs that TI are actively working to resolve and should be released in an update shortly. Most of these bugs are not show stoppers, but merely operational annoyances. <br />
* Blackhawk have released a $99 [http://www.blackhawk-dsp.com/products/usb100.aspx USB100], which is compatible with CCSV4. Please refer to [http://www.tiexpressdsp.com/index.php/XDS100 XDS100] about compatibility. Update: While CCSV4 does support XDB100, XDS100 does not yet support CortexA8 or C64X+. So, 4.02 (due in 11/09) will have XDS100 beagleboard support.<br />
<br />
==PEEDI==<br />
<br />
[http://www.ronetix.at/peedi.html PEEDI] JTAG/BDM Emulator and Flash Programmer of [http://www.ronetix.at Ronetix] supports OMAP3. A configuration file for the Beagleboard can be found here: [http://download.ronetix.info/peedi/cfg_examples/cortex-a8/omap3530.cfg omap3530.cfg]<br />
<br />
PEEDI has a built-in support for GNU gbd based debuggers and a built-in Flash Programmer.<br />
The Flash Programmer is capable to program:<br />
* NOR Flash devices (over 900)<br />
* NAND and OneNAND Flash devices (small page, larger page, 8/16 bit), various methods of ECC calculation, bad block management.<br />
* DataFlash devices<br />
* SPI DataFlash devices<br />
* images located on a TFTP/FTP/HTTP server or a MMC/SD card (which allows standalone mode).<br />
<br />
The PEEDI package includes also an PEEDI to TI14 adapter and an TI20 to TI14 adapter.<br />
<br />
===Linux Kernel Aware Debugging using PEEDI Emulator===<br />
* For Linux Aware debugging, PEEDI is a great solution. Here is what you will need:<br />
* PEEDI JTAG emulator<br />
* Firmware version 9.8.216 or later<br />
* Arm Insight Debugger available on the Ronetix CDROM<br />
<br />
<I>Note: Enter all commands executed from the Linux Kernel build folder.</I><br />
<br />
====Stopping the Debugger at start_kernel====<br />
* In OMAP3530.CFG, change the hardware breakpoint address in the [INIT_LINUX] section to the address of start_kernel<br />
* To obtain the address of start_kernel, use "nm vmlinux |grep -w start_kernel"<br />
* If your u-boot counts down from 10, you will need to extend the debugger timeout<br />
* Two lines down, change the line to "wait 25000 stop"<br />
* Power up the BeagleBoard and PEEDI<br />
* Let u-boot countdown and load the Linux Kernel<br />
* PEEDI will stop at "start_kernel"<br />
====Launching the Insight Debugger====<br />
* Install the ARM Insight Debbugger from the Ronetix CDROM, which is normally installed in the /opt folder<br />
* From the Linux Kernel build folder type "/opt/arm-linux-4.3.3/bin/arm-linux-insight vmlinux &"<br />
* In the Console Window, type "target remote <xxx.xxx.xxx.xxx>:2000, where <xxx.xxx.xxx.xxx> is the BeagleBoard IP address<br />
* Next, type "ni". The Source Window will load /init/main.c and highlight a line in start_kernel<br />
* Step through the code, or enter breakpoints and run the program. <br />
<br />
====Thread List====<br />
* If you are doing multi-threaded debugging, this feature is invaluable<br />
* The PEEDI config file (OMAP3530.CFG) must be setup to read this info from your kernel<br />
* The information needed by Insight GDB is in the [OS_ARM_LINUX_v26] section<br />
* This information is obtained from the Insight GDB Console Window<br />
* print &init_task ; BASE<br />
* print &((struct task_struct*)0)->tasks.next ; NEXT<br />
* print &((struct task_struct*)0)->pid ; PID<br />
* print &((struct task_struct*)0)->comm ; NAME<br />
* print &((struct task_struct*)0)->stack ; second CONTEXT arg<br />
* print &((struct thread_info*)0)->cpu_context ; third CONTEXT arg<br />
<br />
For Linux Kernel v2.6.29, this section looks something like this:<br />
* BASE = 4, 0xC066B110<br />
* NEXT = 4, -0x1B8<br />
* PID = 4, 0x1E4<br />
* NAME = 16, 0x2DB<br />
* CONTEXT = 10*4, 0x4, 0x1C<br />
<br />
Note: the BASE address will most definitely be different to the one provided here, but the other values should be similar.<br />
<br />
Ronetix technical support is excellent and they added features like the Thread List in just over a week. When I reported what seemed like a bug, they fixed most of them in just a few days. Overall, I am very impressed with the PEEDI emulator and it works great with the BeagleBoard. PEEDI is certainly the most responsive emulator I have worked with and what I like most is it is one of the few that works natively within Linux.<br />
<br />
==ARM Development Studio 5 (DS-5™)==<br />
<br />
The reference software development suite from ARM, [http://www.arm.com/ds5 DS-5], supports JTAG-based debug and ETM trace with Linux kernel awareness on OMAP34XX/OMAP35XX/OMAP36XX/OMAP44XX. <br />
<br />
For ease of use for Beagle board users, it even provides BB and BB xM [http://www.arm.com/products/tools/software-tools/ds-5/ds-5-downloads.php Linux distribution examples].<br />
<br />
=Linux kernel debugging=<br />
<br />
If you like to debug Linux kernel (with one of the above JTAG tools?) using GDB have a look to [[Debugging The Linux Kernel Using Gdb]] article.</div>Guilhttps://elinux.org/index.php?title=BeagleBoardJTAG&diff=85988BeagleBoardJTAG2012-01-18T11:37:31Z<p>Guil: /* ARM Development Studio 5 (DS-5) */</p>
<hr />
<div>[[Category: Linux]]<br />
[[Category: OMAP]]<br />
[[Category:Development Boards]]<br />
[[Category: BeagleBoard]]<br />
The page is about [http://en.wikipedia.org/wiki/JTAG JTAG] on OMAP3530 used at [[BeagleBoard|BeagleBoard]].<br />
<br />
=Beagle JTAG connection=<br />
The [[BeagleBoard]] comes with a 14 pin [[JTAG-TI|TI JTAG]] connector. For JTAG pin out see section 8.16 of [http://www.beagleboard.org/uploads/Beagle_HW_Reference_Manual_B_5.pdf BeagleBoard HW Reference Manual (rev. B5)]. This is the same header interface as used in other TI products and is ''NOT'' the standard 14 pin ARM layout. Depending on your JTAG tool, you'd need a [[JTAG-TI|20-pin to 14-pin TI adapter]].<br />
<br />
'''Attention: JTAG on BeagleBoard uses 1.8V!'''<br />
<br />
The 14-pin TI JTAG connector that is used on BeagleBoard is supported by a large number of JTAG emulation products and has been tested using Lauterbach, Green Hills, Spectrum Digital XDS510USB+ and TI XDS560 emulation pods. Note that it will not work with the Spectrum Digital XDS510USB (non-plus) as it does not support a target with 1.8V JTAG.<br />
<br />
The following picture is from a [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation]:<br />
<br />
[[Image:Ti arm jtag.jpg]]<br />
<br />
Beagle uses the 14-pin TI header.<br />
<br />
Note: TI uses some different pin names. Translation:<br />
* TVD => VREF at Beagle<br />
* TCLKR == RTCK<br />
* TCLKO == TCK<br />
* #### == Key (empty))<br />
* TDIS => GND at Beagle<br />
<br />
See [[OMAP3530_ICEPICK|ICEPICK configuration page]] for more details about how OMAP3 JTAG hardware needs to be configured.<br />
<br />
== Beagle adapter ==<br />
The [[BeagleBoardJTAG#TinCanTools_Flyswatter|Flyswatter]] we plan to use has a 14 pin ARM layout, so we need to create a converter. From [http://www.tincantools.com/assets/JTAG_pin_assignments.pdf JTAG pin assignments] document:<br />
<br />
''' ARM-14-JTAG TI-14-JTAG'''<br />
<br />
VREF 1 - - 2 GND JTAG_TMS 1 - - 2 JTAG_nTRST<br />
JTAG_nTRST 3 - - 4 GND JTAG_TDI 3 - - 4 GND<br />
JTAG_TDI 5 - - 6 GND VREF 5 - x 6 KEY (empty)<br />
JTAG_TMS 7 - - 8 GND JTAG_TDO 7 - - 8 GND<br />
JTAG_TCK 9 - - 10 GND JTAG_RTCK 9 - - 10 GND<br />
JTAG_TDO 11 - - 12 JTAG_SRST_N JTAG_TCK 11 - - 12 GND<br />
VREF 13 - - 14 GND JTAG_EMU0 13 - - 14 JTAG_EMU1<br />
FlySwatter TOP Beagle<br />
<br />
See [[media:flyswatter-ti-jtag.pdf|14 pin ARM to TI adapter]] for a verified JTAG adapter from [http://www.tincantools.com/ TinCanTools].<br />
<br />
* [http://tincantools.com/product.php?productid=16144 TinCanTools BeagleBoard Adapter Kit]<br />
* Nishanth Menon's [http://www.flickr.com/photos/nishanthmenon/2814595201/in/pool-beagleboard adapter] with explanation and [http://nishanthmenon.blogspot.com/2008/08/low-cost-jtag-for-beagle.html Nishanth's blog]<br />
* Lauterbach [http://www.lauterbach.com/frames.html?ord__7748.html JTAG converter to TI Target Adapter 14] (LA-7748) ([[media:Jtag-ti-front.jpg|front]] & [[media:Jtag-ti-back.jpg|back]])<br />
* [http://www.flickr.com/photos/51025379@N00/2822556950/in/photostream/ xdaiabx adapter]<br />
<br />
= Open source JTAG software= <br />
It would be very interesting to get the JTAG working with open source tools. The main open source JTAG software is [http://openocd.berlios.de/web/ OpenOCD]. See [[BeagleBoardOpenOCD|Beagle board OpenOCD page]] about status and usage of OpenOCD for Beagle.<br />
<br />
=JTAG hardware=<br />
<br />
For BeagleBoard JTAG debugging, there are some HW interfaces available. Each is covered below.<br />
<br />
==TinCanTools Flyswatter2==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a new JTAG debugger at [http://www.tincantools.com/product.php?productid=16153&cat=0&page=1&featured Flyswatter2] that has support for OpenOCD and ARM Cortex A8 processors: OMAP3530 BeagleBoard and DM3730 BeagleBoard-xM. The Flyswatter2 is 5 to 10 times faster than the original Flyswatter. <br />
<br />
They also have a [http://www.tincantools.com/product.php?productid=16154&cat=251&page=1 ARM20TI14 JTAG Adapter]. This JTAG adapter board works with the BeagleBoard and BeagleBoard-xM.<br />
<br />
The Flyswatter2 can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
==TinCanTools Flyswatter==<br />
<br />
[http://www.tincantools.com/ TinCanTools] has a working JTAG debugger at [http://www.tincantools.com/product.php?productid=16134&cat=0&page=1&featured Flyswatter] that has support for OpenOCD and the OMAP3530 (ARM Cortex A8). They also have a [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit].<br />
<br />
Costs:<br />
<br />
In case you like to order Flyswatter and Adapter Kit international, here an example for Europe (Germany):<br />
<br />
* Flyswatter: US-$ 49.95<br />
* BeagleBoard Adapter Kit: US-$ 18.00<br />
* International shipping: US-$ 27.00 (select USPS, it's the cheapest!)<br />
* Video about using Flyswatter with BeagleBoard<br />
<br />
Sum: US-$ 94.95 => EUR 65.28 + EUR 8.76 VAT (Germany) = EUR 74.04<br />
<br />
Flyswatter can be used with [[BeagleBoardJTAG#Open_source_JTAG_software|OpenOCD]] (Beagle (OMAP3xx) support is complete).<br />
<br />
'''Attention''': If you use [http://tincantools.com/product.php?productid=16144 BeagleBoard Adapter Kit], make sure you plug the JTAG adapter the correct way. There are several possible ways, though. See [http://www.tincantools.com/images/D/Fly%2BBeagle-800x391.JPG?1229714946602 connection picture] how to do it the right way (in contrast to the picture EMU0 & EMU1 jumpers at JTAG adapter should be both at 1-2 position (touching J2) because EMU0 and EMU1 must be set in order for the ICEpick JTAG TAP router within the DM37x to be the only device exposed after power on, which is what OpenOCD expects to see).<br />
<br />
==BDI 2000==<br />
<br />
===Example===<br />
<br />
[http://groups.google.com/group/beagleboard/msg/8463086de562ee00 Chuck Fleming] reports:<br />
<br />
The BDI2000 appears to work with the omap35xx.cfg and regOMAP3500.def files that come with the BDI hardware. I had to modify the 10-pin cable so that the BeagleBoard JTAG header matched the BDI target A connector:<br />
<br />
beagle>reset<br />
- TARGET: processing reset request<br />
- TARGET: BDI executes scan chain init string<br />
- TARGET: Bypass check 0x00000001 => 0x00000002<br />
- TARGET: JTAG exists check passed<br />
- Core#0: ID code is 0x0B6D602F<br />
- Core#0: DP-CSW is 0xF0000000<br />
- Core#0: DBG-AP at 0xD4011000<br />
- Core#0: DIDR is 0x15141012<br />
- TARGET: BDI removes RESET<br />
- TARGET: BDI waits for RESET inactive<br />
- TARGET: Reset sequence passed<br />
- TARGET: resetting target passed<br />
- TARGET: processing target startup ....<br />
- TARGET: processing target startup passed<br />
beagle>halt<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Debug Request<br />
Current PC : 0x40200000<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>rdall<br />
User FIQ Superv Abort IRQ Undef<br />
GPR00: 480029fc 480029fc 480029fc 480029fc 480029fc 480029fc<br />
GPR01: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR02: 00000001 00000001 00000001 00000001 00000001 00000001<br />
GPR03: 00000060 00000060 00000060 00000060 00000060 00000060<br />
GPR04: 00000000 00000000 00000000 00000000 00000000 00000000<br />
GPR05: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR06: 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4 80f2f2f4<br />
GPR07: 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88 80e9ee88<br />
GPR08: 80e3ffdc 34484608 80e3ffdc 80e3ffdc 80e3ffdc 80e3ffdc<br />
GPR09: 80e3fec8 26a1c132 80e3fec8 80e3fec8 80e3fec8 80e3fec8<br />
GPR10: 00000018 08040f16 00000018 00000018 00000018 00000018<br />
GPR11: 80e3fecc 3c278260 80e3fecc 80e3fecc 80e3fecc 80e3fecc<br />
GPR12: 0000006e 24200625 0000006e 0000006e 0000006e 0000006e<br />
GPR13: 00000000 00000000 80e3feb0 00000000 00000000 d1868045<br />
GPR14: 00000000 00000000 80e84f44 00000000 00000000 d55a4cc8<br />
PC : 40200000<br />
CPSR : 000001d3<br />
SPSR : 00000000 00000000 00000000 00000000 00000000<br />
beagle>md 0x40200000<br />
40200000 : e320f000 e320f000 e320f000 e320f000 .. ... ... ... .<br />
40200010 : e320f000 e320f000 e320f000 eafffffc .. ... ... .....<br />
40200020 : b6273502 e7aa052b 047694c8 91ca77d8 .5'.+.....v..w..<br />
40200030 : 12b9579e ef2eef1b 00543892 494f9bc1 .W.......8T...OI<br />
40200040 : 3f63013d 82eee656 b7adfe8d 993f1368 =.c?V.......h.?.<br />
40200050 : 51f1cf9b 0464a23e bea76e3c 3d275f5c ...Q>.d.<n..\_'=<br />
40200060 : 76554290 6776c892 a6cd088f 6dd4529a .BUv..vg.....R.m<br />
40200070 : 067261b8 e5f80e9e cb4ea075 25a9dd95 .ar.....u.N....%<br />
40200080 : 779db8c6 0496597b 7d5f8d5a 24f44cd6 ...w{Y..Z._}.L.$<br />
40200090 : 99ab46f9 9ddc06d9 fd34567a 2035bab8 .F......zV4...5<br />
402000a0 : a16b6760 fe863cf7 29046202 39fb0d49 `gk..<...b.)I..9<br />
402000b0 : dc9fd18c e50f536c 09ae66dd cad9ff91 ....lS...f......<br />
402000c0 : c46bdbdb be791808 89ff83fa 2d3bc71e ..k...y.......;-<br />
402000d0 : 43f5a3b6 0aed1747 ba3c4752 6af0573a ...CG...RG<.:W.j<br />
402000e0 : 3570da77 9a1dc961 324b876c 5d592060 w.p5a...l.K2` Y]<br />
402000f0 : b870f487 1277c035 4609dcf4 53b534c4 ..p.5.w....F.4.S<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200004<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle>ti<br />
Core number : 0<br />
Core state : debug mode (ARM)<br />
Debug entry cause : Single Step<br />
Current PC : 0x40200008<br />
Current CPSR : 0x000001d3 (Supervisor)<br />
beagle><br />
<br />
===BDI config===<br />
<br />
The [ftp://94.230.212.16/bdigdb/config/arm/cortex-a/ BDI config files] might help getting OpenOCD to work with BeagleBoard.<br />
<br />
This configuration assumes the "default" EMU 0 and 1 configuration (both not connected/high state). In this EM setup at first only one TAP is exported. A set of commands must be run on the first tap (embedded ICE) <br />
to enable access to the core:<br />
<br />
SCANINIT t1:w1000:t0:w1000: ;toggle TRST,<br />
SCANINIT ch10:w1000: ;clock TCK with TMS high and wait<br />
SCANINIT i6=07:d8=89:i6=02: ;connect and select router<br />
SCANINIT d32=81000080: ;IP control: KeepPowered<br />
SCANINIT d32=a3002048: ;TAP3: DebugConnect, ForcePower, ForceActive<br />
SCANINIT d32=81000081: ;IP control: KeepPowered, SysReset<br />
SCANINIT d32=a3002148: ;enable TAP3<br />
SCANINIT cl10:i10=ffff ;clock 10 times in RTI, scan bypass<br />
<br />
==Lauterbach==<br />
<br />
Lauterbach Debugger supports [http://www.lauterbach.com/news_288.html OMAP3503/15/25/30].<br />
<br />
==XDS100, XDS510, USB560 and CCSV4==<br />
<br />
Texas Instruments (TI) offers a set of JTAG emulators for debugging Beagle Board, and related, targets. These include the low-cost XDS100v2, and the higher-priced XDS510 et al. In addition, there is en Eclipse-based IDE called Code Composer Studio (ccs). As of early 2011, the latest version is [http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide ccsv5], and it can be run on either a [http://processors.wiki.ti.com/index.php/Linux_Host_Support Linux host] or a Windows host. Debugging is possible in both [http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5 run-mode and stop-mode].<br />
<br />
XDS510, BlackHawk USB560 and CCSV4 (code composer studio) can be used to debug OMAP3503/15/25/30.<br />
<br />
Some of these tools can be found on the [http://focus.ti.com/dsp/docs/dspfindtoolswresults.tsp?sectionId=3&tabId=1620&familyId=1526&toolTypeId=12&go=Go TI tools directory]. <br />
<br />
For CCS setup you see [http://focus.ti.com/lit/ml/sprp603/sprp603.pdf TI OMAP JTAG presentation], too (start page: 16).<br />
<br />
===BeagleBoard Linux Kernel Aware Debugging using CCSV4===<br />
Linux Aware debugging using CCSV4 is described in [http://tiexpressdsp.com/index.php?title=Linux_Aware_Debug CCSV4 Linux Aware Debugging]. CCSV4 is available for download from [http://tiexpressdsp.com/index.php/Category:Code_Composer_Studio_v4 CCSV4].<br />
<br />
====CCSV4 Current Status ====<br />
* CCSV4 is a Windows based application, which means that Linux Kernel Code compiled an a Linux machine must be shared using NFS for SAMBA.<br />
* Although CCSV4 is based on Eclipse, it will not work on Linux as there are currently no Linux Drivers for the JTAG Emulators. TI are developing Linux Drivers, but have not disclosed a release date<br />
* CCSV4 is based on Eclipse V3.1.0, which means that many of the features added through Eclipse based V3.4.2 are missing<br />
* TI are updating CCSV4 to use Eclipse V3.4.2, but have not disclosed a release date<br />
* When TI release CCSV4 using Eclipse V3.4.2, I expect TI to release a CCSV4 plugin for Code Sourcery<br />
* TI have produced a very good debugger, but there are still several bugs that TI are actively working to resolve and should be released in an update shortly. Most of these bugs are not show stoppers, but merely operational annoyances. <br />
* Blackhawk have released a $99 [http://www.blackhawk-dsp.com/products/usb100.aspx USB100], which is compatible with CCSV4. Please refer to [http://www.tiexpressdsp.com/index.php/XDS100 XDS100] about compatibility. Update: While CCSV4 does support XDB100, XDS100 does not yet support CortexA8 or C64X+. So, 4.02 (due in 11/09) will have XDS100 beagleboard support.<br />
<br />
==PEEDI==<br />
<br />
[http://www.ronetix.at/peedi.html PEEDI] JTAG/BDM Emulator and Flash Programmer of [http://www.ronetix.at Ronetix] supports OMAP3. A configuration file for the Beagleboard can be found here: [http://download.ronetix.info/peedi/cfg_examples/cortex-a8/omap3530.cfg omap3530.cfg]<br />
<br />
PEEDI has a built-in support for GNU gbd based debuggers and a built-in Flash Programmer.<br />
The Flash Programmer is capable to program:<br />
* NOR Flash devices (over 900)<br />
* NAND and OneNAND Flash devices (small page, larger page, 8/16 bit), various methods of ECC calculation, bad block management.<br />
* DataFlash devices<br />
* SPI DataFlash devices<br />
* images located on a TFTP/FTP/HTTP server or a MMC/SD card (which allows standalone mode).<br />
<br />
The PEEDI package includes also an PEEDI to TI14 adapter and an TI20 to TI14 adapter.<br />
<br />
===Linux Kernel Aware Debugging using PEEDI Emulator===<br />
* For Linux Aware debugging, PEEDI is a great solution. Here is what you will need:<br />
* PEEDI JTAG emulator<br />
* Firmware version 9.8.216 or later<br />
* Arm Insight Debugger available on the Ronetix CDROM<br />
<br />
<I>Note: Enter all commands executed from the Linux Kernel build folder.</I><br />
<br />
====Stopping the Debugger at start_kernel====<br />
* In OMAP3530.CFG, change the hardware breakpoint address in the [INIT_LINUX] section to the address of start_kernel<br />
* To obtain the address of start_kernel, use "nm vmlinux |grep -w start_kernel"<br />
* If your u-boot counts down from 10, you will need to extend the debugger timeout<br />
* Two lines down, change the line to "wait 25000 stop"<br />
* Power up the BeagleBoard and PEEDI<br />
* Let u-boot countdown and load the Linux Kernel<br />
* PEEDI will stop at "start_kernel"<br />
====Launching the Insight Debugger====<br />
* Install the ARM Insight Debbugger from the Ronetix CDROM, which is normally installed in the /opt folder<br />
* From the Linux Kernel build folder type "/opt/arm-linux-4.3.3/bin/arm-linux-insight vmlinux &"<br />
* In the Console Window, type "target remote <xxx.xxx.xxx.xxx>:2000, where <xxx.xxx.xxx.xxx> is the BeagleBoard IP address<br />
* Next, type "ni". The Source Window will load /init/main.c and highlight a line in start_kernel<br />
* Step through the code, or enter breakpoints and run the program. <br />
<br />
====Thread List====<br />
* If you are doing multi-threaded debugging, this feature is invaluable<br />
* The PEEDI config file (OMAP3530.CFG) must be setup to read this info from your kernel<br />
* The information needed by Insight GDB is in the [OS_ARM_LINUX_v26] section<br />
* This information is obtained from the Insight GDB Console Window<br />
* print &init_task ; BASE<br />
* print &((struct task_struct*)0)->tasks.next ; NEXT<br />
* print &((struct task_struct*)0)->pid ; PID<br />
* print &((struct task_struct*)0)->comm ; NAME<br />
* print &((struct task_struct*)0)->stack ; second CONTEXT arg<br />
* print &((struct thread_info*)0)->cpu_context ; third CONTEXT arg<br />
<br />
For Linux Kernel v2.6.29, this section looks something like this:<br />
* BASE = 4, 0xC066B110<br />
* NEXT = 4, -0x1B8<br />
* PID = 4, 0x1E4<br />
* NAME = 16, 0x2DB<br />
* CONTEXT = 10*4, 0x4, 0x1C<br />
<br />
Note: the BASE address will most definitely be different to the one provided here, but the other values should be similar.<br />
<br />
Ronetix technical support is excellent and they added features like the Thread List in just over a week. When I reported what seemed like a bug, they fixed most of them in just a few days. Overall, I am very impressed with the PEEDI emulator and it works great with the BeagleBoard. PEEDI is certainly the most responsive emulator I have worked with and what I like most is it is one of the few that works natively within Linux.<br />
<br />
==ARM Development Studio 5 (DS-5™)==<br />
<br />
The reference software development suite from ARM, [http://www.arm.com/ds5 DS-5], supports JTAG-based debug and ETM trace with Linux kernel awareness on OMAP34XX/OMAP35XX/OMAP36XX/OMAP44XX. For ease of use, it even provides Beagle board and Beagle board xM [http://www.arm.com/products/tools/software-tools/ds-5/ds-5-downloads.php Linux distribution examples].<br />
<br />
=Linux kernel debugging=<br />
<br />
If you like to debug Linux kernel (with one of the above JTAG tools?) using GDB have a look to [[Debugging The Linux Kernel Using Gdb]] article.</div>Guil