<?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>S32 Design StudioのトピックRe: The loopback test of S32K142 using CAN PAL peripheral failed</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636992#M10020</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I only found the TX buffer is not properly filled in Send function then, but don't know exact reason.&lt;/P&gt;
&lt;P&gt;BR, Petr&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 07:43:48 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2023-04-20T07:43:48Z</dc:date>
    <item>
      <title>The loopback test of S32K142 using CAN PAL peripheral failed</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1635055#M10015</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Recently, I came into contact with S32K platform. The loopback test using CAN_PAL peripheral failed. It has been several days.&lt;/SPAN&gt;Please give me a suggestion.The code is simple, as follows:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; In DEBUG, the program gets stuck in "&lt;FONT&gt;while(CAN_GetTransferStatus(&amp;amp;can_pal1_instance, RX_MAILBOX) == STATUS_BUSY);&lt;/FONT&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CAN_PAL" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/219535i90C6699E9B12AD95/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2023-04-18 122200.png" alt="CAN_PAL" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;CAN_PAL&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PIN_MUX" style="width: 582px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/219534iE46313D993BBD364/image-size/large?v=v2&amp;amp;px=999" role="button" title="屏幕截图 2023-04-18 122230.png" alt="PIN_MUX" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;PIN_MUX&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include "Cpu.h"
#include "callbacks.h"

#define TX_MAILBOX  (1UL)
#define TX_MSG_ID   (1UL)
#define RX_MAILBOX  (0UL)
#define RX_MSG_ID   (1UL)

volatile int exit_code = 0;
can_message_t recvMsg;

  void BoardInit(void)
  {
      CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
      CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);
      PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
  }

  void CAN1_Init(void)
  {
	  CAN_Init(&amp;amp;can_pal1_instance, &amp;amp;can_pal1_Config0);
	  
	    can_buff_config_t RX_buffCfg =  {
	        .enableFD = false,
	        .enableBRS = false,
	        .fdPadding = 0U,
	        .idType = CAN_MSG_ID_STD,
	        .isRemote = false
	    };
	    /* Configure RX buffer with index RX_MAILBOX */
	    CAN_ConfigRxBuff(&amp;amp;can_pal1_instance, RX_MAILBOX, &amp;amp;RX_buffCfg, RX_MSG_ID);

	    can_buff_config_t TX_buffCfg =  {
	        .enableFD = false,
	        .enableBRS = false,
	        .fdPadding = 0U,
	        .idType = CAN_MSG_ID_STD,
	        .isRemote = false
	    };
	    /* Configure RX buffer with index RX_MAILBOX */
	    CAN_ConfigTxBuff(&amp;amp;can_pal1_instance, TX_MAILBOX, &amp;amp;TX_buffCfg);
);
  }

  /*
   * @brief Function which configures the LEDs and Buttons
   */

