S32K118 CAN Extension Frame Example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K118 CAN Extension Frame Example

1,472件の閲覧回数
zhangzhiyong
Contributor III

Hi, Is there a CAN extension frame example based on S32k family mcus (preferably S32K118) ?

Or help guide how to use the SDK modification?

For example, the destination address and the original address in the extension frame, how are these configured?

How are these two filters chosen? Is that ID the source and destination address for configuring the extension frame?

微信图片_20200909092002.jpg

0 件の賞賛
返信
1 返信

1,457件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

 

this settings belongs to Pretended Networking functionality used in low power mode.

To send/receive extended frames message buffer setting is done within code.

For RX:

#define RX_MAILBOX 0
#define RX_MSG_ID 0x00001234

flexcan_data_info_t dataInfo =
{
   .data_length = 1U,
   .msg_id_type = FLEXCAN_MSG_ID_EXT,
   .enable_brs = false,
   .fd_enable = false,
   .fd_padding = 0U
};

/* Configure Rx message buffer with index 1 to receive frames with ID 2 */
 (INST_CANCOM1, RX_MAILBOX, &dataInfo, RX_MSG_ID);

/* Receive a frame in the recvBuff variable */
flexcan_msgbuff_t recvBuff;

FLEXCAN_DRV_Receive(INST_CANCOM1, RX_MAILBOX, &recvBuff);

 

for TX:

#define TX_MAILBOX 1
#define TX_MSG_ID 0x0000ABCD

/* Set information about the data to be sent */

flexcan_data_info_t dataInfo =
{
   .data_length = 1,
   .msg_id_type = FLEXCAN_MSG_ID_EXT,
   .enable_brs = false,
   .fd_enable = false,
   .fd_padding = 0U
};

/* Configure TX message buffer with index TX_MSG_ID and TX_MAILBOX*/
FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, TX_MAILBOX, &dataInfo, TX_MSG_ID );

/* Execute send non-blocking */
FLEXCAN_DRV_Send(INST_CANCOM1, TX_MAILBOX, &dataInfo, TX_MSG_ID, data);

 

BR, Petr

 
0 件の賞賛
返信