<?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: S32146 CAN FD issue in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745200#M28113</link>
    <description>&lt;P&gt;&lt;A href="mailto:Hi@chandan_uv" target="_blank"&gt;Hi@chandan_uv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;the bitrate configuration is not right from your description.&lt;/P&gt;
&lt;P&gt;have a try below setting&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1698142204118.png" style="width: 558px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/246552i70144ED9D84E3214/image-dimensions/558x101?v=v2" width="558" height="101" role="button" title="Senlent_0-1698142204118.png" alt="Senlent_0-1698142204118.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and i didn't find any more issues in the picture you provided.&lt;/P&gt;
&lt;P&gt;if still have issues,please provided the demo code,&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 10:14:14 GMT</pubDate>
    <dc:creator>Senlent</dc:creator>
    <dc:date>2023-10-24T10:14:14Z</dc:date>
    <item>
      <title>S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1743623#M28022</link>
      <description>&lt;P&gt;Hello, I want to CAN0 of S32146 in CAN-FD mode. Initially I am using CAN0 as CAN 2.0 and working fine. But when I am using code in S32146, getting stuff error. I just modified the .fd enable, .&amp;nbsp;payload and .data_length. Below is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.png" style="width: 818px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/246131iBD86110F029A02DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 830px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/246132i761A84FCB7549691/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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;status_t host_can_init(void)
{
    status_t ret = STATUS_SUCCESS;
	
		
		flexcan_user_config_t can_500kbps_init_cfg = 
    {
        .fd_enable =true,
        .pe_clock = FLEXCAN_CLK_SOURCE_PERIPH,
        .max_num_mb = 4, //8,
        .num_id_filters = FLEXCAN_RX_FIFO_ID_FILTERS_8,
        .is_rx_fifo_needed = false,
        .flexcanMode = FLEXCAN_NORMAL_MODE,
        .payload = FLEXCAN_PAYLOAD_SIZE_64 , //FLEXCAN_PAYLOAD_SIZE_8,
        .bitrate = {
            .propSeg    = 3U,
            .phaseSeg1  = 10U,
            .phaseSeg2  = 7U,
            .preDivider = 9U,
            .rJumpwidth = 1U
        },
        .bitrate_cbt = {
            .propSeg    = 3U,
            .phaseSeg1  = 10U,
            .phaseSeg2  = 7U,
            .preDivider = 9U,
            .rJumpwidth = 1U
        },
		
				
				/*
			        .bitrate = {
            .propSeg    = 3U,
            .phaseSeg1  = 1U,
            .phaseSeg2  = 2U,
            .preDivider = 3U,
            .rJumpwidth = 1U
        },
        .bitrate_cbt = {
            .propSeg    = 3U,
            .phaseSeg1  = 1U,
            .phaseSeg2  = 2U,
            .preDivider = 3U,
            .rJumpwidth = 1U
        },
				*/

        .transfer_type = FLEXCAN_RXFIFO_USING_INTERRUPTS,
        .rxFifoDMAChannel = 0, 
    };
	
		FLEXCAN_DRV_Deinit(HOST_CAN_INST);
    /* CAN interface initialization */
    ret = FLEXCAN_DRV_Init(HOST_CAN_INST, &amp;amp;host_can_state, &amp;amp;can_500kbps_init_cfg);
    return ret;
}


void can_if_init_host (void)
{
    flexcan_data_info_t data_info =
    {
       .data_length = 64U,
       .msg_id_type = FLEXCAN_MSG_ID_STD,
       .fd_enable   = true,
       .enable_brs  = false,
       .fd_padding  = 0U
    };
    
   DEV_ASSERT(FLEXCAN_DRV_ConfigRxMb(HOST_CAN_INST, HOST_RX_MBX, &amp;amp;data_info, RX_HOST_MSG_ID) == STATUS_SUCCESS );
   FLEXCAN_DRV_SetRxMbGlobalMask(HOST_CAN_INST, FLEXCAN_MSG_ID_STD, RX_HOST_MSG_ID);
   DEV_ASSERT(FLEXCAN_DRV_SetRxIndividualMask(HOST_CAN_INST, FLEXCAN_MSG_ID_STD, HOST_RX_MBX, RX_HOST_MSG_ID) == STATUS_SUCCESS );
}

