S32K144 can

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K144 can

跳至解决方案
6,462 次查看
Ada-gc
Contributor II

I want to change the specified bit when sending CAN data. What should I do?

Adagc_0-1652780866370.png

 

0 项奖励
回复
1 解答
6,329 次查看
Ada-gc
Contributor II

thank you very much

在原帖中查看解决方案

0 项奖励
回复
8 回复数
6,455 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if you want to send new std ID value just modify ID standard filed of selected MB having IDE=0 and let module to send it by updating CODE field. If running SDK driver simply use Send function

PetrS_0-1652784291677.png

If you want to flip bit of sending message, to disturb a frame, then module is not able to do that.

BR, Petr 

0 项奖励
回复
6,443 次查看
Ada-gc
Contributor II

Sorry, I can describe it more clearly

When sending CAN data, the specified bit needs to be changed, and when receiving CAN data, it is necessary to judge whether the specified bit data is 0 or 1. Do you have any suggestions?

Adagc_0-1652876241958.png

 

 

0 项奖励
回复
6,410 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

when sending message MB ID word specify teh ID to be send, when MB receive a message its ID word stores the ID received.

BR, Petr

0 项奖励
回复
6,393 次查看
Ada-gc
Contributor II

Can I do this by reading and writing this struct?

Adagc_0-1653015907185.png

 

0 项奖励
回复
6,366 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes this structure is used for buffer variable used for receiving. After successful message receiving this variable is updated

/* Define receive buffer */
flexcan_msgbuff_t recvBuff;

/* Start receiving data in RX_MAILBOX. */
FLEXCAN_DRV_Receive(INST_CANCOM1, RX_MAILBOX, &recvBuff);

 

To send message below is used and the ID is parameter of Send function

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

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

BR, Petr

0 项奖励
回复
6,289 次查看
Ada-gc
Contributor II

Excuse me, the ID data type in the structure is uint_32, and the 18th to 28th bits represent the arbitration ID?

Adagc_0-1654839226010.png

 

标记 (1)
0 项奖励
回复
6,272 次查看
PetrS
NXP TechSupport
NXP TechSupport

yes, you are right.

BR, Petr

0 项奖励
回复
6,330 次查看
Ada-gc
Contributor II

thank you very much

0 项奖励
回复