<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic IOTDK+OpenOCD+OLIMEX+Linux Userspace Debugging in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/IOTDK-OpenOCD-OLIMEX-Linux-Userspace-Debugging/m-p/1024187#M39443</link>
    <description>&lt;P&gt;I'm trying to get OCD working with the IOTDK to debug Userspace programs via JTAG. &amp;nbsp;I know it has been done with the Kernel and I did use the intel documentation on the subject as a starting point. &amp;nbsp;However, debugging the kernel is slightly (maybe more than slightly) different. &amp;nbsp;I suppose debugging 1_c_helloworld is more akin to debugging a kernel module as it is located where the Kernel decides to put it at run time and runs under a process created by the kernel.&lt;/P&gt;

&lt;P&gt;I had no real problem getting OpenOCD to talk with GDB. &amp;nbsp;Here's some evidence:&lt;/P&gt;

&lt;P&gt;Info : 274 252 server.c:83 add_connection(): accepting 'gdb' connection from 3333&lt;BR /&gt;
	Debug: 275 252 breakpoints.c:359 breakpoint_clear_target_internal(): Delete all breakpoints for target: quark_x10xx.cpu&lt;BR /&gt;
	Debug: 276 252 breakpoints.c:499 watchpoint_clear_target(): Delete all watchpoints for target: quark_x10xx.cpu&lt;BR /&gt;
	Debug: 277 252 target.c:1401 target_call_event_callbacks(): target event 23 (gdb-attach)&lt;BR /&gt;
	Debug: 278 252 gdb_server.c:986 gdb_new_connection(): New GDB Connection: 1, Target quark_x10xx.cpu, state: running&lt;BR /&gt;
	Debug: 279 252 gdb_server.c:2662 gdb_input_inner(): received packet: 'qSupported:multiprocess+;xmlRegisters=i386;qRelocInsn+'&lt;/P&gt;

&lt;P&gt;But things go south pretty quick from there. &amp;nbsp;First thing that looks really fishy is this:&lt;/P&gt;

&lt;P&gt;Debug: 356 253 gdb_server.c:2662 gdb_input_inner(): received packet: 'QStartNoAckMode'&lt;BR /&gt;
	Debug: 357 254 gdb_server.c:632 gdb_get_packet_inner(): Received first acknowledgment after entering noack mode. Ignoring it.&lt;BR /&gt;
	Debug: 358 254 gdb_server.c:2662 gdb_input_inner(): received packet: 'Hg0'&lt;BR /&gt;
	Debug: 359 254 gdb_server.c:2662 gdb_input_inner(): received packet: 'qXfer:features:read:target.xml:0,fff'&lt;/P&gt;

&lt;P&gt;OpenOCD responds with the Register Set (all set to zero which is fairly odd)&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;and then spits out &amp;nbsp;a load of these:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Debug: 518 265 x86_32_common.c:86 x86_32_get_gdb_reg_list(): value pmcr = 00000000&lt;BR /&gt;
	Error: 519 265 lakemont.c:220 check_not_halted(): target running, halt it first&lt;BR /&gt;
	Error: 520 265 lakemont.c:220 check_not_halted(): target running, halt it first&lt;/P&gt;

&lt;P&gt;There are 75 of these errors and there are 75 registers so I suppose that are correlated. &amp;nbsp;Anyway things don't get better and it is clear later on in the debug output of OpenOCD that GDB thinks it is debugging code at address 0. &amp;nbsp;That can't be right. &amp;nbsp;And the thread ID of 0 in the 'Hg0' command is a bit suspicious.&lt;/P&gt;

&lt;P&gt;Anybody else tried this shenanigan or am I the only one fool enough?&lt;/P&gt;

&lt;P&gt;Thanx for any insight,&lt;/P&gt;

&lt;P&gt;Dallas&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Oct 2014 19:52:00 GMT</pubDate>
    <dc:creator>Dallas_P_</dc:creator>
    <dc:date>2014-10-14T19:52:00Z</dc:date>
    <item>
      <title>IOTDK+OpenOCD+OLIMEX+Linux Userspace Debugging</title>
      <link>https://community.intel.com/t5/Software-Archive/IOTDK-OpenOCD-OLIMEX-Linux-Userspace-Debugging/m-p/1024187#M39443</link>
      <description>&lt;P&gt;I'm trying to get OCD working with the IOTDK to debug Userspace programs via JTAG. &amp;nbsp;I know it has been done with the Kernel and I did use the intel documentation on the subject as a starting point. &amp;nbsp;However, debugging the kernel is slightly (maybe more than slightly) different. &amp;nbsp;I suppose debugging 1_c_helloworld is more akin to debugging a kernel module as it is located where the Kernel decides to put it at run time and runs under a process created by the kernel.&lt;/P&gt;

