S32k344 CAN Receive Frame Drop

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

S32k344 CAN Receive Frame Drop

124 Views
noobsplzwin
Contributor I

Hello NXP friends,

I'm encountering some issues with CAN bus data acquisition for an IMU in FreeMASTER, and I would appreciate any guidance or suggestions you can provide.

Hardware - Custom S32k344 PCB
SDK - RTD3.0.0
IDE - Simulink MBDT with S32CT 

Problem Description:

  • The IMU data acquisition intermittently hangs and switches between different CAN messages
     
  • Specifically, when IMU is transmitting three CAN messages with CAN ID 372 376 and 281, the CAN controller spends most of its time reading data with ID 281, causing the other two data points to be read infrequently, resulting in very slow updates (as shown in the first attached image).
  • It looks like when the CAN controller starts reading the CAN message with ID 281, it completely ignores the other two CAN messages.
    noobsplzwin_2-1718992473248.png

     

  • Reducing the Simulink model period and increasing the run count can improve the read frequency of the other two IDs. It looks like my CAN receive is configured to read with polling instead of interrupt
  • I tried to connect IMU to a ZLG CAN analyzer. Not CAN frame drop. However, it looks like all three CAN messages are received at the exact same timestamp (as shown in the second attached image).
    noobsplzwin_3-1718993010044.png
  • I also tested the CAN analyzer with the S32k344 by transmitting stored data that the CAN analyzer had received from IMU. FreeMaster shows normal ID reading switching with no data loss. (as shown in the second attached image)
    noobsplzwin_4-1718993143195.png

    noobsplzwin_5-1718993490127.png

         noobsplzwin_8-1718993636263.png

         noobsplzwin_7-1718993523776.png      

         noobsplzwin_9-1718993656249.png

  • I have configured three types of CAN Hardware Objects receive: polling, interrupt for standard ID and interrupt for extended ID to ensure I am not missing any messages.
  • It looks like our CAN configuration is reading the CAN messages with polling instead of interrupting. (This explains why changing Simulink step time would get more data reading)

Questions

  • What could be causing the controller to prioritize reading from CAN ID 281 and neglecting the other IDs? I feel like some of my S32CT configuration is incorrect.
  • For S32k3 MBDT, is there any way we can specify which CAN Controller to start reading? So far, it looks like the only way to read is via IRQ, which reads all the messages from all CAN Controllers are configured.

    I have attached my MEX file and Simulink model for reference. : ( My team has been troubled by this random issue for almost a week. Any help or advice would be highly appreciated!!!

    Regards,
    Connor

 

0 Kudos
1 Reply

55 Views
noobsplzwin
Contributor I

Update:

I noticed that the CAN Hardware Interrupt Callback of CANIf_RxIndication doesn't read/update the message from the CAN Bus. The actual reading is still done via the CAN_MainFunction_Read block that polling every cycle of step time, resulting in the frame loss.

Does CAN Receive have any custom notification block or predefined interrupt handler that is triggered whenever there is a message on the bus?

noobsplzwin_0-1719325295900.png

Can any of these irq be used?

Thanks,

 

 




0 Kudos