<?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 Re: gcc compiling + gdb debugging on Kinetis on a Linux host - Kinetis L Examples available in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/gcc-compiling-gdb-debugging-on-Kinetis-on-a-Linux-host-Kinetis-L/m-p/270459#M9129</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your introduction to using ARM GDB and GCC compiling and debugging on Linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a GUI wrapper for using the Segger J-Link on OS X and Linux. It does what you describe above, but then using buttons et al. It also keeps track of serial numbers, directories and settings pertaining to the target, so you can use it to store information on a number of targets you're working with. Here's a screenshot of it (on Mac OS X) connected to my &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z"&gt;FRDM-KL25Z&lt;/A&gt; :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Schermafbeelding 2014-05-20 om 09.29.36.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43754iFAB3D095513E9717/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermafbeelding 2014-05-20 om 09.29.36.png" alt="Schermafbeelding 2014-05-20 om 09.29.36.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My wrapper runs on Windows/Mac OS X and Linux (64 bit). It can be found at this URL : &lt;A href="http://www.hanese.nl/~ewout/ESE/Downloads/JLinkProgrammer/jlinkprogrammer.php" title="http://www.hanese.nl/~ewout/ESE/Downloads/JLinkProgrammer/jlinkprogrammer.php"&gt;JLink programmer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ewout Boks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2014 07:38:01 GMT</pubDate>
    <dc:creator>ewoutboks</dc:creator>
    <dc:date>2014-05-20T07:38:01Z</dc:date>
    <item>
      <title>gcc compiling + gdb debugging on Kinetis on a Linux host - Kinetis L Examples available</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/gcc-compiling-gdb-debugging-on-Kinetis-on-a-Linux-host-Kinetis-L/m-p/270458#M9128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;A few weeks ago I posted on &lt;A _jive_internal="true" href="https://community.nxp.com/message/367352#367352"&gt;gdb debugging on Kinetis with Segger gdb server on Linux&lt;/A&gt;.&amp;nbsp; &lt;SPAN style="line-height: 1.5em;"&gt;I have a few updates which I am re-posting here as well as new info on available examples with makefiles for compiling/linking with the arm gcc compiler on all these boards - &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL02Z"&gt;FRDM-KL02Z&lt;/A&gt;, &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL05Z"&gt;FRDM-KL05Z&lt;/A&gt;, &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z"&gt;FRDM-KL25Z&lt;/A&gt;, &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL26Z"&gt;FRDM-KL26Z&lt;/A&gt;, and &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL46Z"&gt;FRDM-KL46Z&lt;/A&gt;!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;This is focused on &lt;A href="http://www.segger.com/jlink-gdb-server.html"&gt;Segger GDB Server + J-Link&lt;/A&gt;, but other GDB Server + debug interface should work the same like the &lt;A href="http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320151&amp;amp;CFID=12088589&amp;amp;CFTOKEN=2b13bae071125ce9-073222B7-F75F-2AC5-452B9BA204021516"&gt;P&amp;amp;E GDB Server + USB Multilink&lt;/A&gt;.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;The Segger solution performs very well and is completely *FREE* with FRDM- boards because of the free J-Link app that can be programmed in the board to emulate a J-Link. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;Why use gdb to debug bare-metal code on a microcontroller?&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;The answer is simple.&amp;nbsp; gdb is a widely used open source debugger that you can get for free with the free gcc toolchain.&amp;nbsp; As with many other gnu/Linux command line tools, you have a great deal of control at your fingertips (but there is a learning curve).&amp;nbsp; Eclipse and other GUI debug interfaces such as DDD use gdb under the hood.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;STRONG&gt;How can gdb debug my microcontroller software?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;You might be saying to yourself, “I thought gdb was just for debugging Linux applications?”&amp;nbsp; If you had a target board running Linux, you would use the built-in gdb server running on the target and the gdb client (on the target or remotely on a host) to debug applications.&amp;nbsp; But gdb is not limited to debugging Linux applications.&amp;nbsp; You can debug any embedded software including bare-metal or RTOS software.&amp;nbsp; &lt;SPAN style="line-height: 1.5em;"&gt;With the gdb server solutions for J-Link and P&amp;amp;E, the client and server both run on the host machine.&amp;nbsp; The server handles all the communication to the target board.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Let’s get started… &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;[Note: I'm using Ubuntu 12.04 running in VirtualBox.]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif; text-decoration: underline;"&gt;&lt;STRONG&gt;Install the J-Link App for OpenSDA (on-board debug circuit) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get the latest J-Link app at the Segger website &lt;A href="http://www.segger.com/opensda.html"&gt;here&lt;/A&gt;.&amp;nbsp; See the very bottom section called &lt;STRONG&gt;Getting started with OpenSDA.&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With the USB cable unplugged, hold down the reset button on your FRDM- board and then plug in the USB cable to the OpenSDA usb connector.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The OpenSDA will enumerate as a USB storage drive on your computer.&amp;nbsp; Drop on the J-Link App software (JLink_OpenSDA.sda) onto the drive called BOOTLOADER.&amp;nbsp; Wait a second for it to program.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 45px; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;[Note: I am using VirtualBox which requires that I a select the USB device to be accessed by my guest OS (Ubuntu).&amp;nbsp; I go to Devices…USB Devices…and check the FREESCALE SEMICONDUCTOR INC. OpenSDA MSD APP]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unplug the USB cable, then plug it back in. Now, OpenSDA looks like a J-Link to your computer!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; text-decoration: underline; font-weight: inherit;"&gt;&lt;STRONG&gt;Install GCC &amp;amp; GDB Client&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;(Details at &lt;A href="https://launchpad.net/gcc-arm-embedded" style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-family: inherit, serif;"&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://launchpad.net/gcc-arm-embedded" target="test_blank"&gt;https://launchpad.net/gcc-arm-embedded&lt;/A&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;mac@mac-VirtualBox:/$ &lt;/SPAN&gt;sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;mac@mac-VirtualBox:/$&lt;/SPAN&gt;sudo apt-get update&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;mac@mac-VirtualBox:/$&lt;/SPAN&gt;sudo apt-get install gcc-arm-none-eabi&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif; text-decoration: underline;"&gt;&lt;STRONG&gt;Install Segger GBD Server &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;After clicking to install the pack, Segger asks you to enter the J-Link serial number to get the download.&amp;nbsp; However there is no serial number with the J-Link app for OpenSDA, so they give you the option to download without the serial number.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;See section: “Having a problem finding the serial number?” at the bottom of the page.&amp;nbsp; Click “I do not have a serial number because I own an eval board with J-Link on-board. How can I download J-Link software for it?”&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Get bare-metal software examples&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Martin Kojtal (a.k.a 0xc0170) has created some simple example projects with makefiles for &lt;A href="http://www.freescale.com/webapp/sps/site/taxonomy.jsp?code=KINETIS_L_SERIES"&gt;Kinetis L series&lt;/A&gt; devices at his github repository.&amp;nbsp; Martin uses the standard CMSIS-core files from ARM &amp;amp; Freescale for initialization.&amp;nbsp; The examples typically blink an LED.&amp;nbsp; Accessing the examples is simple with git (which I assume you have installed).&amp;nbsp; Just clone his repository.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Clone the repository in the directory of your choice.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;mac@mac-VirtualBox:/$cd&amp;nbsp; &amp;lt;my_sw&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN&gt;mac@mac-VirtualBox:/$ git clone &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://github.com/0xc0170/kinetis_klxx_gcc"&gt;https://github.com/0xc0170/kinetis_klxx_gcc&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif; text-decoration: underline;"&gt;&lt;STRONG&gt;Build an example&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; background-color: transparent; line-height: 1.5em;"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Go to the directory of the example you want to build &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-size: 10pt; line-height: 1.5em;"&gt;mac@mac-VirtualBox:/$ cd kinetis_klxx_gcc&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background-color: white; line-height: 1.5em;"&gt;mac@mac-VirtualBox:/$ cd gpio_demo_frdmkl25z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compile/link the example with make &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background-color: white; line-height: 1.5em;"&gt;mac@mac-VirtualBox:/$ make &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Go into the build folder to confirm the .elf file is there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background-color: white; line-height: 1.5em;"&gt;mac@mac-VirtualBox:/$ cd build&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;mac@mac-VirtualBox:/$ ls&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif; text-decoration: underline;"&gt;&lt;STRONG&gt;Connect the board and start the gdb server and client&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Note: I am using VirtualBox which requires that I a select the USB device to be accessed by my guest OS (Ubuntu).&amp;nbsp; I go to Devices…USB Devices…and check the SEGGER J-Link]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 10.0pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 10.0pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start the GDB Server &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; background-color: white;"&gt;You can put these connection steps into shell scripts for easier execution.&amp;nbsp; Also, it’s good to first kill the GDB Server if it’s already running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;mac@mac-VirtualBox:/$ killall JLinkGDBServer&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;mac@mac-VirtualBox:/$ JLinkGDBServer -device MKL25z128xxx4 -if SWD -speed 1000 -endian little &amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;For the FRDM-KL25Z, select MKL25z128xxx4 as the device. See list of all Segger supported devices &lt;A href="http://www.segger.com/jlink_supported_devices.html" style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-family: inherit, serif;"&gt;here&lt;/SPAN&gt;&lt;/A&gt;.&amp;nbsp; A couple things to note here: (1) the part numbers use a lowercase “z”. (2) some devices are supported but don’t appear on Segger’s list.&amp;nbsp; These are MKL02z32xxx4, MKL26z128xxx4, &amp;amp; MKL46z128xxx4.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Kinetis L-series devices use SWD for debugging, so that is selected as the interface.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start GDB client&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;mac@mac-VirtualBox:/$&amp;nbsp;&amp;nbsp; arm-none-eabi-gdb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Connect to GDB Server &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;The client and server communicate via the localhost (internal TCP/IP connection) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) target remote localhost: 2331&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load symbols from elf file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) file gpio_demo_frdmkl25z.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Program the flash on the board &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) load gpio_demo_frdmkl25z.elf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; See where you are at in the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) list&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set a breakpoint &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) break main&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;8.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start executing&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) continue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;9.&amp;nbsp;&amp;nbsp;&amp;nbsp; Type Ctrl + C to halt execution&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;10.&amp;nbsp;&amp;nbsp;&amp;nbsp; View registers&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(gdb) info registers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;11.&amp;nbsp;&amp;nbsp;&amp;nbsp; View the stack frames (back trace)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;(gdb) bt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;12.&amp;nbsp;&amp;nbsp;&amp;nbsp; Dump memory to a file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; (gdb) dump srec memory file 0xstart 0xend&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;13.&amp;nbsp;&amp;nbsp;&amp;nbsp; Step into a function&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;(gdb) step&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;14.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Step over a function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;(gdb) next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;15.&amp;nbsp;&amp;nbsp;&amp;nbsp; Type “monitor” before gdbserver commands found in the segger gdb server guide&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) monitor reset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;(gdb) monitor halt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;16.&amp;nbsp;&amp;nbsp;&amp;nbsp; Type ! preceding a bash shell command to execute a command back in the shell&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;(gdb) !ls&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;More testing is needed.&amp;nbsp; I have noticed a few hiccups here and there.&amp;nbsp; More updates to come.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: white;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;Good luck!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 21:57:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/gcc-compiling-gdb-debugging-on-Kinetis-on-a-Linux-host-Kinetis-L/m-p/270458#M9128</guid>
      <dc:creator>macl</dc:creator>
      <dc:date>2013-12-18T21:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: gcc compiling + gdb debugging on Kinetis on a Linux host - Kinetis L Examples available</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/gcc-compiling-gdb-debugging-on-Kinetis-on-a-Linux-host-Kinetis-L/m-p/270459#M9129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your introduction to using ARM GDB and GCC compiling and debugging on Linux.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a GUI wrapper for using the Segger J-Link on OS X and Linux. It does what you describe above, but then using buttons et al. It also keeps track of serial numbers, directories and settings pertaining to the target, so you can use it to store information on a number of targets you're working with. Here's a screenshot of it (on Mac OS X) connected to my &lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z"&gt;FRDM-KL25Z&lt;/A&gt; :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Schermafbeelding 2014-05-20 om 09.29.36.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43754iFAB3D095513E9717/image-size/large?v=v2&amp;amp;px=999" role="button" title="Schermafbeelding 2014-05-20 om 09.29.36.png" alt="Schermafbeelding 2014-05-20 om 09.29.36.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My wrapper runs on Windows/Mac OS X and Linux (64 bit). It can be found at this URL : &lt;A href="http://www.hanese.nl/~ewout/ESE/Downloads/JLinkProgrammer/jlinkprogrammer.php" title="http://www.hanese.nl/~ewout/ESE/Downloads/JLinkProgrammer/jlinkprogrammer.php"&gt;JLink programmer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ewout Boks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2014 07:38:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/gcc-compiling-gdb-debugging-on-Kinetis-on-a-Linux-host-Kinetis-L/m-p/270459#M9129</guid>
      <dc:creator>ewoutboks</dc:creator>
      <dc:date>2014-05-20T07:38:01Z</dc:date>
    </item>
  </channel>
</rss>

