<?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 Problems reseting FlexCan in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problems-reseting-FlexCan/m-p/187529#M7958</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm working with uTasker and MCF52235 microcontroller and I have problems when I try to SoftReset FlexCAN.&lt;BR /&gt;&lt;BR /&gt;When I try to send/receive CAN messages, CAN_OTHER_INTERRUPT in uTasker is awaken. When that happens I try to reset FlexCAN, but often an unhandled exception (0x40602000) occurs when doing so the program enter in the while(1) defined inside de handler undef_int(void) in M5223X.c and stands there forever.&lt;BR /&gt;&lt;BR /&gt;All the CAN interrupts are initialized (_CAN_buf_Interrupt0 to 15, _CAN_bus_off_Interrupt and _CAN_error_Interrupt) so every one has a handler.&lt;BR /&gt;&lt;BR /&gt;I'm having problems when I use long cables between two boards communicated by CAN bus. I have the termination resistors at the end and at the begin of the cables.&lt;BR /&gt;&lt;BR /&gt;This is my SoftReset FlexCAN code:&lt;BR /&gt;&lt;BR /&gt;void fnResetCAN(void){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int counter;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CAN_ERRSTAT &amp;amp; (CAN_BUS_IDLE|CAN_ERROR_PASSIVE)){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int imask = CAN_IMASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int canmcr = CANMCR;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CANMCR |= CAN_SOFTRST;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (counter=0; counter&amp;lt;500, (CANMCR &amp;amp; CAN_SOFTRST);counter++){}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN_IMASK = imask;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CANMCR |= canmcr;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CANMCR &amp;amp;= ~(CAN_FRZ | CAN_HALT);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Hope you can help me,&lt;BR /&gt;&lt;BR /&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Mar 2010 16:04:00 GMT</pubDate>
    <dc:creator>izzz</dc:creator>
    <dc:date>2010-03-31T16:04:00Z</dc:date>
    <item>
      <title>Problems reseting FlexCan</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problems-reseting-FlexCan/m-p/187529#M7958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm working with uTasker and MCF52235 microcontroller and I have problems when I try to SoftReset FlexCAN.&lt;BR /&gt;&lt;BR /&gt;When I try to send/receive CAN messages, CAN_OTHER_INTERRUPT in uTasker is awaken. When that happens I try to reset FlexCAN, but often an unhandled exception (0x40602000) occurs when doing so the program enter in the while(1) defined inside de handler undef_int(void) in M5223X.c and stands there forever.&lt;BR /&gt;&lt;BR /&gt;All the CAN interrupts are initialized (_CAN_buf_Interrupt0 to 15, _CAN_bus_off_Interrupt and _CAN_error_Interrupt) so every one has a handler.&lt;BR /&gt;&lt;BR /&gt;I'm having problems when I use long cables between two boards communicated by CAN bus. I have the termination resistors at the end and at the begin of the cables.&lt;BR /&gt;&lt;BR /&gt;This is my SoftReset FlexCAN code:&lt;BR /&gt;&lt;BR /&gt;void fnResetCAN(void){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int counter;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (CAN_ERRSTAT &amp;amp; (CAN_BUS_IDLE|CAN_ERROR_PASSIVE)){&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int imask = CAN_IMASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int canmcr = CANMCR;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CANMCR |= CAN_SOFTRST;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (counter=0; counter&amp;lt;500, (CANMCR &amp;amp; CAN_SOFTRST);counter++){}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN_IMASK = imask;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CANMCR |= canmcr;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CANMCR &amp;amp;= ~(CAN_FRZ | CAN_HALT);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Hope you can help me,&lt;BR /&gt;&lt;BR /&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 16:04:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problems-reseting-FlexCan/m-p/187529#M7958</guid>
      <dc:creator>izzz</dc:creator>
      <dc:date>2010-03-31T16:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problems reseting FlexCan</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problems-reseting-FlexCan/m-p/187530#M7959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan&lt;BR /&gt;&lt;BR /&gt;I would first try solving the problem that you are having when performing a soft reset.&lt;BR /&gt;Also an exception error will result in the undefined interrupt being called (this is more likely than an undefined interrupt from a peripheral source).&lt;BR /&gt;&lt;BR /&gt;Follow the instructions here to try to identify the code that is causing this:&lt;BR /&gt;&lt;A href="http://www.utasker.com/forum/index.php?topic=123.msg468#msg468" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=123.msg468#msg468&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generally only the CAN_ACK_ERROR (either CAN_TX_REMOTE_ERROR or CAN_TX_ERROR) are expected during normal operation when a destination doesn't respond. Other error sources are (BIT1ERROR | BIT0ERROR | CAN_CRC_ERR | CAN_FRM_ERR | CAN_STF_ERR), which generate the warning error event that is occuring. You can identify the actual error in more detal if you look at the variable ulError (copied from CAN_ERRSTAT) when the event is generated (in the _CAN_error_Interrupt() interrupt handler) - this may help identify the source of unreliabilities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_self"&gt;www.uTasker.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Apr 2010 04:57:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Problems-reseting-FlexCan/m-p/187530#M7959</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2010-04-01T04:57:22Z</dc:date>
    </item>
  </channel>
</rss>

