<?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: Why FlexCAN init stops while clearing RAMn? in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862874#M3758</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that was it. I have run the modified code and now it works. Many thanks!&lt;/P&gt;&lt;P&gt;As a reference, I should mention that I have found that info in table 53.1, section 53.1.1 of the Reference Manual.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jan 2019 08:40:39 GMT</pubDate>
    <dc:creator>dasitor</dc:creator>
    <dc:date>2019-01-28T08:40:39Z</dc:date>
    <item>
      <title>Why FlexCAN init stops while clearing RAMn?</title>
      <link>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862872#M3756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am new to the NXP S32K144. I am trying to develop an application that uses all 3 CAN modules at the same time. I run without any problem the example "FlexCAN_s32k144", which uses CAN 0. We are using a custom board with access to the three CAN modules (through transducers, of course). When I try to run the same example code just changing "CAN0" for "CAN1" or "CAN2", the init procedure stops at the RAMn clearing loop. For the moment I am trying to get each CAN module to work by itself, and all the code referring to the other modules is commented out. The PORTs are configured just before calling the init routine, but I have also tried to reverse the order without success. This is the code I am using (basically the same as in the example):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// START OF CODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void FLEXCAN1_init() {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint32_t&amp;nbsp;&amp;nbsp; &amp;nbsp;i = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;PCC-&amp;gt;PCCn[PCC_FlexCAN1_INDEX] |= PCC_PCCn_CGC_MASK;&amp;nbsp;&amp;nbsp; &amp;nbsp;// CGC=1: enable clock to FlexCAN0&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;MCR |= CAN_MCR_MDIS_MASK;&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;// MDIS=1: Disable module before selecting clock&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;CTRL1 &amp;amp;= ~CAN_CTRL1_CLKSRC_MASK;&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;// CLKSRC=0: Clock Source = oscillator (8 MHz)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;MCR &amp;amp;= ~CAN_MCR_MDIS_MASK;&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;// MDIS=0; Enable module config. (Sets FRZ, HALT)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Good practice: wait for FRZACK=1 on freeze mode entry/exit: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (!((CAN1-&amp;gt;MCR &amp;amp; CAN_MCR_FRZACK_MASK) &amp;gt;&amp;gt; CAN_MCR_FRZACK_SHIFT)) {}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure timing parameters: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;CTRL1 = 0x00490002; // CHANGE: Configured for 1MHz instead of 500KHz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i=0; i&amp;lt;128; i++ ) {&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// CAN1: clear 32 msg bufs x 4 words/msg buf = 128 words&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RAMn[i] = 0;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Clear msg buf word&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;// EXECUTION NEVER REACHES THIS POINT &amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&amp;lt;-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Message filters initialization: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(i=0; i&amp;lt;16; i++ ) {&amp;nbsp;&amp;nbsp; &amp;nbsp;// In FRZ mode, init CAN1 16 msg buf filters&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RXIMR[i] = 0xFFFFFFFF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RXMGMASK = 0x1FFFFFFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure Message Buffer #4 for reception -- Word 0: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RAMn[ 4*4+ 0] = 0x04000000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure Message Buffer #4 for reception -- Word 1: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RAMn[ 4*4+ 1] = 0x14440000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Configure FlexCAN module: */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;MCR = 0x0000001F;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Good practice: wait for FRZACK to clear (not in freeze mode): */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while ((CAN1-&amp;gt;MCR &amp;amp;&amp;amp; CAN_MCR_FRZACK_MASK) &amp;gt;&amp;gt; CAN_MCR_FRZACK_SHIFT)&amp;nbsp; {}&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Good practice: wait for NOTRDY to clear (module ready):&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while ((CAN1-&amp;gt;MCR &amp;amp;&amp;amp; CAN_MCR_NOTRDY_MASK) &amp;gt;&amp;gt; CAN_MCR_NOTRDY_SHIFT)&amp;nbsp; {}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// END OF CODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I stop the debugger, it seems that a "default_isr" is executing, so I tend to think that there is a problem accessing the RAM assigned to CAN1 and CAN2, but I really don't know. Where should I look?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2019 09:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862872#M3756</guid>
      <dc:creator>dasitor</dc:creator>
      <dc:date>2019-01-25T09:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Why FlexCAN init stops while clearing RAMn?</title>
      <link>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862873#M3757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be aware that the FLEXCAN1 and FLEXCAN2 have only 16 MBs so you need to clear only 16x4 = 64&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;for(i=0; i&amp;lt;64; i++ ) {&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;// CAN1: clear&amp;nbsp;16 msg bufs x 4 words/msg buf =&amp;nbsp;64 words&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;CAN1-&amp;gt;RAMn[i] = 0;&amp;nbsp;&amp;nbsp; &amp;nbsp;// Clear msg buf word&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Alexandru Nan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2019 08:08:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862873#M3757</guid>
      <dc:creator>alexandrunan</dc:creator>
      <dc:date>2019-01-28T08:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why FlexCAN init stops while clearing RAMn?</title>
      <link>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862874#M3758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that was it. I have run the modified code and now it works. Many thanks!&lt;/P&gt;&lt;P&gt;As a reference, I should mention that I have found that info in table 53.1, section 53.1.1 of the Reference Manual.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2019 08:40:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-FlexCAN-init-stops-while-clearing-RAMn/m-p/862874#M3758</guid>
      <dc:creator>dasitor</dc:creator>
      <dc:date>2019-01-28T08:40:39Z</dc:date>
    </item>
  </channel>
</rss>

