<?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: debugging troubles! in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257738#M9846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you mean the chip, yes I selected the correct one which is MKL46Z4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Dec 2013 14:15:53 GMT</pubDate>
    <dc:creator>taha-yassineelh</dc:creator>
    <dc:date>2013-12-13T14:15:53Z</dc:date>
    <item>
      <title>debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257734#M9842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hy ;&lt;/P&gt;&lt;P&gt;Help please, while debugging it jumps always to " kinetis_sysinit.c " and stays at :&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; /**===========================================================================&lt;/P&gt;&lt;P&gt; **&amp;nbsp; Default interrupt handler&lt;/P&gt;&lt;P&gt; **===========================================================================&lt;/P&gt;&lt;P&gt; */&lt;/P&gt;&lt;P&gt;void Default_Handler()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; __asm("bkpt");&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/**&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 14:18:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257734#M9842</guid>
      <dc:creator>taha-yassineelh</dc:creator>
      <dc:date>2013-12-12T14:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257735#M9843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taha-Yassine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can run your code step-by-step and verify the exact offending instruction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possible cause is that you are writing to a register of some module which has clock gate not enabled. Or maybe you enabled an interrupt but did not declare the proper interrupt service routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Please provide more details about your project/setup/code so we can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 23:41:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257735#M9843</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2013-12-12T23:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257736#M9844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ever met the similar problem if i select the wrong part number. can you please also check this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 03:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257736#M9844</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-12-13T03:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257737#M9845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all I realy appreciate your help. I try to write a code that make bilink the both LEDs (green and red) of the FRDM-KL46Z and I think that my startup routine handles all configs needed to make the code work, such as clock gating, pins direction....&lt;/P&gt;&lt;P&gt;I dont wont want bother you by the entire code so this is juste the start-up routing and some defines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "derivative.h" &lt;/P&gt;&lt;P&gt;#define RED_LED_LOC (1&amp;lt;&amp;lt;27)&lt;/P&gt;&lt;P&gt;#define GREEN_LED_LOC (1&amp;lt;&amp;lt;5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void delay(int a)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; int i;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i=0;i&amp;lt;a;i++) &lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_COPC = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Disable the watchdog timer */&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM_SCGC5 |= (SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTD_MASK);&amp;nbsp;&amp;nbsp; /*clock gating*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD_PCR5 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK) ;&amp;nbsp; /*module selection*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTE_PCR27 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK) ;&amp;nbsp;&amp;nbsp; /*module selection*/&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOD_PDDR |= RED_LED_LOC; /*Pins direction*/&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | it jumps just before executing this line&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOE_PDDR |= GREEN_LED_LOC; /*Pins direction*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you, and sorry for the english :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 14:07:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257737#M9845</guid>
      <dc:creator>taha-yassineelh</dc:creator>
      <dc:date>2013-12-13T14:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257738#M9846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you mean the chip, yes I selected the correct one which is MKL46Z4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 14:15:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257738#M9846</guid>
      <dc:creator>taha-yassineelh</dc:creator>
      <dc:date>2013-12-13T14:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257739#M9847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, your code shows that you enable &lt;STRONG&gt;PORTB&lt;/STRONG&gt; and &lt;STRONG&gt;PORTD&lt;/STRONG&gt;, but then you are writing to &lt;STRONG&gt;PORTD&lt;/STRONG&gt; and &lt;STRONG&gt;PORTE&lt;/STRONG&gt; registers, so do not seems like you are enabling clock gate for &lt;STRONG&gt;PORTE&lt;/STRONG&gt;. In that case debugger would jump to default handler when trying to execute next instruction:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PORTE_PCR27 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK) ;&amp;nbsp;&amp;nbsp; /*module selection*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hope this helps :smileyhappy:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Jorge Gonzalez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 15:10:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257739#M9847</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2013-12-13T15:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: debugging troubles!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257740#M9848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was about to lose my mind, you're a lifesaver man! :smileyhappy: &lt;/P&gt;&lt;P&gt;thank you so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2013 16:07:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/debugging-troubles/m-p/257740#M9848</guid>
      <dc:creator>taha-yassineelh</dc:creator>
      <dc:date>2013-12-13T16:07:47Z</dc:date>
    </item>
  </channel>
</rss>

