<?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>FreeMASTERのトピックRe: How to config Freemaster over CAN bus?</title>
    <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1261247#M611</link>
    <description>&lt;P&gt;Hi, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/100557"&gt;@iulian_stan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works! Thank you very much.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Apr 2021 11:44:21 GMT</pubDate>
    <dc:creator>Jimny</dc:creator>
    <dc:date>2021-04-13T11:44:21Z</dc:date>
    <item>
      <title>How to config Freemaster over CAN bus?</title>
      <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260062#M603</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to use freemaster to communicate with the mcu over CAN bus.&lt;/P&gt;&lt;P&gt;I have googled the tutorial but found nothing. Is there any demo which can explain the basic how-to? I want to know how to add the related code to my project in S32DS. I am using S32K144-EVB.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Apr 2021 11:36:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260062#M603</guid>
      <dc:creator>Jimny</dc:creator>
      <dc:date>2021-04-11T11:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to config Freemaster over CAN bus?</title>
      <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260382#M608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/177394"&gt;@Jimny&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you please provide some additional details about your case:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are you trying to add FreeMASTER Driver to you project and configure it for CAN communication or the Driver is already enabled and you have issues configuring it ?&lt;/LI&gt;
&lt;LI&gt;What versions of S32DS IDE and S32K1xx SDK are you using ?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the meantime you can check this&amp;nbsp;&lt;A href="https://community.nxp.com/t5/FreeMASTER-Knowledge-Base/Communication-Driver-Application-Configuration/ta-p/1117797" target="_self"&gt;post&lt;/A&gt;&amp;nbsp;- it's a bit outdated, but can give a base understanding of FreeMASTER Driver. I will provide updated instructions to match the tools you are working with.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Iulian&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 08:14:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260382#M608</guid>
      <dc:creator>iulian_stan</dc:creator>
      <dc:date>2021-04-12T08:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to config Freemaster over CAN bus?</title>
      <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260801#M609</link>
      <description>&lt;P&gt;Hello, iulianstan&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;The driver is already enabled and I have issues configuring it.&lt;/P&gt;&lt;P&gt;I use S32DS for ARM 2.2 and S32K144_SDK 3.0.0.&lt;/P&gt;&lt;P&gt;Let me describe the issue in detail.&lt;/P&gt;&lt;P&gt;I have created a new project and configure the can_pal.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142051i796328D5A9A3E1A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.PNG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142052i442598A1B1D65C88/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have changed the configuration in freemaster_cfg.h to use the can bus.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 810px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142053i1026284DC0D1F1BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the main function, I initialized the clock and can peripherals. And the &lt;FONT face="lucida sans unicode,lucida sans"&gt;FMSTR_Init()&lt;/FONT&gt;, &lt;FONT face="lucida sans unicode,lucida sans"&gt;FMSTR_Poll()&lt;/FONT&gt; functions were also added.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="8.PNG" style="width: 879px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142054i143B22DD3A5DF145/image-size/large?v=v2&amp;amp;px=999" role="button" title="8.PNG" alt="8.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I compiled the program and flashed it.&lt;/P&gt;&lt;P&gt;A freemaster project has been created to test the demo. I choose to connect the board over can bus.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.PNG" style="width: 578px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142055i30ADEA14C5C67E3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="4.PNG" alt="4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5.PNG" style="width: 578px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142056i8B66E1D59F5B6B63/image-size/large?v=v2&amp;amp;px=999" role="button" title="5.PNG" alt="5.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I clicked the Plug-in Configuration.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="6.PNG" style="width: 380px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142057i62C7294715A8B92E/image-size/large?v=v2&amp;amp;px=999" role="button" title="6.PNG" alt="6.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I use GY8507 interface card from GLINKER. It seems the driver is ok. When I clicked the Test Connection, an error occured.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="7.PNG" style="width: 350px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142058iF7D9CCEFB2E608AF/image-size/large?v=v2&amp;amp;px=999" role="button" title="7.PNG" alt="7.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think I should have missed&amp;nbsp; some configuration in the code. Please see the project in the attachment.&lt;/P&gt;&lt;P&gt;By the way, I have tested the model in the MBDT named "CAN_With_FreeMASTER_over_CAN", it works.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9.PNG" style="width: 727px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/142059i022561177A0C5F9A/image-size/large?v=v2&amp;amp;px=999" role="button" title="9.PNG" alt="9.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 23:10:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1260801#M609</guid>
      <dc:creator>Jimny</dc:creator>
      <dc:date>2021-04-12T23:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to config Freemaster over CAN bus?</title>
      <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1261019#M610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/177394"&gt;@Jimny&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;There are 2 things that need minor adjustments, one is in your code and another one related to the SDK:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In your code: you are using Short Interrupt Mode (#define FMSTR_SHORT_INTR 1) but you miss the piece that attaches FreeMASTER handler to CAN communication interrupt&lt;BR /&gt;&lt;LI-CODE lang="cpp"&gt;#if FMSTR_SHORT_INTR || FMSTR_LONG_INTR
    INT_SYS_InstallHandler(CAN0_ORed_0_15_MB_IRQn, FMSTR_Isr, NULL);
    INT_SYS_EnableIRQ(CAN0_ORed_0_15_MB_IRQn);
#endif​&lt;/LI-CODE&gt;&amp;nbsp;If you don't want to use interrupts, you can switch to polling mode:&lt;BR /&gt;&lt;LI-CODE lang="cpp"&gt;#define FMSTR_LONG_INTR        0    /* Complete message processing in interrupt */
#define FMSTR_SHORT_INTR       0    /* SCI FIFO-queuing done in interrupt */
#define FMSTR_POLL_DRIVEN      1    /* No interrupt needed, polling only */​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;The SDK: this &lt;A href="https://community.nxp.com/t5/FreeMASTER/Some-problem-about-FreeMASTER-on-CAN/m-p/1054911#M204" target="_self"&gt;reply&lt;/A&gt;&amp;nbsp;explains the change. TLDR add this snippet after CAN initialization:&amp;nbsp;&lt;BR /&gt;&lt;LI-CODE lang="cpp"&gt;/* Enter Freeze mode */
CAN0-&amp;gt;MCR |= (CAN_MCR_FRZ_MASK | CAN_MCR_HALT_MASK);
CAN0-&amp;gt;MCR &amp;amp;= ~CAN_MCR_MDIS_MASK;
while((CAN0-&amp;gt;MCR &amp;amp; CAN_MCR_FRZACK_MASK ) == 0){}
/* Disable abort mechanism  MCR[AEN] = 0 */
CAN0-&amp;gt;MCR &amp;amp;= ~CAN_MCR_AEN_MASK;
/* Enable the FlexCAN module */
CAN0-&amp;gt;MCR &amp;amp;= ~(CAN_MCR_FRZ_MASK | CAN_MCR_HALT_MASK);​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I also attached my main.c that should work in both modes. Let me know if it helps fixing your issue.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Iulian&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 06:24:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1261019#M610</guid>
      <dc:creator>iulian_stan</dc:creator>
      <dc:date>2021-04-13T06:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to config Freemaster over CAN bus?</title>
      <link>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1261247#M611</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/100557"&gt;@iulian_stan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works! Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 11:44:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/FreeMASTER/How-to-config-Freemaster-over-CAN-bus/m-p/1261247#M611</guid>
      <dc:creator>Jimny</dc:creator>
      <dc:date>2021-04-13T11:44:21Z</dc:date>
    </item>
  </channel>
</rss>

