<?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>S32KのトピックNot able to receive multiple can message</title>
    <link>https://community.nxp.com/t5/S32K/Not-able-to-receive-multiple-can-message/m-p/1520497#M17651</link>
    <description>&lt;P&gt;Hello NXP&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to receive multiple CAN message using do while but not able to receive it PFA of my code and please let me know what is wrong.&lt;/P&gt;&lt;P&gt;#include "Cpu.h"&lt;BR /&gt;#include "S32K148_features.h"&lt;BR /&gt;#include "S32K148.h"&lt;BR /&gt;volatile int exit_code = 0;&lt;BR /&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;BR /&gt;#define TX_MAILBOX (1UL)&lt;BR /&gt;#define TX_PHY_ID 0x74Fu&lt;BR /&gt;static const uint8_t msg_data[8] = {0x00, 0x01, 0x2, 0x03, 0x04, 0x05, 0x06, 0x07};&lt;BR /&gt;#define RX_MAILBOX (0UL)&lt;BR /&gt;#define RX_PHY_ID 0x79Eu&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void FlexCANInit(void) //CAN Initialize function&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Init(INST_CANCOM1, &amp;amp;canCom1_State, &amp;amp;canCom1_InitConfig0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&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;/* Write your code here */&lt;BR /&gt;/* Initialize and configure clocks&lt;BR /&gt;* - see clock manager component for details&lt;BR /&gt;*/&lt;BR /&gt;CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,&lt;BR /&gt;g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);&lt;BR /&gt;CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);&lt;BR /&gt;/* Initialize pins&lt;BR /&gt;*See PinSettings component for more info&lt;BR /&gt;*/&lt;BR /&gt;PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);&lt;BR /&gt;FlexCANInit();&lt;BR /&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;flexcan_data_info_t buff_RxTx_Cfg =&lt;BR /&gt;{&lt;BR /&gt;.msg_id_type = FLEXCAN_MSG_ID_STD,&lt;BR /&gt;.data_length = 8,&lt;BR /&gt;.fd_enable = true,&lt;BR /&gt;.enable_brs = true,&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, TX_MAILBOX, &amp;amp;buff_RxTx_Cfg,TX_PHY_ID);&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);&lt;/P&gt;&lt;P&gt;/* Configure RX message buffer with index RX_MSG_ID and RX_MAILBOX */&lt;BR /&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, RX_MAILBOX, &amp;amp;buff_RxTx_Cfg, RX_PHY_ID);&lt;BR /&gt;/* Define receive buffer */&lt;BR /&gt;flexcan_msgbuff_t recvBuff;&lt;/P&gt;&lt;P&gt;/* Set the global mask as "don't care" for each message buffer */&lt;BR /&gt;FLEXCAN_DRV_SetRxMbGlobalMask(INST_CANCOM1, FLEXCAN_MSG_ID_STD, 0U);&lt;/P&gt;&lt;P&gt;/* Configure message buffer 0 for reception */&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 0U, &amp;amp;buff_RxTx_Cfg, RX_PHY_ID);&lt;/P&gt;&lt;P&gt;/* Start receiving data in message buffer 0 */&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Receive(INST_CANCOM1, 0U, &amp;amp;recvBuff);&lt;BR /&gt;do&lt;BR /&gt;{&lt;BR /&gt;/* if the previous FlexCAN receive is completed */&lt;/P&gt;&lt;P&gt;if ((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) != STATUS_BUSY))&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);&lt;BR /&gt;continue;&lt;BR /&gt;}while((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) == STATUS_BUSY));&lt;BR /&gt;return 0;&lt;BR /&gt;/*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt;/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;#ifdef PEX_RTOS_START&lt;BR /&gt;PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt;#endif&lt;BR /&gt;/*** End of RTOS startup code. ***/&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;for(;;) {&lt;BR /&gt;if(exit_code != 0) {&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 11:02:22 GMT</pubDate>
    <dc:creator>RishikeshB</dc:creator>
    <dc:date>2022-09-12T11:02:22Z</dc:date>
    <item>
      <title>Not able to receive multiple can message</title>
      <link>https://community.nxp.com/t5/S32K/Not-able-to-receive-multiple-can-message/m-p/1520497#M17651</link>
      <description>&lt;P&gt;Hello NXP&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to receive multiple CAN message using do while but not able to receive it PFA of my code and please let me know what is wrong.&lt;/P&gt;&lt;P&gt;#include "Cpu.h"&lt;BR /&gt;#include "S32K148_features.h"&lt;BR /&gt;#include "S32K148.h"&lt;BR /&gt;volatile int exit_code = 0;&lt;BR /&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;BR /&gt;#define TX_MAILBOX (1UL)&lt;BR /&gt;#define TX_PHY_ID 0x74Fu&lt;BR /&gt;static const uint8_t msg_data[8] = {0x00, 0x01, 0x2, 0x03, 0x04, 0x05, 0x06, 0x07};&lt;BR /&gt;#define RX_MAILBOX (0UL)&lt;BR /&gt;#define RX_PHY_ID 0x79Eu&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void FlexCANInit(void) //CAN Initialize function&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Init(INST_CANCOM1, &amp;amp;canCom1_State, &amp;amp;canCom1_InitConfig0);&lt;BR /&gt;}&lt;/P&gt;&lt;P&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;/* Write your code here */&lt;BR /&gt;/* Initialize and configure clocks&lt;BR /&gt;* - see clock manager component for details&lt;BR /&gt;*/&lt;BR /&gt;CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,&lt;BR /&gt;g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);&lt;BR /&gt;CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);&lt;BR /&gt;/* Initialize pins&lt;BR /&gt;*See PinSettings component for more info&lt;BR /&gt;*/&lt;BR /&gt;PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);&lt;BR /&gt;FlexCANInit();&lt;BR /&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;flexcan_data_info_t buff_RxTx_Cfg =&lt;BR /&gt;{&lt;BR /&gt;.msg_id_type = FLEXCAN_MSG_ID_STD,&lt;BR /&gt;.data_length = 8,&lt;BR /&gt;.fd_enable = true,&lt;BR /&gt;.enable_brs = true,&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, TX_MAILBOX, &amp;amp;buff_RxTx_Cfg,TX_PHY_ID);&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);&lt;/P&gt;&lt;P&gt;/* Configure RX message buffer with index RX_MSG_ID and RX_MAILBOX */&lt;BR /&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, RX_MAILBOX, &amp;amp;buff_RxTx_Cfg, RX_PHY_ID);&lt;BR /&gt;/* Define receive buffer */&lt;BR /&gt;flexcan_msgbuff_t recvBuff;&lt;/P&gt;&lt;P&gt;/* Set the global mask as "don't care" for each message buffer */&lt;BR /&gt;FLEXCAN_DRV_SetRxMbGlobalMask(INST_CANCOM1, FLEXCAN_MSG_ID_STD, 0U);&lt;/P&gt;&lt;P&gt;/* Configure message buffer 0 for reception */&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_ConfigRxMb(INST_CANCOM1, 0U, &amp;amp;buff_RxTx_Cfg, RX_PHY_ID);&lt;/P&gt;&lt;P&gt;/* Start receiving data in message buffer 0 */&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Receive(INST_CANCOM1, 0U, &amp;amp;recvBuff);&lt;BR /&gt;do&lt;BR /&gt;{&lt;BR /&gt;/* if the previous FlexCAN receive is completed */&lt;/P&gt;&lt;P&gt;if ((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) != STATUS_BUSY))&lt;/P&gt;&lt;P&gt;FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);&lt;BR /&gt;continue;&lt;BR /&gt;}while((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) == STATUS_BUSY));&lt;BR /&gt;return 0;&lt;BR /&gt;/*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt;/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;#ifdef PEX_RTOS_START&lt;BR /&gt;PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt;#endif&lt;BR /&gt;/*** End of RTOS startup code. ***/&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;for(;;) {&lt;BR /&gt;if(exit_code != 0) {&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 11:02:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Not-able-to-receive-multiple-can-message/m-p/1520497#M17651</guid>
      <dc:creator>RishikeshB</dc:creator>
      <dc:date>2022-09-12T11:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to receive multiple can message</title>
      <link>https://community.nxp.com/t5/S32K/Not-able-to-receive-multiple-can-message/m-p/1520821#M17658</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@RishikerhB" target="_blank"&gt;Hi@RishikerhB&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the return value of this function :FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) may not always ture or false,so your demo code will run out of do-while loop.&lt;/P&gt;
&lt;P&gt;you can modified your demo code like this way.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;while(1)
{
/* if the previous FlexCAN receive is completed */
if ((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) != STATUS_BUSY))
FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);
}
or
do
{
/* if the previous FlexCAN receive is completed */
if ((FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, TX_MAILBOX) != STATUS_BUSY))
FLEXCAN_DRV_Send(INST_CANCOM1,TX_MAILBOX,&amp;amp;buff_RxTx_Cfg,(uint32_t)TX_PHY_ID,msg_data);
}while(1);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 02:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Not-able-to-receive-multiple-can-message/m-p/1520821#M17658</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2022-09-13T02:30:23Z</dc:date>
    </item>
  </channel>
</rss>

