5746R CAN SDK data trans to array

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

5746R CAN SDK data trans to array

420 Views
supra0309
Contributor I

Hi guys, I'm using 5746R to receive CAN SDK data, here's the struct from can_pal.h file. 

supra0309_0-1618972634742.png

I want to trans SDK data to  a array. But when debugging, I can't trans data to array successfully. How should I modify my code? Thanks.

supra0309_5-1618973283439.png

supra0309_2-1618973064098.png

supra0309_3-1618973102672.png

 

 

 

 

0 Kudos
1 Reply

413 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can refer to can_pal demo example. a below code is used to start receiving message

/* Define receive buffer */
can_message_t recvMsg;

/* Start receiving data in RX_MAILBOX. */
CAN_Receive(&can_pal1_instance, RX_MAILBOX, &recvMsg);

So MB used and address of receive buffer (recvMsg) are specified. After message is received you can access buffer using recvMsg.data[n]

/* Wait until the previous FlexCAN receive is completed */
while(CAN_GetTransferStatus(&can_pal1_instance, RX_MAILBOX) == STATUS_BUSY);

/* Check the received message payload */
if((recvMsg.data[0] == LED0_CHANGE_REQUESTED)

BR, Petr

0 Kudos