MCXN947 CanBus Rx Stop Receiving

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

MCXN947 CanBus Rx Stop Receiving

848 Views
stevenlutz
Contributor III

I have the following block of code to receive Can Messages, however I usually only get 1 or 2 times through the while loop before the program hangs in the /* Wait until Rx MB full. */ loop. 
I also want to filter to only receive NMEA2000 PGN 1F805, but am using my test ID of rxIdentifier = 0xDF80502; for now which is being sent from a separate test device on the can network. 

I must be missing a step to clear the buffer?

while (true)

{

/* Start receive data through Rx Message Buffer. */

rxXfer.mbIdx = (uint8_t)RX_MESSAGE_BUFFER_NUM;

 

rxXfer.frame = &frame;

(void)FLEXCAN_TransferReceiveNonBlocking(EXAMPLE_CAN, &flexcanHandle, &rxXfer);

 

/* Wait until Rx MB full. */

while (!rxComplete)

{

};

rxComplete = false;

 

LOG_INFO("Rx MB ID: 0x%3x, Rx MB data: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, Time stamp: %d\r\n", frame.id >> CAN_ID_EXT_SHIFT, frame.dataByte0, frame.dataByte1, frame.dataByte2, frame.dataByte3, frame.dataByte4, frame.dataByte5, frame.dataByte6, frame.dataByte7, frame.timestamp);

}

 

This is the only masking mechanism I see, how can I set the proper mask for matching specific part of a CAN ID?

/* Set Rx Masking mechanism. */

FLEXCAN_SetRxMbGlobalMask(EXAMPLE_CAN, FLEXCAN_RX_MB_EXT_MASK(rxIdentifier, 1, 0));

 

 

Labels (1)
Tags (2)
0 Kudos
Reply
2 Replies

813 Views
stevenlutz
Contributor III

I believe this issue to due to a misconfigured TJA1152 CAN Tranciever. NDA required for documentation. 

0 Kudos
Reply

799 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @stevenlutz 

It seems that the issue is related to your private ticket. I have replied to you on that ticket. Please contact me if you still have any issues.

 

BR

Alice

0 Kudos
Reply