<?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>Kinetis MicrocontrollersのトピックRe: SPI Interrupts Secretly Halting Program in Debug Mode</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158698#M58255</link>
    <description>&lt;P&gt;My stack size is 512B. I opened up the stack/heap monitor and stepped through and it never exceeded 29% usage. After stepping through more I can see it really just looks like SPI interrupts are halting the program. The weird thing is the debugger shows it still running, but when I press pause on it it is always in the same spi interrupt function and steps through normally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another bizzare note: if I flash the chip (no debugger attached) while it is running, it will actually run normally. If I reset that chip it doesn't seem to boot up. But if I flash it again with the same firmware it starts running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The picture below is what the stack looks like when I press pause to see where it is halting on its own.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dave_harmonjr_0-1600950885262.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/126119i3F72008D724EB46E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dave_harmonjr_0-1600950885262.png" alt="dave_harmonjr_0-1600950885262.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 13:13:38 GMT</pubDate>
    <dc:creator>dave_harmonjr</dc:creator>
    <dc:date>2020-09-24T13:13:38Z</dc:date>
    <item>
      <title>SPI Interrupts Secretly Halting Program in Debug Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158027#M58236</link>
      <description>&lt;P&gt;I am using an MKE04Z1284 mcu. I have a program that I wrote to try and get SPI coms working between it and another processor. The MKE04 is a slave fyi. The code right now runs all the init functions, then it turns a gpio on to flag to the other processor it wants to send a message via spi. Just before it does that, it runs the function "SPI_SlaveTransferNonBlocking" to load up the spi register for the incoming clock signals from the master to get the byte. This causes&amp;nbsp;SPI1_DriverIRQHandler to go off. When it does this the program halts at&amp;nbsp;SPI1_DriverIRQHandler and does not continue unless I press the pause debugger button and manually step it through. Even stranger it seems to do this for literally every function in the custom spi send function I have because spi interrupts keep going off throughout the function. This is causing it to be impossible to debug. It wasn't doing this previously and I have no idea what I could have done to cause it and I have spent hours researching this and haven't gotten anywhere.&lt;/P&gt;&lt;P&gt;Other notes: There are no breakpoints at all. I have tried both PEMicro and JLinks. Also have restarted the pc, restarted the program, rebuilt, cleaned, restarted the debugger interfaces etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I build it as release and use the flash programmer to program on the release version it runs perfectly fine with no halting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the project.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 19:43:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158027#M58236</guid>
      <dc:creator>dave_harmonjr</dc:creator>
      <dc:date>2020-09-23T19:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interrupts Secretly Halting Program in Debug Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158265#M58243</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/112181"&gt;@dave_harmonjr&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;What is the size of your stack?&amp;nbsp; I think you might have blown the stack and it is pointing to Non-SRAM memory which is why it's halting.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not familiar with the&amp;nbsp;&lt;SPAN&gt;MKE04Z1284, but if it was in the K22 family, I would expect to get a semi-host hardfault (which you might be getting but there isn't a handler for it).&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What happens if you single step out of the ISR?&amp;nbsp; If my suspicion is correct, the code will jump to somewhere outside of the Flash memory range.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Good luck,&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 03:00:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158265#M58243</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2020-09-24T03:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interrupts Secretly Halting Program in Debug Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158698#M58255</link>
      <description>&lt;P&gt;My stack size is 512B. I opened up the stack/heap monitor and stepped through and it never exceeded 29% usage. After stepping through more I can see it really just looks like SPI interrupts are halting the program. The weird thing is the debugger shows it still running, but when I press pause on it it is always in the same spi interrupt function and steps through normally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another bizzare note: if I flash the chip (no debugger attached) while it is running, it will actually run normally. If I reset that chip it doesn't seem to boot up. But if I flash it again with the same firmware it starts running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The picture below is what the stack looks like when I press pause to see where it is halting on its own.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dave_harmonjr_0-1600950885262.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/126119i3F72008D724EB46E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dave_harmonjr_0-1600950885262.png" alt="dave_harmonjr_0-1600950885262.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 13:13:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158698#M58255</guid>
      <dc:creator>dave_harmonjr</dc:creator>
      <dc:date>2020-09-24T13:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Interrupts Secretly Halting Program in Debug Mode</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158818#M58257</link>
      <description>&lt;P&gt;I solved the issue. A stray strand of wire was bridging the CS line to ground which was causing that SPI Interrupt to go off relentlessly. Once I removed that it stopped getting jammed up after calling the spi transfer function once.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 17:50:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/SPI-Interrupts-Secretly-Halting-Program-in-Debug-Mode/m-p/1158818#M58257</guid>
      <dc:creator>dave_harmonjr</dc:creator>
      <dc:date>2020-09-24T17:50:14Z</dc:date>
    </item>
  </channel>
</rss>

