<?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 Code crashes when SCI0CR2_TE i set in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Code-crashes-when-SCI0CR2-TE-i-set/m-p/722991#M14838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a function to initialize the UART port. When I run the code in debug mode in CodeWarrior, it always crashes after the '&lt;SPAN&gt;SCI0CR2_TE = 1;' line is executed. I ended up in the '4A4D' memory region and the debugger says an unknown event has occurred. Can anyone help with this? What may be the problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned char InitializeUART ( void )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; // THE UART WILL BE CONFIGURED FOR ...&lt;BR /&gt;&amp;nbsp; SCI0BDL = 0x0D; /*Configure baud rate at 19200 bps with*/&lt;BR /&gt;&amp;nbsp; SCI0BDH = 0x00; /*an SCI clock modulo of 4MHz*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; SCI0CR1 = 0x00; /*8 data bits, no parity*/&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; SCI0CR2_RE = 1;&lt;BR /&gt;&amp;nbsp; SCI0CR2_TE = 1;&lt;BR /&gt;&amp;nbsp; SCI0CR2_RIE = 1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; if (SCI0SR1 &amp;amp; 0x80){ /*Poll TDRE flag*/&lt;BR /&gt;&amp;nbsp; return ERROR_OK; /*TDRE set, return OK*/&lt;BR /&gt;&amp;nbsp; }&amp;nbsp;else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return ERROR_ERROR; /*TDRE clear, return ERROR*/&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2018 15:38:46 GMT</pubDate>
    <dc:creator>abdoulah</dc:creator>
    <dc:date>2018-05-25T15:38:46Z</dc:date>
    <item>
      <title>Code crashes when SCI0CR2_TE i set</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Code-crashes-when-SCI0CR2-TE-i-set/m-p/722991#M14838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a function to initialize the UART port. When I run the code in debug mode in CodeWarrior, it always crashes after the '&lt;SPAN&gt;SCI0CR2_TE = 1;' line is executed. I ended up in the '4A4D' memory region and the debugger says an unknown event has occurred. Can anyone help with this? What may be the problem?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned char InitializeUART ( void )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; // THE UART WILL BE CONFIGURED FOR ...&lt;BR /&gt;&amp;nbsp; SCI0BDL = 0x0D; /*Configure baud rate at 19200 bps with*/&lt;BR /&gt;&amp;nbsp; SCI0BDH = 0x00; /*an SCI clock modulo of 4MHz*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; SCI0CR1 = 0x00; /*8 data bits, no parity*/&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; SCI0CR2_RE = 1;&lt;BR /&gt;&amp;nbsp; SCI0CR2_TE = 1;&lt;BR /&gt;&amp;nbsp; SCI0CR2_RIE = 1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; if (SCI0SR1 &amp;amp; 0x80){ /*Poll TDRE flag*/&lt;BR /&gt;&amp;nbsp; return ERROR_OK; /*TDRE set, return OK*/&lt;BR /&gt;&amp;nbsp; }&amp;nbsp;else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; return ERROR_ERROR; /*TDRE clear, return ERROR*/&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2018 15:38:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Code-crashes-when-SCI0CR2-TE-i-set/m-p/722991#M14838</guid>
      <dc:creator>abdoulah</dc:creator>
      <dc:date>2018-05-25T15:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Code crashes when SCI0CR2_TE i set</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Code-crashes-when-SCI0CR2-TE-i-set/m-p/722992#M14839</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;Since you have not provided detailed info I only focus at the line:&lt;/P&gt;&lt;P&gt;SCI0CR2_RIE = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You enable interrupt locally, I am not able to check whether you enabled it also globally and whether corresponding routine exists.&lt;/P&gt;&lt;P&gt;So I see the issue you enable interrupt, and it is launched without existing interrupt subroutine, or there is wrong placement of subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to suggest to add, in the future, &lt;STRONG&gt;the MCU type&lt;/STRONG&gt;, &lt;STRONG&gt;BUSCLK&lt;/STRONG&gt;, the best is to attach short (very short) example project (in CodeWarrior...to be easily checked by NXP support team)&amp;nbsp; which highlights the issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It is good to see BUSCLK setup, oscillator clock, interrupts setup,....in the case of such&amp;nbsp; issues.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible I have or I published here UART examples which could hep you but it is not possible to direct you to them if there is no info about the MCU type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2018 08:16:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Code-crashes-when-SCI0CR2-TE-i-set/m-p/722992#M14839</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2018-05-29T08:16:00Z</dc:date>
    </item>
  </channel>
</rss>