int main(void)
{
    BoardInit();   
    CAN1_Init();   
    can_message_t sendMsg = {
    		 .cs=0U,
			 .id = RX_MSG_ID,
			 .data[0] = 0x05,
			 .length = 1U
    };

while(1)
{
	CAN_Send(&amp;amp;can_pal1_instance,TX_MAILBOX,&amp;amp;sendMsg);
	while(CAN_GetTransferStatus(&amp;amp;can_pal1_instance, TX_MAILBOX) == STATUS_BUSY);
	CAN_Receive(&amp;amp;can_pal1_instance,RX_MAILBOX,&amp;amp;recvMsg);
	while(CAN_GetTransferStatus(&amp;amp;can_pal1_instance, RX_MAILBOX) == STATUS_BUSY);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 04:27:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1635055#M10015</guid>
      <dc:creator>RyzeBai</dc:creator>
      <dc:date>2023-04-18T04:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: The loopback test of S32K142 using CAN PAL peripheral failed</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636359#M10016</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;try to move&amp;nbsp;CAN_ConfigTxBuff into main function. But rather reorganize code little bit, e.g as below&lt;/P&gt;
&lt;PRE&gt;void CAN1_Init(void)&lt;BR /&gt;{&lt;BR /&gt;   CAN_Init(&amp;amp;can_pal1_instance, &amp;amp;can_pal1_Config0);&lt;BR /&gt;&lt;BR /&gt;   can_buff_config_t RX_buffCfg = {&lt;BR /&gt;    .enableFD = false,&lt;BR /&gt;    .enableBRS = false,&lt;BR /&gt;    .fdPadding = 0U,&lt;BR /&gt;    .idType = CAN_MSG_ID_STD,&lt;BR /&gt;    .isRemote = false&lt;BR /&gt;   };&lt;BR /&gt;   /* Configure RX buffer with index RX_MAILBOX */&lt;BR /&gt;   CAN_ConfigRxBuff(&amp;amp;can_pal1_instance, RX_MAILBOX, &amp;amp;RX_buffCfg, RX_MSG_ID);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;* @brief Function which configures the LEDs and Buttons&lt;BR /&gt;*/&lt;BR /&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;   BoardInit();&lt;BR /&gt;   CAN1_Init();&lt;BR /&gt;&lt;BR /&gt;   can_message_t sendMsg = {&lt;BR /&gt;    .cs=0U,&lt;BR /&gt;    .id = RX_MSG_ID,&lt;BR /&gt;    .data[0] = 0x05,&lt;BR /&gt;    .length = 1U&lt;BR /&gt;   };&lt;BR /&gt;&lt;BR /&gt;   CAN_Receive(&amp;amp;can_pal1_instance,RX_MAILBOX,&amp;amp;recvMsg);&lt;BR /&gt;&lt;BR /&gt;   can_buff_config_t TX_buffCfg = {&lt;BR /&gt;   .enableFD = false,&lt;BR /&gt;   .enableBRS = false,&lt;BR /&gt;   .fdPadding = 0U,&lt;BR /&gt;   .idType = CAN_MSG_ID_STD,&lt;BR /&gt;   .isRemote = false&lt;BR /&gt;   };&lt;BR /&gt;   /* Configure RX buffer with index RX_MAILBOX */&lt;BR /&gt;   CAN_ConfigTxBuff(&amp;amp;can_pal1_instance, TX_MAILBOX, &amp;amp;TX_buffCfg);&lt;BR /&gt;&lt;BR /&gt;   CAN_Send(&amp;amp;can_pal1_instance,TX_MAILBOX,&amp;amp;sendMsg);&lt;BR /&gt;&lt;BR /&gt;   while(1)&lt;BR /&gt;   {&lt;BR /&gt;&lt;BR /&gt;       while(CAN_GetTransferStatus(&amp;amp;can_pal1_instance, RX_MAILBOX) == STATUS_BUSY);&lt;BR /&gt;       CAN_Receive(&amp;amp;can_pal1_instance,RX_MAILBOX,&amp;amp;recvMsg);&lt;BR /&gt;&lt;BR /&gt;       for(int i=0;i&amp;lt;200000;i++){};&lt;BR /&gt;&lt;BR /&gt;       /* Toggle output value LED0 */&lt;BR /&gt;       PINS_DRV_TogglePins(GPIO_PORT, (1 &amp;lt;&amp;lt; LED1));&lt;BR /&gt;&lt;BR /&gt;       CAN_Send(&amp;amp;can_pal1_instance,TX_MAILBOX,&amp;amp;sendMsg);&lt;BR /&gt;    }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 14:31:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636359#M10016</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2023-04-19T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: The loopback test of S32K142 using CAN PAL peripheral failed</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636808#M10019</link>
      <description>&lt;P&gt;Thanks for your advice! I achieved it after move CAN_ConfigTxBuff into main function!&lt;BR /&gt;But I don't understand why.can you tell me? thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 02:22:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636808#M10019</guid>
      <dc:creator>RyzeBai</dc:creator>
      <dc:date>2023-04-20T02:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: The loopback test of S32K142 using CAN PAL peripheral failed</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636992#M10020</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I only found the TX buffer is not properly filled in Send function then, but don't know exact reason.&lt;/P&gt;
&lt;P&gt;BR, Petr&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 07:43:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1636992#M10020</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2023-04-20T07:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: The loopback test of S32K142 using CAN PAL peripheral failed</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1637001#M10021</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Best&amp;nbsp;Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 07:51:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/The-loopback-test-of-S32K142-using-CAN-PAL-peripheral-failed/m-p/1637001#M10021</guid>
      <dc:creator>RyzeBai</dc:creator>
      <dc:date>2023-04-20T07:51:04Z</dc:date>
    </item>
  </channel>
</rss>

