This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCAN4550: How to disable TCAN4550 Auto Bus_off function

Part Number: TCAN4550

Hi

When a fault canfd node in can network has been sending data all the time, the canfd network has been accumulating error frames. When a normal canfd node receives an error count of 127, 4550 will automatically shut down the CAN bus and no longer communicate with the outside world. Can the automatic bus of 4550 be closed_ Off operation, when 4550 enters bus_ After off state, how to operate can make 4550 continue to work normally

thank you

Hanc

  • Hanc,

    I apologize for the delay. Our team member is looking into this and will provide you feedback asap.

    Regards,

    Hao

  • Hi,Hao

    We have found out that the canfd network has entered the bus_ At present, the solution has been found. Just set the init register to recover. Thank you very much

    Regards,

    Hanc

  • Hi Hanc,

    Out of curiosity, are you using the default TI driver to work with the can?

    I'm currently resetting the device any time the device encounters Bus_off flag when it transmits. I didn't enable the interrupt for BO, so I only reset right before the transmission (ofc if the BO is set to 1).

    I'd imagine you have the interrupt enabled and perhaps when it happens you write the CCCR.INIT = 0 to set it back to normal operation?

    something like this in the interrupt handler?

        TCAN4x5x_Device_Interrupts dev_ir = {0}; // Define a new Device IR object for device (non-CAN) interrupt
                                                 // checking
        TCAN4x5x_MCAN_Interrupts mcan_ir = {0};  // Setup a new MCAN IR object for easy interrupt checking
        TCAN4x5x_Device_ReadInterrupts(&dev_ir); // Read the device interrupt register
        TCAN4x5x_MCAN_ReadInterrupts(&mcan_ir);  // Read the interrupt register
    
        if (dev_ir.SPIERR)                 // If the SPIERR flag is set
            TCAN4x5x_Device_ClearSPIERR(); // Clear the SPIERR flag
        if (mcan_ir.BO)
        {
            // Bus off event handling. Writing the CCCR should write init
            TCAN4x5x_MCAN_CCCR_Config cccrConfig = {0}; // the first bit will be 0 CCCR.INIT
            AHB_WRITE_32(REG_MCAN_CCCR, cccrConfig.word);
        }

    Thank you

  • Hi,Hao

    We don't use interrupt. We poll canfd status by periodic self-test. When status register PSR appears busoff state, we write CCCR.INIT to zero in time

       psr = AHB_READ_32(t_SpiBaseAddrForCANFD,REG_MCAN_PSR);
        //检查状态是否正常
        if(_Check4550Status(TCAN4550Index))
        {
            //状态寄存器异常,停止发送
            drvLog(LOG_ERR,"CANFD_%d read status error ! ! ! ! ! !\r\n",TCAN4550Index);
            return DRVSTATE_BUSERR;//bus error
        }
        else if((psr & 0x80) == 0x80)//can总线已自动关闭
        {
            drvLog(LOG_ERR,"can %d bus_off\r\n",TCAN4550Index);
    
            cccr = AHB_READ_32(t_SpiBaseAddrForCANFD,REG_MCAN_CCCR);
            drvLog(LOG_DEBUG,"can %d cccr 0x%x\r\n",TCAN4550Index,cccr);
            cccr &= ~(1<<0);
            AHB_WRITE_32(t_SpiBaseAddrForCANFD,REG_MCAN_CCCR,cccr);
            return DRVSTATE_BUSOFF;
        }