<?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中的主题 K22 forced hard fault while configuring uart0</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306046#M12995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello dear community!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our HW guys decided to switch from K20 to K22. I started to adopt my code to this new MCU, but stuck right at the beginning. I get forced hard fault on writing to UART0_AP7816A_T0 during UART0 initialization. The code was generated by PE and it pretty straightforward:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_WF7816: GTFD=1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART0_WF7816 = UART_WF7816_GTFD(0x01);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_ET7816: TXTHRESHOLD=0,RXTHRESHOLD=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART0_ET7816 = (UART_ET7816_TXTHRESHOLD(0x00) | UART_ET7816_RXTHRESHOLD(0x00));&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_AP7816A_T0: ADTI_H=0 */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; &lt;STRONG&gt;UART0_AP7816A_T0 = UART_AP7816A_T0_ADTI_H(0x00);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCB_CFSR 0x00008200&lt;/P&gt;&lt;P&gt;SCB_HFSR 0x40000000&lt;/P&gt;&lt;P&gt;SCB_BFAR 0x4006a03a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This happens right in the PE_low_level_init() and only generated code is executed before this fault. Can someone shed a light on this behaviour? Maybe I am missing some simple thing? Or maybe it is a hardware problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Mar 2014 12:31:04 GMT</pubDate>
    <dc:creator>mikhailburakov</dc:creator>
    <dc:date>2014-03-28T12:31:04Z</dc:date>
    <item>
      <title>K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306046#M12995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello dear community!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our HW guys decided to switch from K20 to K22. I started to adopt my code to this new MCU, but stuck right at the beginning. I get forced hard fault on writing to UART0_AP7816A_T0 during UART0 initialization. The code was generated by PE and it pretty straightforward:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_WF7816: GTFD=1 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART0_WF7816 = UART_WF7816_GTFD(0x01);&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_ET7816: TXTHRESHOLD=0,RXTHRESHOLD=0 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; UART0_ET7816 = (UART_ET7816_TXTHRESHOLD(0x00) | UART_ET7816_RXTHRESHOLD(0x00));&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* UART0_AP7816A_T0: ADTI_H=0 */&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; &lt;STRONG&gt;UART0_AP7816A_T0 = UART_AP7816A_T0_ADTI_H(0x00);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCB_CFSR 0x00008200&lt;/P&gt;&lt;P&gt;SCB_HFSR 0x40000000&lt;/P&gt;&lt;P&gt;SCB_BFAR 0x4006a03a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This happens right in the PE_low_level_init() and only generated code is executed before this fault. Can someone shed a light on this behaviour? Maybe I am missing some simple thing? Or maybe it is a hardware problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 12:31:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306046#M12995</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2014-03-28T12:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306047#M12996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you enable the clock for this uart module?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 13:42:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306047#M12996</guid>
      <dc:creator>retosonderegger</dc:creator>
      <dc:date>2014-03-28T13:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306048#M12997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, clock gate enabled in PE. Moreover, I rechecked it right from the debugger.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 13:54:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306048#M12997</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2014-03-28T13:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306049#M12998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ISO-7816 functionality is new in the K22 (in comparison to K20).&lt;/P&gt;&lt;P&gt;Check that the ISO-7816 functionality is first enabled by setting the control bit &lt;STRONG&gt;ISO_7816E&lt;/STRONG&gt; in &lt;STRONG&gt;UART0_C7816&lt;/STRONG&gt; otherwise the registers can not be written to (&lt;EM&gt;maybe trying to write when they are not enabled causes a hard fault&lt;/EM&gt;).&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;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 20:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306049#M12998</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-03-28T20:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306050#M12999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mikhail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it a K22 50MHz part? Please kindly let me know the mask set info on it, it is something like "0m33z".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your patience!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day!!&lt;/P&gt;&lt;P&gt;Kan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 02:21:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306050#M12999</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2014-03-31T02:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306051#M13000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chip is 120MHz, it's marked as "MK22FX512 VLK12 2N03G XCTAA1337A"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 08:26:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306051#M13000</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2014-03-31T08:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306052#M13001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just checked init code generated for K20 by PE. There is initialization sequence for 7816 stuff, but it is a bit different. Also it does not cause any troubles. At the moment I've just removed this part of code. However it is not a solution - only a workaround, because this code is autogenerated by PE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 15:12:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306052#M13001</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2014-03-31T15:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306053#M13002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mikhail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had the same problem.&lt;/P&gt;&lt;P&gt;CWMCU 10.4&lt;/P&gt;&lt;P&gt;MK22FX512VLL12 2N03G&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you know, during PE's UART0_Init() function, there is an unhandled interrupt which stops the MPU. Commenting out the reg inits with UART0_*7816 will prevent the interrupt, but you have to do this every time you "Generate Code" in PE. I agree, this is a PE or MK22 bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix this just disable all interrupts prior to calling PE_low_level_init(), and enable the interrupts in your code when you are good and ready. PE should disable all INTs before init.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; In PE Component Inspector, set "generate code" for the EnableInt and DisableInt methods in the CPU component.&lt;/P&gt;&lt;P&gt;2. Add Cpu_DisableInt(); in the main() function (ProcessorExpert.c) as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;/*lint -restore Enable MISRA rule (6.3) checking. */&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;Cpu_DisableInt();&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;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;-add this line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp; PE_low_level_init();&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. In your code, after YOUR init stuff, enable the interrupts if needed.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt; Cpu_EnableInt();&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Brian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Apr 2014 18:48:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306053#M13002</guid>
      <dc:creator>bgag</dc:creator>
      <dc:date>2014-04-10T18:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: K22 forced hard fault while configuring uart0</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306054#M13003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer. Actually the differences appeared to be so significant, that we decided to sick with k20. Only took 100MHz chip instead of previously used 72MHz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 07:01:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K22-forced-hard-fault-while-configuring-uart0/m-p/306054#M13003</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2014-04-11T07:01:16Z</dc:date>
    </item>
  </channel>
</rss>

