S32K144 can

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
6,511件の閲覧回数
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,378件の閲覧回数
Ada-gc
Contributor II

thank you very much

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
6,504件の閲覧回数
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,492件の閲覧回数
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,459件の閲覧回数
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,442件の閲覧回数
Ada-gc
Contributor II

Can I do this by reading and writing this struct?

Adagc_0-1653015907185.png

 

0 件の賞賛
返信
6,415件の閲覧回数
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,338件の閲覧回数
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,321件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

yes, you are right.

BR, Petr

0 件の賞賛
返信
6,379件の閲覧回数
Ada-gc
Contributor II

thank you very much

0 件の賞賛
返信