<?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 CAN mssgs dont retrieve in S32K</title>
    <link>https://community.nxp.com/t5/S32K/CAN-mssgs-dont-retrieve/m-p/774811#M2357</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have checked my device serving the CAN messages with IXXAT CAN sniffer as well as the Arduino and it receives all the messages except my S32k EVB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My setup is connected with CAN H &amp;amp; L and GND with the following code for reading the IDs: "0x361" &amp;amp; "0x319"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt; #ifdef PEX_RTOS_INIT&lt;BR /&gt; PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt; #endif&lt;BR /&gt; /*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;/* Do the initializations required for this application */&lt;BR /&gt; BoardInit();&lt;BR /&gt;#ifdef EVB&lt;BR /&gt; SBCInit();&lt;BR /&gt;#endif&lt;BR /&gt; GPIOInit();&lt;BR /&gt; FlexCANInit();&lt;BR /&gt; CSEC_DRV_Init(&amp;amp;csec1_State);&lt;BR /&gt; /&lt;/P&gt;&lt;P&gt;/* Set information about the data to be received&lt;BR /&gt; * - 1 byte in length&lt;BR /&gt; * - Standard message ID&lt;BR /&gt; * - Bit rate switch enabled to use a different bitrate for the data segment&lt;BR /&gt; * - Flexible data rate enabled&lt;BR /&gt; * - Use zeros for FD padding&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;/* Send the information via CAN */&lt;BR /&gt; flexcan_data_info_t dataInfo =&lt;BR /&gt; {&lt;BR /&gt; .data_length = 1U,&lt;BR /&gt; .msg_id_type = FLEXCAN_MSG_ID_EXT,&lt;BR /&gt; .enable_brs = true,&lt;BR /&gt; .fd_enable = true,&lt;BR /&gt; .fd_padding = 0U&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;/* Wait until the previous FlexCAN receive is completed */&lt;BR /&gt; //while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, RX_MAILBOX) == STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x361);&lt;BR /&gt; FLEXCAN_DRV_SetRxIndividualMask(INST_CANCOM1, FLEXCAN_MSG_ID_EXT, 2UL, 0x000u);&lt;/P&gt;&lt;P&gt;printf("setup - done\n");&lt;BR /&gt; while(1)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;//LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)welcomeMsg, strlen(welcomeMsg));&lt;BR /&gt; /* Define receive buffer */&lt;BR /&gt; flexcan_msgbuff_t recvBuff;&lt;/P&gt;&lt;P&gt;/* Start receiving data in RX_MAILBOX. */&lt;BR /&gt; FLEXCAN_DRV_Receive(INST_CANCOM1, 2UL, &amp;amp;recvBuff);&lt;/P&gt;&lt;P&gt;//printf("ScanComplete\n");&lt;BR /&gt; /* Wait until the previous FlexCAN receive is completed */&lt;BR /&gt; while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, 2UL) == STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // Send the information via CAN&lt;BR /&gt; flexcan_data_info_t dataInfo =&lt;BR /&gt; {&lt;BR /&gt; .data_length = 1U,&lt;BR /&gt; .msg_id_type = FLEXCAN_MSG_ID_EXT,&lt;BR /&gt; .enable_brs = true,&lt;BR /&gt; .fd_enable = true,&lt;BR /&gt; .fd_padding = 0U&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;delayCycles(3200000);&lt;BR /&gt; printf("Msg ID: %x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; switch(recvBuff.msgId){&lt;BR /&gt; case RX_MSG_ID:&lt;BR /&gt; printf("Msg ID: 0x%x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; cell4 = recvBuff.data[2];//((uint16_t)recvBuff.data[7] &amp;lt;&amp;lt; 8 ) + recvBuff.data[6] ;&lt;BR /&gt; uint8_t cell4_accumm[20] = {0,};&lt;BR /&gt; //LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)buffer, strlen(buffer));&lt;BR /&gt; printf("Batt Current: %d \n", cell4);&lt;BR /&gt; FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x361);&lt;BR /&gt; break;&lt;BR /&gt; case 0x361:&lt;BR /&gt; printf("Msg ID: 0x%x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; uint32_t cell4 = ((uint32_t)recvBuff.data[7] &amp;lt;&amp;lt; 32 ) + ((uint32_t)recvBuff.data[6] &amp;lt;&amp;lt; 16 ) + ((uint32_t)recvBuff.data[5] &amp;lt;&amp;lt; 8 ) + recvBuff.data[4];&lt;BR /&gt; //LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)buffer, strlen(buffer));&lt;BR /&gt; printf("RPM: %d \n", cell4);&lt;BR /&gt; FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x319);&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;default:&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (useEncryption)&lt;BR /&gt; {&lt;BR /&gt; /* Check the length of the received message */&lt;BR /&gt; if (recvBuff.dataLen == 16)&lt;BR /&gt; {&lt;BR /&gt; status_t stat;&lt;BR /&gt; //printf("Data len: %d \n", recvBuff.dataLen);&lt;/P&gt;&lt;P&gt;/* Decrypt data using AES-128 ECB and the first non-volatile user key */&lt;BR /&gt; //stat = CSEC_DRV_DecryptECB(CSEC_KEY_1, recvBuff.data, 16UL, recvBuff.data, 1UL);&lt;/P&gt;&lt;P&gt;if (stat != STATUS_SUCCESS)&lt;BR /&gt; {&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but all I receive is some random ID like:&amp;nbsp;e873c887 and not the IDs: "0x361" and/or "0x319"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2018 06:42:55 GMT</pubDate>
    <dc:creator>nishantsood</dc:creator>
    <dc:date>2018-04-27T06:42:55Z</dc:date>
    <item>
      <title>CAN mssgs dont retrieve</title>
      <link>https://community.nxp.com/t5/S32K/CAN-mssgs-dont-retrieve/m-p/774811#M2357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have checked my device serving the CAN messages with IXXAT CAN sniffer as well as the Arduino and it receives all the messages except my S32k EVB:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My setup is connected with CAN H &amp;amp; L and GND with the following code for reading the IDs: "0x361" &amp;amp; "0x319"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt; #ifdef PEX_RTOS_INIT&lt;BR /&gt; PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt; #endif&lt;BR /&gt; /*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;/* Do the initializations required for this application */&lt;BR /&gt; BoardInit();&lt;BR /&gt;#ifdef EVB&lt;BR /&gt; SBCInit();&lt;BR /&gt;#endif&lt;BR /&gt; GPIOInit();&lt;BR /&gt; FlexCANInit();&lt;BR /&gt; CSEC_DRV_Init(&amp;amp;csec1_State);&lt;BR /&gt; /&lt;/P&gt;&lt;P&gt;/* Set information about the data to be received&lt;BR /&gt; * - 1 byte in length&lt;BR /&gt; * - Standard message ID&lt;BR /&gt; * - Bit rate switch enabled to use a different bitrate for the data segment&lt;BR /&gt; * - Flexible data rate enabled&lt;BR /&gt; * - Use zeros for FD padding&lt;BR /&gt; */&lt;/P&gt;&lt;P&gt;/* Send the information via CAN */&lt;BR /&gt; flexcan_data_info_t dataInfo =&lt;BR /&gt; {&lt;BR /&gt; .data_length = 1U,&lt;BR /&gt; .msg_id_type = FLEXCAN_MSG_ID_EXT,&lt;BR /&gt; .enable_brs = true,&lt;BR /&gt; .fd_enable = true,&lt;BR /&gt; .fd_padding = 0U&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;/* Wait until the previous FlexCAN receive is completed */&lt;BR /&gt; //while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, RX_MAILBOX) == STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x361);&lt;BR /&gt; FLEXCAN_DRV_SetRxIndividualMask(INST_CANCOM1, FLEXCAN_MSG_ID_EXT, 2UL, 0x000u);&lt;/P&gt;&lt;P&gt;printf("setup - done\n");&lt;BR /&gt; while(1)&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;//LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)welcomeMsg, strlen(welcomeMsg));&lt;BR /&gt; /* Define receive buffer */&lt;BR /&gt; flexcan_msgbuff_t recvBuff;&lt;/P&gt;&lt;P&gt;/* Start receiving data in RX_MAILBOX. */&lt;BR /&gt; FLEXCAN_DRV_Receive(INST_CANCOM1, 2UL, &amp;amp;recvBuff);&lt;/P&gt;&lt;P&gt;//printf("ScanComplete\n");&lt;BR /&gt; /* Wait until the previous FlexCAN receive is completed */&lt;BR /&gt; while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, 2UL) == STATUS_SUCCESS);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; // Send the information via CAN&lt;BR /&gt; flexcan_data_info_t dataInfo =&lt;BR /&gt; {&lt;BR /&gt; .data_length = 1U,&lt;BR /&gt; .msg_id_type = FLEXCAN_MSG_ID_EXT,&lt;BR /&gt; .enable_brs = true,&lt;BR /&gt; .fd_enable = true,&lt;BR /&gt; .fd_padding = 0U&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;delayCycles(3200000);&lt;BR /&gt; printf("Msg ID: %x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; switch(recvBuff.msgId){&lt;BR /&gt; case RX_MSG_ID:&lt;BR /&gt; printf("Msg ID: 0x%x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; cell4 = recvBuff.data[2];//((uint16_t)recvBuff.data[7] &amp;lt;&amp;lt; 8 ) + recvBuff.data[6] ;&lt;BR /&gt; uint8_t cell4_accumm[20] = {0,};&lt;BR /&gt; //LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)buffer, strlen(buffer));&lt;BR /&gt; printf("Batt Current: %d \n", cell4);&lt;BR /&gt; FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x361);&lt;BR /&gt; break;&lt;BR /&gt; case 0x361:&lt;BR /&gt; printf("Msg ID: 0x%x \n", (unsigned int)recvBuff.msgId);&lt;BR /&gt; uint32_t cell4 = ((uint32_t)recvBuff.data[7] &amp;lt;&amp;lt; 32 ) + ((uint32_t)recvBuff.data[6] &amp;lt;&amp;lt; 16 ) + ((uint32_t)recvBuff.data[5] &amp;lt;&amp;lt; 8 ) + recvBuff.data[4];&lt;BR /&gt; //LPUART_DRV_SendData(INST_LPUART1, (uint8_t *)buffer, strlen(buffer));&lt;BR /&gt; printf("RPM: %d \n", cell4);&lt;BR /&gt; FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 2UL, &amp;amp;dataInfo, 0x319);&lt;BR /&gt; break;&lt;/P&gt;&lt;P&gt;default:&lt;/P&gt;&lt;P&gt;break;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (useEncryption)&lt;BR /&gt; {&lt;BR /&gt; /* Check the length of the received message */&lt;BR /&gt; if (recvBuff.dataLen == 16)&lt;BR /&gt; {&lt;BR /&gt; status_t stat;&lt;BR /&gt; //printf("Data len: %d \n", recvBuff.dataLen);&lt;/P&gt;&lt;P&gt;/* Decrypt data using AES-128 ECB and the first non-volatile user key */&lt;BR /&gt; //stat = CSEC_DRV_DecryptECB(CSEC_KEY_1, recvBuff.data, 16UL, recvBuff.data, 1UL);&lt;/P&gt;&lt;P&gt;if (stat != STATUS_SUCCESS)&lt;BR /&gt; {&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; continue;&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but all I receive is some random ID like:&amp;nbsp;e873c887 and not the IDs: "0x361" and/or "0x319"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 06:42:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/CAN-mssgs-dont-retrieve/m-p/774811#M2357</guid>
      <dc:creator>nishantsood</dc:creator>
      <dc:date>2018-04-27T06:42:55Z</dc:date>
    </item>
  </channel>
</rss>