&lt;P&gt;I had no real problem getting OpenOCD to talk with GDB. &amp;nbsp;Here's some evidence:&lt;/P&gt;

&lt;P&gt;Info : 274 252 server.c:83 add_connection(): accepting 'gdb' connection from 3333&lt;BR /&gt;
	Debug: 275 252 breakpoints.c:359 breakpoint_clear_target_internal(): Delete all breakpoints for target: quark_x10xx.cpu&lt;BR /&gt;
	Debug: 276 252 breakpoints.c:499 watchpoint_clear_target(): Delete all watchpoints for target: quark_x10xx.cpu&lt;BR /&gt;
	Debug: 277 252 target.c:1401 target_call_event_callbacks(): target event 23 (gdb-attach)&lt;BR /&gt;
	Debug: 278 252 gdb_server.c:986 gdb_new_connection(): New GDB Connection: 1, Target quark_x10xx.cpu, state: running&lt;BR /&gt;
	Debug: 279 252 gdb_server.c:2662 gdb_input_inner(): received packet: 'qSupported:multiprocess+;xmlRegisters=i386;qRelocInsn+'&lt;/P&gt;

&lt;P&gt;But things go south pretty quick from there. &amp;nbsp;First thing that looks really fishy is this:&lt;/P&gt;

&lt;P&gt;Debug: 356 253 gdb_server.c:2662 gdb_input_inner(): received packet: 'QStartNoAckMode'&lt;BR /&gt;
	Debug: 357 254 gdb_server.c:632 gdb_get_packet_inner(): Received first acknowledgment after entering noack mode. Ignoring it.&lt;BR /&gt;
	Debug: 358 254 gdb_server.c:2662 gdb_input_inner(): received packet: 'Hg0'&lt;BR /&gt;
	Debug: 359 254 gdb_server.c:2662 gdb_input_inner(): received packet: 'qXfer:features:read:target.xml:0,fff'&lt;/P&gt;

&lt;P&gt;OpenOCD responds with the Register Set (all set to zero which is fairly odd)&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;and then spits out &amp;nbsp;a load of these:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Debug: 518 265 x86_32_common.c:86 x86_32_get_gdb_reg_list(): value pmcr = 00000000&lt;BR /&gt;
	Error: 519 265 lakemont.c:220 check_not_halted(): target running, halt it first&lt;BR /&gt;
	Error: 520 265 lakemont.c:220 check_not_halted(): target running, halt it first&lt;/P&gt;

&lt;P&gt;There are 75 of these errors and there are 75 registers so I suppose that are correlated. &amp;nbsp;Anyway things don't get better and it is clear later on in the debug output of OpenOCD that GDB thinks it is debugging code at address 0. &amp;nbsp;That can't be right. &amp;nbsp;And the thread ID of 0 in the 'Hg0' command is a bit suspicious.&lt;/P&gt;

&lt;P&gt;Anybody else tried this shenanigan or am I the only one fool enough?&lt;/P&gt;

&lt;P&gt;Thanx for any insight,&lt;/P&gt;

&lt;P&gt;Dallas&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 19:52:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/IOTDK-OpenOCD-OLIMEX-Linux-Userspace-Debugging/m-p/1024187#M39443</guid>
      <dc:creator>Dallas_P_</dc:creator>
      <dc:date>2014-10-14T19:52:00Z</dc:date>
    </item>
    <item>
      <title>Hi Dallas,</title>
      <link>https://community.intel.com/t5/Software-Archive/IOTDK-OpenOCD-OLIMEX-Linux-Userspace-Debugging/m-p/1024188#M39444</link>
      <description>&lt;P&gt;Hi Dallas,&lt;/P&gt;

&lt;P&gt;I can confirm that OpenOCD works with the Galileo &amp;nbsp;- I have personally used it to debug firmware and kernel.&lt;BR /&gt;
	I assume you are using a Galileo?&lt;/P&gt;

&lt;P&gt;It is interesting that you want to use JTAG debugging for user space - I am curious why, would you mind sharing?&lt;/P&gt;

&lt;P&gt;I thought it would be much easier to use gdb on the target?&lt;BR /&gt;
	If you want to debug remotely&amp;nbsp;gdbserver on the Galileo and connect to that is also an option, which should be easier to get going.&lt;/P&gt;

&lt;P&gt;If you want to get OpenOCD going, can you tell us what version of tools you are using &amp;nbsp;(OpenOCD, ... , gdb, what host OS)? What JTAG probe do you have? USB drivers?&lt;/P&gt;

&lt;P&gt;We may be able to find out if there are any known issues.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Paul&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Nov 2014 18:06:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/IOTDK-OpenOCD-OLIMEX-Linux-Userspace-Debugging/m-p/1024188#M39444</guid>
      <dc:creator>Paul_F_Intel</dc:creator>
      <dc:date>2014-11-04T18:06:35Z</dc:date>
    </item>
  </channel>
</rss>

