S32K148 CAN issues

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

S32K148 CAN issues

Contributor III

Hello NXP,

I have two questions:

    SendCANData(18,CanTxId0[CanTxBCM_7F2h],BCM_7F2h._c,CanTxDLC0[CanTxBCM_7F2h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_786h],BCM_786h._c,CanTxDLC0[CanTxBCM_786h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_6E6h],BCM_6E6h._c,CanTxDLC0[CanTxBCM_6E6h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_6E5h],BCM_6E5h._c,CanTxDLC0[CanTxBCM_6E5h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_6E4h],BCM_6E4h._c,CanTxDLC0[CanTxBCM_6E4h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_401h],BCM_401h._c,CanTxDLC0[CanTxBCM_401h]); //Cycle time:0ms
    SendCANData(18,CanTxId0[CanTxBCM_3C3h],BCM_3C3h._c,CanTxDLC0[CanTxBCM_3C3h]); //Cycle time:0ms

The send cycle time is 5ms;

SendCANData function is this:

void SendCANData(uint32_t mailbox, uint32_t messageId, uint8_t * data, uint32_t len)
    flexcan_data_info_t dataInfo =
            .data_length = len,
            .msg_id_type = FLEXCAN_MSG_ID_STD,
            .enable_brs  = false,
            .fd_enable   = false,
            .fd_padding  = 0U
    FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, mailbox, &dataInfo, messageId);
    FLEXCAN_DRV_Send(INST_CANCOM1, mailbox, &dataInfo, messageId, data);

    /*Wait the CAN MB transfer successfully */
    //while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, mailbox) == STATUS_BUSY);

case1: when I use the delay_Nop(1000), The send cycle is successful and receive can message is ok.

               but when I use the "while(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, mailbox) == STATUS_BUSY);”, Send cycle is successful,but  the MCU can't entry the RXFIFO interrupt function to receive CAN message, why??

case 2:  When I use the delay_Nop(1000), Disconnect or Short Connect CAN Wire,After recovering the CAN wire to normal,CAN send cycle message can't be send successfully.  I check the status is "STATUS_CAN_NO_TRANSFER_IN_PROGRESS". What can I do? Thanks

0 Kudos
1 Reply

NXP Employee
NXP Employee



First of all let's start with the beginig of the problem.

1 What SDK Version you used ?

2 What CPU\Board used ?

3 What you want to do exactly ?

4. What is the driver configuration structure ?

0 Kudos