status_t can_send(uint8_t instance, uint8_t mb_idx, uint8_t *tx_data, uint32_t len, uint32_t msg_id, flexcan_msgbuff_id_type_t id_type)
{
	status_t send_status = STATUS_SUCCESS; 
	//bool sucess = false;
    
	flexcan_data_info_t txdata_info =
	{
		.data_length = len,
		.msg_id_type = id_type,
		.enable_brs  = false,
		.fd_enable   = false,
		.fd_padding  = 0U,
		.is_remote = false
	};
	
	if(instance == HOST_CAN_INST){
		txdata_info.fd_enable   = true;
	}
	
	if( FLEXCAN_DRV_GetTransferStatus(instance, mb_idx) != STATUS_BUSY ){
	/* Configure TX message buffer with index TX_MBX and msg_id*/
    FLEXCAN_DRV_ConfigTxMb(instance, mb_idx, &amp;amp;txdata_info, msg_id);
	/* Start transimitting data */	
	send_status = FLEXCAN_DRV_Send(instance, mb_idx, &amp;amp;txdata_info, msg_id, tx_data);
	
	}
	return send_status;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 10:24:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1743623#M28022</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2023-10-20T10:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745071#M28099</link>
      <description>&lt;P&gt;Updated CAN bit rate configuration as below, still similar issue&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.bitrate = {&lt;BR /&gt;.propSeg = 4U,&lt;BR /&gt;.phaseSeg1 = 7U,&lt;BR /&gt;.phaseSeg2 = 1U,&lt;BR /&gt;.preDivider = 9U,&lt;BR /&gt;.rJumpwidth = 1U&lt;BR /&gt;},&lt;BR /&gt;.bitrate_cbt = {&lt;BR /&gt;.propSeg = 4U,&lt;BR /&gt;.phaseSeg1 = 7U,&lt;BR /&gt;.phaseSeg2 = 1U,&lt;BR /&gt;.preDivider = 9U,&lt;BR /&gt;.rJumpwidth = 1U&lt;BR /&gt;},&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 07:32:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745071#M28099</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2023-10-24T07:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745182#M28110</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@chandan_uv" target="_blank"&gt;Hi@chandan_uv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If possible, please provide the entire project and I will test it for you.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 09:54:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745182#M28110</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-10-24T09:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745187#M28111</link>
      <description>Its not possible for me to share as shared code is a part of project.</description>
      <pubDate>Tue, 24 Oct 2023 09:59:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745187#M28111</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2023-10-24T09:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745200#M28113</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@chandan_uv" target="_blank"&gt;Hi@chandan_uv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;the bitrate configuration is not right from your description.&lt;/P&gt;
&lt;P&gt;have a try below setting&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1698142204118.png" style="width: 558px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/246552i70144ED9D84E3214/image-dimensions/558x101?v=v2" width="558" height="101" role="button" title="Senlent_0-1698142204118.png" alt="Senlent_0-1698142204118.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and i didn't find any more issues in the picture you provided.&lt;/P&gt;
&lt;P&gt;if still have issues,please provided the demo code,&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 10:14:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745200#M28113</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-10-24T10:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745202#M28114</link>
      <description>HI &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;, Clock is 80MHZ for me and below are the bit rate configuration&lt;BR /&gt;&lt;BR /&gt;.bitrate = {&lt;BR /&gt;.propSeg = 4U,&lt;BR /&gt;.phaseSeg1 = 7U,&lt;BR /&gt;.phaseSeg2 = 1U,&lt;BR /&gt;.preDivider = 9U,&lt;BR /&gt;.rJumpwidth = 1U&lt;BR /&gt;},&lt;BR /&gt;.bitrate_cbt = {&lt;BR /&gt;.propSeg = 4U,&lt;BR /&gt;.phaseSeg1 = 7U,&lt;BR /&gt;.phaseSeg2 = 1U,&lt;BR /&gt;.preDivider = 9U,&lt;BR /&gt;.rJumpwidth = 1U&lt;BR /&gt;},</description>
      <pubDate>Tue, 24 Oct 2023 10:26:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745202#M28114</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2023-10-24T10:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745518#M28130</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@chandan_uv" target="_blank"&gt;Hi@chandan_uv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;please have a try below settings.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1698197183378.png" style="width: 632px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/246626i35A12E5556264336/image-dimensions/632x117?v=v2" width="632" height="117" role="button" title="Senlent_0-1698197183378.png" alt="Senlent_0-1698197183378.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 01:26:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1745518#M28130</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2023-10-25T01:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: S32146 CAN FD issue</title>
      <link>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1769037#M29324</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/188029"&gt;@Senlent&lt;/a&gt;&amp;nbsp;I tried but still same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;status_t host_can_init(void)
{
    status_t ret = STATUS_SUCCESS;

	/* Configuration for 500kbps CAN bit rate */
	flexcan_user_config_t can_500kbps_init_cfg = 
    {
        .fd_enable =true,
        .pe_clock = FLEXCAN_CLK_SOURCE_PERIPH,
        .max_num_mb = 4, //8,
        .num_id_filters = FLEXCAN_RX_FIFO_ID_FILTERS_8,
        .is_rx_fifo_needed = false,
        .flexcanMode = FLEXCAN_NORMAL_MODE,
        .payload = FLEXCAN_PAYLOAD_SIZE_64 , //FLEXCAN_PAYLOAD_SIZE_8,
				.bitrate = {
            .propSeg    = 7U,
            .phaseSeg1  = 4U,
            .phaseSeg2  = 1U,
            .preDivider = 9U,
            .rJumpwidth = 1U
        },
        .bitrate_cbt = {
            .propSeg    = 7U,
            .phaseSeg1  = 4U,
            .phaseSeg2  = 1U,
            .preDivider = 9U,
            .rJumpwidth = 1U
        },
			

        .transfer_type = FLEXCAN_RXFIFO_USING_INTERRUPTS,
        .rxFifoDMAChannel = 0, 
    };
	
    /* CAN interface initialization */
    ret = FLEXCAN_DRV_Init(HOST_CAN_INST, &amp;amp;host_can_state, &amp;amp;can_500kbps_init_cfg);
		DEV_ASSERT(ret == STATUS_SUCCESS);
    return ret;
}


void can_if_init_host (void)
{
    flexcan_data_info_t data_info =
    {
       .data_length = 64U,
       .msg_id_type = FLEXCAN_MSG_ID_STD,
       .fd_enable   = true,
       .enable_brs  = false,
       .fd_padding  = 0U
    };
    
   DEV_ASSERT(FLEXCAN_DRV_ConfigRxMb(HOST_CAN_INST, HOST_RX_MBX, &amp;amp;data_info, RX_HOST_MSG_ID) == STATUS_SUCCESS );
   FLEXCAN_DRV_SetRxMbGlobalMask(HOST_CAN_INST, FLEXCAN_MSG_ID_STD, RX_HOST_MSG_ID);
   DEV_ASSERT(FLEXCAN_DRV_SetRxIndividualMask(HOST_CAN_INST, FLEXCAN_MSG_ID_STD, HOST_RX_MBX, RX_HOST_MSG_ID) == STATUS_SUCCESS );
		
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked with custom python script to receive the data, able to get data but it is in the multiple of 4, like if I send 13, receiving 16 bytes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_0-1701781750516.png" style="width: 516px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/253061i0063D48C27CE6BEF/image-dimensions/516x235?v=v2" width="516" height="235" role="button" title="chandan_uv_0-1701781750516.png" alt="chandan_uv_0-1701781750516.png" /&gt;&lt;/span&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 13:09:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32146-CAN-FD-issue/m-p/1769037#M29324</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2023-12-05T13:09:35Z</dc:date>
    </item>
  </channel>
</rss>

