<?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: k20 FLEXCAN example set to loopback, setup in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/k20-FLEXCAN-example-set-to-loopback-setup/m-p/452547#M15188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the error on my side. Here are the results in case someone else falls into the same trap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CAN_DEVICE definition is in test.h for the 4.0 flexcan example, and is set based on the processor. The bsp has a setting for the processor derivative in a header file, and our compile resulted in CAN_DEVICE to be 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tracing the code there is a case statement in mqx that sets up the CAN pins based on the CAN_DEVICE # using a switch statement. Our define and therefore the switch was set for 1 causing the wrong pin assignments; after changing the device to 0 selected the correct pins and the example worked correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need first to set the correct pins in init_gpio.c to point to the mux config pin setting you are using on your board. Then I would recommend just defining the CAN_DEVICE to be the actual device you are using manually, ie #define CAN_DEVICE 0&amp;nbsp;&amp;nbsp;&amp;nbsp; (in our case).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert Lewis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2015 01:54:54 GMT</pubDate>
    <dc:creator>Cdn_aye</dc:creator>
    <dc:date>2015-10-14T01:54:54Z</dc:date>
    <item>
      <title>k20 FLEXCAN example set to loopback, setup</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/k20-FLEXCAN-example-set-to-loopback-setup/m-p/452546#M15187</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;I have been trying to get the flexcan example to run in loopback on our board without success. I have a 60 ohm resistor on each CAN-H and CAN-L pair and have tied CAN-H to CAN-L.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looped the TCAN-H and CAN-L pins in order to follow the suggestion on this forum (twr-k20d72m and can) to allow the Tx line to toggle. I added a separate ISR for the Rx and Tx. What I need&amp;nbsp; to do is to check the HW functionality at this point using a single board and verify the signal levels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the &lt;SPAN style="color: #000000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;init_gpio.c and we are using the default settings for the port pins PTA12 &amp;amp; PTA13 so no changes were needed. I didn't see any setting to enable the FLEXCAN modules in user_config.h. I can step through the init fcns for the CAN system and they do not return any error however I don't see any activity on the Tx line even when I set the code to loop transmitting the text string. I do get one single Tx interrupt but thats it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;So I am wondering if there is another setting somewhere I have missed. The k20dx256 is the same bsp as the k40dx256 so I used the example code for the k40.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;I am trying to run this on MQX 4.01. Is loopback a reasonable mode to set the code to run in?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;Can anyone tell me my error please. I can try the newer MQX 4.2 but would prefer to get this working under MQX 4.0.1 before expanding the project and potential problems.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;Any advice would be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="SpellE" style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #000000;"&gt;Robert&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Oct 2015 05:26:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/k20-FLEXCAN-example-set-to-loopback-setup/m-p/452546#M15187</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2015-10-11T05:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: k20 FLEXCAN example set to loopback, setup</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/k20-FLEXCAN-example-set-to-loopback-setup/m-p/452547#M15188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the error on my side. Here are the results in case someone else falls into the same trap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CAN_DEVICE definition is in test.h for the 4.0 flexcan example, and is set based on the processor. The bsp has a setting for the processor derivative in a header file, and our compile resulted in CAN_DEVICE to be 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tracing the code there is a case statement in mqx that sets up the CAN pins based on the CAN_DEVICE # using a switch statement. Our define and therefore the switch was set for 1 causing the wrong pin assignments; after changing the device to 0 selected the correct pins and the example worked correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need first to set the correct pins in init_gpio.c to point to the mux config pin setting you are using on your board. Then I would recommend just defining the CAN_DEVICE to be the actual device you are using manually, ie #define CAN_DEVICE 0&amp;nbsp;&amp;nbsp;&amp;nbsp; (in our case).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert Lewis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2015 01:54:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/k20-FLEXCAN-example-set-to-loopback-setup/m-p/452547#M15188</guid>
      <dc:creator>Cdn_aye</dc:creator>
      <dc:date>2015-10-14T01:54:54Z</dc:date>
    </item>
  </channel>
</rss>

