AnsweredAssumed Answered

S32K148 CAN issues

Question asked by he wei on Nov 22, 2018
Latest reply on Nov 27, 2018 by Alexandru Nan

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);
    delay_Nop(1000);
}

 

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

 

 

 

Outcomes