<?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 Fill unused flash with invalid instruction in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805261#M2835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;My binary images don't occupy the whole flash memory and they come with holes too, so I would like to fill them with some kind of value that makes the mcu reset if executed by accident.&lt;/P&gt;&lt;P&gt;It needs to work with S32K14x family, but if it works with S32K11x is a bonus.&lt;/P&gt;&lt;P&gt;I followed this thread &lt;A href="https://community.nxp.com/thread/453969"&gt;https://community.nxp.com/thread/453969&lt;/A&gt; but now I'm unsure about which value I should use.&lt;/P&gt;&lt;P&gt;I have found the UDF instruction to be a good candidate, but I don't understand the difference between its T1 (16bit) and T2 (32bit) encodings.&lt;/P&gt;&lt;P&gt;is the T1 version (0xDExx) ok for my purposes?&lt;/P&gt;&lt;P&gt;Are there any flaws with this approach?&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Dec 2018 10:19:42 GMT</pubDate>
    <dc:creator>riccardolalli</dc:creator>
    <dc:date>2018-12-17T10:19:42Z</dc:date>
    <item>
      <title>Fill unused flash with invalid instruction</title>
      <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805261#M2835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;My binary images don't occupy the whole flash memory and they come with holes too, so I would like to fill them with some kind of value that makes the mcu reset if executed by accident.&lt;/P&gt;&lt;P&gt;It needs to work with S32K14x family, but if it works with S32K11x is a bonus.&lt;/P&gt;&lt;P&gt;I followed this thread &lt;A href="https://community.nxp.com/thread/453969"&gt;https://community.nxp.com/thread/453969&lt;/A&gt; but now I'm unsure about which value I should use.&lt;/P&gt;&lt;P&gt;I have found the UDF instruction to be a good candidate, but I don't understand the difference between its T1 (16bit) and T2 (32bit) encodings.&lt;/P&gt;&lt;P&gt;is the T1 version (0xDExx) ok for my purposes?&lt;/P&gt;&lt;P&gt;Are there any flaws with this approach?&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2018 10:19:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805261#M2835</guid>
      <dc:creator>riccardolalli</dc:creator>
      <dc:date>2018-12-17T10:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Fill unused flash with invalid instruction</title>
      <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805262#M2836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Riccardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you considered using Memory Protection Unit?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 13:56:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805262#M2836</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-12-19T13:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Fill unused flash with invalid instruction</title>
      <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805263#M2837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel,&lt;/P&gt;&lt;P&gt;Thanks for the support.&lt;/P&gt;&lt;P&gt;I didn't think about MPU! However I was thinking of filling empty space with some data pattern because I also need to compute a checksum over the image so I thought I could kill two birds with one stone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2018 09:16:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805263#M2837</guid>
      <dc:creator>riccardolalli</dc:creator>
      <dc:date>2018-12-20T09:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Fill unused flash with invalid instruction</title>
      <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805264#M2838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Riccardo,&lt;/P&gt;&lt;P&gt;I don't think there is a standard for this.&lt;/P&gt;&lt;P&gt;But AN4779&amp;nbsp;EMC Design Tips for Kinetis E&amp;nbsp;Family, Cortex M0+, recommends the undefined branch instruction that you are considering 0xDExx.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Checking&amp;nbsp;ARM®v7-M Architecture&amp;nbsp;Reference Manual, I see that only Encoding T1 has the UNDEFINED variant of that instruction. I have tried that on S32K144, it seems to be working, it triggers CFSR[UNDEFINSTR].&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/70304i840785A0AE1B1025/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;If you don't use&amp;nbsp;Supervisor Call, I think you can use&amp;nbsp;__asm__("svc #0x00") as well.&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/70351i43928E52835B8D2D/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;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/70258iD4FAE46950188CD4/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;And trigger SW reset from that exception instead of the fault exception.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2018 21:20:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805264#M2838</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2018-12-20T21:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fill unused flash with invalid instruction</title>
      <link>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805265#M2839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, I'll try both of them.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Riccardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2018 15:12:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Fill-unused-flash-with-invalid-instruction/m-p/805265#M2839</guid>
      <dc:creator>riccardolalli</dc:creator>
      <dc:date>2018-12-21T15:12:47Z</dc:date>
    </item>
  </channel>
</rss>

