<?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: Debug and run programs in FRDM-KL82Z in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698956#M9136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I will try this afternoon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, its weird because yesterday I get it working for a few times. Its like it depends on what I flash before. I was trying using KSDK 1.3, then 2.2, different project settings... The same project sometime works, sometimes it doesn't... Maybe its a problem with the Jlink software? If I flash the same code and run it without debug it works, and I read that in some processors the j-link forget to turn on some clock or something like that... Also this would explain why sometimes it works (if some register is not clear on debug and was previously set correctly may result in the debug working...) I am just throwing some ideas...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am just uploading the code without debug and using printf to debug (old-school debugging).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Aug 2017 07:37:46 GMT</pubDate>
    <dc:creator>angelgz</dc:creator>
    <dc:date>2017-08-16T07:37:46Z</dc:date>
    <item>
      <title>Debug and run programs in FRDM-KL82Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698954#M9134</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;I am having trouble trying to debug and run a program in my FRDM-KL82Z. I have followed all the steps in the guide online:&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Installed the SDK 2.0 with the wizard for the kinetis design studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;- I have the jlink bootloader loaded in the board.&lt;/P&gt;&lt;P&gt;- I import one of the examples of the SDK ( ../boards\frdmkl82z\demo_apps\bubble\kds )&lt;/P&gt;&lt;P&gt;- I build the project with 0 errors:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Building target: bubble_frdmkl82z.elf&lt;BR /&gt;Invoking: Cross ARM C++ Linker&lt;BR /&gt;arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -mfloat-abi=soft -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-common -ffreestanding -fno-builtin -Wall -g -T ../settings/MKL82Z128xxx7_flash.ld -Xlinker --gc-sections -Wl,-Map,"bubble_frdmkl82z.map" --specs=nano.specs -mapcs -Xlinker -static -Xlinker -z -Xlinker muldefs -o "bubble_frdmkl82z.elf" -Xlinker --start-group ./utilities/fsl_debug_console.o ./startup/startup_MKL82Z7.o ./startup/system_MKL82Z7.o ./source/bubble.o ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_flash.o ./drivers/fsl_gpio.o ./drivers/fsl_i2c.o ./drivers/fsl_lpuart.o ./drivers/fsl_smc.o ./drivers/fsl_tpm.o ./board/board.o ./board/clock_config.o ./board/pin_mux.o ./accel/fsl_fxos.o -lm -lg -lgcc -lnosys -Xlinker --end-group&lt;BR /&gt;Finished building target: bubble_frdmkl82z.elf&lt;/P&gt;&lt;P&gt;12:59:37 Build Finished (took 1s.532ms)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- I launch the debug with the following configuration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21672i3318BCD0D77A7068/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when the debug perpective open, the program is already running ( I dont have to press startand the program is supposed to start as halted)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21709i936194560D8CEBBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I pause the program is always in this state:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21743iA5BD7C15D6F2EF72/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Angel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 11:33:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698954#M9134</guid>
      <dc:creator>angelgz</dc:creator>
      <dc:date>2017-08-15T11:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Debug and run programs in FRDM-KL82Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698955#M9135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Angel,&lt;/P&gt;&lt;P&gt;- Have you set breakpoint at main :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20728i237C2C3A9373A96D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- Please try to switch another new workspace to have a try, or test another project.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/20769i8F4587AE5B571344/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 06:46:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698955#M9135</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2017-08-16T06:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Debug and run programs in FRDM-KL82Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698956#M9136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I will try this afternoon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, its weird because yesterday I get it working for a few times. Its like it depends on what I flash before. I was trying using KSDK 1.3, then 2.2, different project settings... The same project sometime works, sometimes it doesn't... Maybe its a problem with the Jlink software? If I flash the same code and run it without debug it works, and I read that in some processors the j-link forget to turn on some clock or something like that... Also this would explain why sometimes it works (if some register is not clear on debug and was previously set correctly may result in the debug working...) I am just throwing some ideas...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am just uploading the code without debug and using printf to debug (old-school debugging).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 07:37:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698956#M9136</guid>
      <dc:creator>angelgz</dc:creator>
      <dc:date>2017-08-16T07:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Debug and run programs in FRDM-KL82Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698957#M9137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Angel,&lt;/P&gt;&lt;P&gt;- If you worry about the project flashed impacting the new project, please&lt;/P&gt;&lt;P&gt;erase the flash use j-link commander (can download at &lt;SPAN style="font-size: 11.0pt;"&gt;&lt;SPAN&gt;to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.segger.com" rel="nofollow" target="_blank"&gt;https://www.segger.com&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp; ), and&lt;/P&gt;&lt;P&gt;see the attached video created by my colleague .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Yes, if download many times, it maybe occur some problem, you can also delete the .metadata folder under&lt;/P&gt;&lt;P&gt;workspace :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21327i3E4B38C5324EC1EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 09:41:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698957#M9137</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2017-08-16T09:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Debug and run programs in FRDM-KL82Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698958#M9138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have just found a solution. I checked the breakpoint at main and it was already set, I tried switching workspace but the debugger keeps faulting. The solution was to start the debugging: It will start in the same status as stated in the first post (with a hard fault) but, if I press the reset button while in that state, the debug start working as normal. I show it in pictures for anyone that has my same problem.&lt;/P&gt;&lt;P&gt;Start the debugger, here the program seems to be working but it is not. If you pause it, you will see it is in the Hardfault ISR.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/24175i96A6876371381E15/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press the reset button of the FRDM-KL82Z: The debugger get into the correct status :smileygrin:&amp;nbsp;:smileygrin:&amp;nbsp;:smileygrin:&amp;nbsp;:smileygrin:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/24216iFCF94871B8AD6685/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Press play and enjoy :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this help some other folks around there :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See you and thank you very much!&lt;/P&gt;&lt;P&gt;Angel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2017 19:42:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Debug-and-run-programs-in-FRDM-KL82Z/m-p/698958#M9138</guid>
      <dc:creator>angelgz</dc:creator>
      <dc:date>2017-08-16T19:42:29Z</dc:date>
    </item>
  </channel>
</rss>

