<?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 Debugging MKL02 using Olimex ARM-USB-OCD-H in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-MKL02-using-Olimex-ARM-USB-OCD-H/m-p/489073#M30156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been playing around with some FRDM-KL02 boards, as I want to use the MCU in a board design of my own, but I wanted to make sure I could program it. I can build and compile fine from the KSDK. With CMSIS-DAP on the OpenSDA interface, I am able to program and debug the board correctly through Eclipse (Mars.1) or the KDS (3.1.0) using OpenOCD (0.9.0). However, it is very slow. I have an Olimex ARM-USB-OCD-H that I would like to use, through a JTAG-SWD adapter, and I have bodged together some configuration files for it (I don't really understand the ins and outs of it). From the command line, I can load a .elf onto the board fine, and step through it. If I handle the loading in the .cfg file, disable 'Load executable' in eclipse, and run the .cfg file from eclipse, it will load and allow me to debug exactly as I want (and is much faster than the OpenSDA interface). If I let eclipse handle the loading of the binary however, it reliably ends up in 'UART0_IRQHandler() at startup, before reaching main(), and won't do anything else. This means I have to hard code the path to the binary in the OCD .cfg file for every project, which isn't ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot from 2016-01-14 10_14_37.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/33683iA05A4FBBEACAA3C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot from 2016-01-14 10_14_37.png" alt="Screenshot from 2016-01-14 10_14_37.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to the world of embedded, I've only played around with arduinos a little before, so if anyone has any suggestions on what to try next I would be all ears. Ideally, I'd like to get Eclipse loading the binaries, but I don't know where to start looking to resolve this. Is there any way to see what the settings in Eclipse translate to in terms of OpenOCD commands?&lt;BR /&gt;Alternatively, is there any way to pass the binary path to the .cfg file, so I don't have to go manually hard coding the paths in the .cfgs for every project?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. the current configuration script, a conglomerate of different snippets I found across the internet that seems to work, but I don't know why:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: courier new,courier;"&gt;source [find /opt/IDE/openocd/olimex-arm-usb-ocd-h.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find /opt/IDE/openocd/olimex-arm-jtag-swd.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find /opt/IDE/openocd/frdm-kl02z.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_nsrst_assert_width 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_nsrst_delay 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset_config srst_only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_khz 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; init&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wait_halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mww 0x00000000 0x01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep 200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flash write_image erase /home/ubo/workspace/blink/Debug/blink.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; verify_image /home/ubo/workspace/blink/Debug/blink.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset run&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mdw 0x00000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep 200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_TARGETNAME configure -event gdb-attach {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset run&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jan 2016 10:51:46 GMT</pubDate>
    <dc:creator>georgeaddison</dc:creator>
    <dc:date>2016-01-14T10:51:46Z</dc:date>
    <item>
      <title>Debugging MKL02 using Olimex ARM-USB-OCD-H</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-MKL02-using-Olimex-ARM-USB-OCD-H/m-p/489073#M30156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been playing around with some FRDM-KL02 boards, as I want to use the MCU in a board design of my own, but I wanted to make sure I could program it. I can build and compile fine from the KSDK. With CMSIS-DAP on the OpenSDA interface, I am able to program and debug the board correctly through Eclipse (Mars.1) or the KDS (3.1.0) using OpenOCD (0.9.0). However, it is very slow. I have an Olimex ARM-USB-OCD-H that I would like to use, through a JTAG-SWD adapter, and I have bodged together some configuration files for it (I don't really understand the ins and outs of it). From the command line, I can load a .elf onto the board fine, and step through it. If I handle the loading in the .cfg file, disable 'Load executable' in eclipse, and run the .cfg file from eclipse, it will load and allow me to debug exactly as I want (and is much faster than the OpenSDA interface). If I let eclipse handle the loading of the binary however, it reliably ends up in 'UART0_IRQHandler() at startup, before reaching main(), and won't do anything else. This means I have to hard code the path to the binary in the OCD .cfg file for every project, which isn't ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Screenshot from 2016-01-14 10_14_37.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/33683iA05A4FBBEACAA3C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot from 2016-01-14 10_14_37.png" alt="Screenshot from 2016-01-14 10_14_37.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to the world of embedded, I've only played around with arduinos a little before, so if anyone has any suggestions on what to try next I would be all ears. Ideally, I'd like to get Eclipse loading the binaries, but I don't know where to start looking to resolve this. Is there any way to see what the settings in Eclipse translate to in terms of OpenOCD commands?&lt;BR /&gt;Alternatively, is there any way to pass the binary path to the .cfg file, so I don't have to go manually hard coding the paths in the .cfgs for every project?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. the current configuration script, a conglomerate of different snippets I found across the internet that seems to work, but I don't know why:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: courier new,courier;"&gt;source [find /opt/IDE/openocd/olimex-arm-usb-ocd-h.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find /opt/IDE/openocd/olimex-arm-jtag-swd.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; source [find /opt/IDE/openocd/frdm-kl02z.cfg]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_nsrst_assert_width 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_nsrst_delay 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset_config srst_only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; adapter_khz 500&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; init&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wait_halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mww 0x00000000 0x01&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep 200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flash write_image erase /home/ubo/workspace/blink/Debug/blink.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; verify_image /home/ubo/workspace/blink/Debug/blink.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset run&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mdw 0x00000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep 200&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_TARGETNAME configure -event gdb-attach {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reset run&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 10:51:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Debugging-MKL02-using-Olimex-ARM-USB-OCD-H/m-p/489073#M30156</guid>
      <dc:creator>georgeaddison</dc:creator>
      <dc:date>2016-01-14T10:51:46Z</dc:date>
    </item>
  </channel>
</rss>

