<?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: Hard_Fault during debugging in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581719#M13282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally the problem with my global variable 'Labyrinth[240][320]' is solved.&lt;/P&gt;&lt;P&gt;Now i get no 'hard_fault'.&lt;/P&gt;&lt;P&gt;My idea was this:&lt;/P&gt;&lt;P&gt;I changed the size of my global variable from 240x320 to 24x32. Besides i created a resize factor (=10).&lt;/P&gt;&lt;P&gt;Now each position of my minimized global variable represents a 10x10 array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it and it works very fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Armend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Sep 2016 13:22:18 GMT</pubDate>
    <dc:creator>armendgecaj</dc:creator>
    <dc:date>2016-09-04T13:22:18Z</dc:date>
    <item>
      <title>Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581714#M13277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am working with CodeWarrior for MCU v10.6 and with the Kinetis K60F (MK60FN1M0).&lt;/P&gt;&lt;P&gt;I have a question. Maybe someone can give me a hint.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i build my algorithm in CodeWarrior then i get&amp;nbsp;no errors. But if i debugg it then i branch&amp;nbsp;in a hard_fault.&lt;/P&gt;&lt;P&gt;The Problem is, the hard_fault occurs not during the&amp;nbsp;execution&amp;nbsp;of my algorithm. It occurs during downloading my algorithm to my microcontroller. Therefore, it is difficult to find&amp;nbsp;the location where the hard_fault occured.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried also the 'HardFault' Component from Erich to get the location but it does not help, because&amp;nbsp;my project is not executing.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have someone any idea how to find out the problem?&lt;/P&gt;&lt;P&gt;Or can anybody tell me what can cause a hard_fault during downloading a project?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not think&amp;nbsp;that the problem is&amp;nbsp;a command in my algorithm because the hard_fault does not occur during the execution.&lt;/P&gt;&lt;P&gt;It have to be something else.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be grateful for any help.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Armend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:50:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581714#M13277</guid>
      <dc:creator>armendgecaj</dc:creator>
      <dc:date>2016-09-01T17:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581715#M13278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Armend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a lot of possibilities the project run to " hard_fault",&lt;/P&gt;&lt;P&gt;for examplenot enable the clock of one peripheral , while directly use it ;&lt;/P&gt;&lt;P&gt;or the wrong interrupt vector; or select the wrong chip when download ;&lt;/P&gt;&lt;P&gt;Or the wrong parameter when call one function , and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recommend you debug step one by one ,check when run which code , it run to hard_fault.&lt;/P&gt;&lt;P&gt;Or you can also send your project to me , i help you debug on my side .&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;BR /&gt;Have a great day,&lt;BR /&gt;Alice&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>Fri, 02 Sep 2016 02:11:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581715#M13278</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-09-02T02:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581716#M13279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Armend&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=""&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;First, please open ‘Project Properties’, then go to ‘Run/Debug Settings’. &amp;nbsp;&amp;nbsp;Choose your launch configuration and under ‘Debugger’ tab, set ‘Stop on start at’ option as ‘Program entry point’.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="entry point.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/4176iD7424A1F37309B55/image-size/large?v=v2&amp;amp;px=999" role="button" title="entry point.png" alt="entry point.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then start downloading program again, the debugger will hate at the entry point. You can step into the program to find out the problem. &amp;nbsp;For how to find out the root cause, you may refer to:&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/"&gt;https://mcuoneclipse.com/2012/11/24/debugging-hard-faults-on-arm-cortex-m/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/"&gt;https://mcuoneclipse.com/2012/12/28/a-processor-expert-component-to-help-with-hard-faults/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2015/07/05/debugging-arm-cortex-m-hard-faults-with-gdb-custom-command/"&gt;https://mcuoneclipse.com/2015/07/05/debugging-arm-cortex-m-hard-faults-with-gdb-custom-command/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;BR /&gt;Fiona Kuang&lt;BR /&gt;TIC - Technical Information Center&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Mark Correct button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581716#M13279</guid>
      <dc:creator>TICS_Fiona</dc:creator>
      <dc:date>2016-09-02T07:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581717#M13280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You&amp;nbsp;you recommend me to run my project step by step and to look at which command&amp;nbsp;it runs to a hard_fault.&lt;/P&gt;&lt;P&gt;Thats a good idea, but it does not work for me because i do not come till running my project. I get a hard_fault before i can run my project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i had another idea. I uncomment all my commands in my function. Then i canceled it again for single commands and debugged my project at every step.&lt;/P&gt;&lt;P&gt;I found the following:&lt;/P&gt;&lt;P&gt;My global variable is called: int Labyrinth[240][320]&lt;/P&gt;&lt;P&gt;In my function i fill my global variable. But if i do that i get a hard_fault&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example, see the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;int Labyrinth[240][320];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;void fill (void)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int i, j;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(i = 0; i &amp;lt; 240; i++)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(j = 0; j &amp;lt; 320; j++)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Labyrinth[ i ][ j ] = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//At this command i will get a hard_fault (If i comment&amp;nbsp;this command out then i get no hard_fault)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if i decrease my global variable to (for example) "int Labyrinth[100][100]", then i get no hard_fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i think&amp;nbsp;my global variable is to big.&lt;/P&gt;&lt;P&gt;I thought if i enlarge my 'm_data' then it should not be a problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But maybe only enlarging 'm_data' do not help very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i do not enlarge 'm_data' then i get a overflowed-error (because of Labyrinth[240][320]).&lt;/P&gt;&lt;P&gt;If i enlarge 'm_data' then i get no overflowed-error but a hard_fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you any idea how i can work with such big global variables?&lt;/P&gt;&lt;P&gt;Becaues i need Labyrinth[240][320] to show a randomly generated maze on my LCD-Dispaly (my DIsplay have 240x320 pixel).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Armend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:51:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581717#M13280</guid>
      <dc:creator>armendgecaj</dc:creator>
      <dc:date>2016-09-02T07:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581718#M13281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kuang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you. I will try it.&lt;/P&gt;&lt;P&gt;But perhaps i have already found the problem. I think my global variable is to big (Labyrinth[240][320]).&lt;/P&gt;&lt;P&gt;If i decrease my global variable then i get no hard_fault.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I explained it in my answer to Alice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the question is, is it possible to work with such big global variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Armend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 08:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581718#M13281</guid>
      <dc:creator>armendgecaj</dc:creator>
      <dc:date>2016-09-02T08:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Hard_Fault during debugging</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581719#M13282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally the problem with my global variable 'Labyrinth[240][320]' is solved.&lt;/P&gt;&lt;P&gt;Now i get no 'hard_fault'.&lt;/P&gt;&lt;P&gt;My idea was this:&lt;/P&gt;&lt;P&gt;I changed the size of my global variable from 240x320 to 24x32. Besides i created a resize factor (=10).&lt;/P&gt;&lt;P&gt;Now each position of my minimized global variable represents a 10x10 array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried it and it works very fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Armend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Sep 2016 13:22:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Hard-Fault-during-debugging/m-p/581719#M13282</guid>
      <dc:creator>armendgecaj</dc:creator>
      <dc:date>2016-09-04T13:22:18Z</dc:date>
    </item>
  </channel>
</rss>

