<?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: uint32_t resetcause = RCM_GetPreviousResetSources(RCM); //causing hardfault in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1590110#M4845</link>
    <description>&lt;P&gt;Can someone please tell me how to use&amp;nbsp;&lt;SPAN&gt;RCM_GetPreviousResetSources without a hard fault?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I checked the addresses in the RM, ican inspect the values, but cannot read them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would assume someone at NXP can look into why their down driver causes a hard fault. Its very simple code and very easy to reproduce.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am happy to work around it but I need to know what the reset cause was for my applications.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2023 00:07:07 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2023-01-31T00:07:07Z</dc:date>
    <item>
      <title>uint32_t resetcause = RCM_GetPreviousResetSources(RCM); //causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1587994#M4841</link>
      <description>&lt;P&gt;#include "MK50D10.h"&lt;/P&gt;&lt;P&gt;Calling&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint32_t error = RCM_GetPreviousResetSources(RCM); // Causing hard fault every time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also updated the driver to be like the MK64 versions which does two unit8_t reads and it still crashes (like this)&lt;/P&gt;&lt;P&gt;static inline uint32_t RCM_GetPreviousResetSources(RCM_Type *base)&lt;BR /&gt;{&lt;BR /&gt;#if (defined(FSL_FEATURE_RCM_REG_WIDTH) &amp;amp;&amp;amp; (FSL_FEATURE_RCM_REG_WIDTH == 32))&lt;BR /&gt;return base-&amp;gt;SRS;&lt;BR /&gt;#else&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;uint8_t tmpSrs0 = base-&amp;gt;SRS0;&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;uint8_t tmpSrs1 = base-&amp;gt;SRS1;&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;return (uint32_t)((uint32_t)tmpSrs0 | ((uint32_t)tmpSrs1 &amp;lt;&amp;lt; 8U));&lt;/STRONG&gt;&lt;/U&gt;&lt;BR /&gt;// return (uint32_t)((uint32_t)base-&amp;gt;SRS0 | ((uint32_t)base-&amp;gt;SRS1 &amp;lt;&amp;lt; 8U));&lt;BR /&gt;#endif /* (FSL_FEATURE_RCM_REG_WIDTH == 32) */&lt;/P&gt;&lt;P&gt;Any idea why the MK50 crashes when you call this? I use it everywhere on other projects and have never seen / had a problem except for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The exact fault is&lt;/P&gt;&lt;P&gt;BFARVALID (7) BusFault address register (BFAR) valid flag&lt;/P&gt;&lt;P&gt;PRECISERR (1) Precise data bus error&lt;/P&gt;&lt;P&gt;If that helps diagnose the issue...&lt;/P&gt;&lt;P&gt;Here is an image showing RCM is there, working, you can inspect it, and the fault after you run it&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CarlFST60L_0-1674679142252.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/208372iF4F510F85ECFCB11/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CarlFST60L_0-1674679142252.png" alt="CarlFST60L_0-1674679142252.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 20:39:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1587994#M4841</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2023-01-25T20:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: uint32_t resetcause = RCM_GetPreviousResetSources(RCM); //causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1590110#M4845</link>
      <description>&lt;P&gt;Can someone please tell me how to use&amp;nbsp;&lt;SPAN&gt;RCM_GetPreviousResetSources without a hard fault?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I checked the addresses in the RM, ican inspect the values, but cannot read them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would assume someone at NXP can look into why their down driver causes a hard fault. Its very simple code and very easy to reproduce.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am happy to work around it but I need to know what the reset cause was for my applications.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 00:07:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1590110#M4845</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2023-01-31T00:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: uint32_t resetcause = RCM_GetPreviousResetSources(RCM); //causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1593303#M4846</link>
      <description>&lt;P class="lia-align-justify"&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/20290"&gt;@CarlFST60L&lt;/a&gt;,&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Could you please share what you are doing before calling the function?&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;You point out that that you have worked with RCM driver before, it was with the same MK50 you are using right now? If so, which changes have you made from your other projects to this one?&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;We test the RCM driver in a FRDM K64 and RCM_GetPreviousResetSources() worked fine.&lt;/P&gt;
&lt;P class="lia-align-justify"&gt;Best regards, Raul.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 17:59:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1593303#M4846</guid>
      <dc:creator>RaRo</dc:creator>
      <dc:date>2023-02-03T17:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: uint32_t resetcause = RCM_GetPreviousResetSources(RCM); //causing hardfault</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1593433#M4847</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As in my first post, K64 works fine, so not sure why you tested something that I said works fine and you didnt test the thing I said does not work fine which is the MK50?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not doing anything before it, just make default project, and call it anywhere and you get a hard fault (MK50). As you can see in my orginal post you can inspect it and see valid values, but, when you got to actually read the address's it explodes and hard faults as shown in original post in detail.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 00:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/uint32-t-resetcause-RCM-GetPreviousResetSources-RCM-causing/m-p/1593433#M4847</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2023-02-04T00:59:03Z</dc:date>
    </item>
  </channel>
</rss>

