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