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: TCAN4550 Standby mode

Part Number: TCAN4550

Hello

I'm using  TCAN4550EVM to my board by wired connection.

and I'm trying make FW with Linux Driver code (starting with lastest version.. 5.12.xxx).

my board don't use Linux, but I can't find other driver source code,

I made my board's driver refer to linux source.

I want to control CAN bus start / stop manually.

when stop state, I hope to CAN bus just ignore all signal. (don't react or reconized)

I hope to CAN bus start with new comming packet ater start signal.

I made my FW source like Linux code flow -  m_can_start() / m_can_stop()

static void m_can_start(struct net_device *dev)
{
	struct m_can_classdev *cdev = netdev_priv(dev);

	/* basic m_can configuration */
	m_can_chip_config(dev);

	cdev->can.state = CAN_STATE_ERROR_ACTIVE;

	m_can_enable_all_interrupts(cdev);
}

static void m_can_stop(struct net_device *dev)
{
	struct m_can_classdev *cdev = netdev_priv(dev);

	/* disable interrupts */
	m_can_write(cdev, M_CAN_IR, IR_ALL_INT);
	m_can_write(cdev, M_CAN_IE, 0);

	/* disable all interrupts */
	m_can_disable_all_interrupts(cdev);

	/* Set init mode to disengage from the network */
	m_can_config_endisable(cdev, true);

	/* set the state as STOPPED */
	cdev->can.state = CAN_STATE_STOPPED;
}

Start time TCAN register controled like  m_can_start() function code.

and Stop time set like m_can_stop()

According to Linux code, TCAN set always Normal mode. and I set same.

But, when TCAN stay at stop condition, if there are packets comming in CAN bus,

TCAN(i think M_CAN probably) store that packets.

after giving a start signal, TCAN generate RX interrupt by early received packet.

but I hope to start with new packet.

then, I tried change standby mode at stop state.

for standby mode, I set register h0800 to  0x08000642

at standby state, I checked  0x1018 (CCCR), it was 0x19  (clock off)

but, even though it's in standby mode, if there are packets comming in CAN bus at stop state (standby mode)

TCAN still generate RX interrupt when it start time.

Q1. according to datasheet Table.1 Mode Overview, CAN TX/RX is off in standby mode.

       but, I think it still alive because TCAN generate a interupt at start time by earlier packet.

       why TCAN(M_CAN) generate the interrupt when packet recived at stanby state?

Q2. I hope to ignore all signal at stop state. How can I to do?

Thank you

  • Hi DH,

    I understand you are trying to program an effective Disabled Mode for TCAN4550. This sounds different than the Standby or Sleep modes that are built in. When the device is in Sleep mode, it will automatically change into Standby Mode when it detects activity on the CAN bus and an interrupt will be generated to inform the MCU of this state change. I don't think this is what's desired of your use case. 

    A way to avoid interrupt generation from a certain (or all) message would be to configure the filters to ignore message with particular IDs. Using this function, the MRAM could be reconfigured to accept no messages are accepted during the Disabled phase. Once the node is ready to receive again, the MRAM could be reconfigured to the desired filter configuration for bus data. 

    Does this sound like a valid solution to your use case? Let me know if you would like help with configuring the MRAM for this device. I'll link some resources below:
    TCAN4550 software user's guide
    TCAN4550 demo code (c drivers which may be more readable than the Linux code)

    Regards,
    Eric Schott

  • Thank you Eric.

    I haven't solved this problem yet because I had to do another project.

    during past days, I made my board with TCAN4550, and I am trying with my board

    Today, i tried your advice using of ID filter.

    I tried two ways, use CFC or SIDFC/XIDFC.

    but, even fiter set to reject all packet, but it was still generate interrupt by early comming packet before start.

    I tried like this:

    CFC set 0x3f before start, and change to 0x0 when it start state.

    massage ram filter set like this

    Standard : (0x3<<27)|0x7ff

    extend  F0: (0x3<<29)

    extend  F1: 0x1fffffff

    It is changed to 0x0 when it start state.

    I think filter set was correct. because if I didn't change filter set to accept in start state, any interrupts was not generated by all comming packet.

    I tested this way:

    1) system boot up and it is stop state first. (interrupt disabled / filter set enabled )

    2) generate can(fd) packet using external generator (approximately thousands)

    3) stop generating packet.

    4) board set to start state. (enable interrupt / disable filter set)

    5) board started there aren't any comming packet, it should be not generate any receive interrupt, I think.

        but, interrupt generated by early comming packet.

        some of them are read correctly in RAM.

        (but after few packet comming, IR.RF0L was occured. after that, IR.RF0L was generated always by comming packet)

        if I didn't change filter set when it start time, filter is works, and didn't generate any interrupt.

    If i did something wrong or have an other idea, please give me advice.

    thank you.

  • Hi DH,

    I'm reviewing your reply and will get back with more info tomorrow. 

    In the meantime, would you be able to check what interrupt is being reported by TCAN4550 while it's configured to reject all CAN frames? It's possible some other event, such as error frame detection, is triggering the interrupt.

    Also to confirm, the filters are not in effect while the device is in sleep mode. Any activity on the CAN bus will wake the device, regardless of filter configuration. The feature allowing for selective wake-up (also called partial networking) is not supported by TCAN4550.

    Regards,
    Eric Schott

  • Thnak you again Eric.

    I'm sorry but this question seems to come from lack of knowledge of CAN-bus auto retransmission.
    Early comming packets were not completed, and that remained retransmission state.
    those retransmission packtets incomming when system goes to start state, make interrupts.

    the real preblem was SPI speed. I think.
    i sent about few thousands packets before start state.
    those packets retransmiss to short interval when system goes to start state.
    that packets occured IR.RF0N interrupt ant the first few packets are processed normally.
    but, after that, the IR.RF0L occurs and this condition is maintained.
    IR.RF0L didn't clear after it occured once.

    I think SPI bus speed is too slow to handle incoming packets at short intervals.
    Host could not read fifo quickly, packets occred overflow ans lost.
    I use max speed (18MHz) already, but it's not enough.

    my early board used SoC intergrated with CAN-bus
    that board didn't have problem like this because SoC was able to handle all retransmissed packets

    Can i reset CAN-bus prevent retransmission packets?

    or can i get other advice to solve this problem?

    thank you

  • DH,

    Are the re-transmissions happening because of an error? There is a bit in register 0x1018 where you can disable automatic re-transmission, this is bit 6 in that register, and setting it to 1 will disable automatic re-transmission.

    Regards,

    Eric Hackett