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.
Hi Team,
When we are loading tcan5x5x.ko driver. it is showing below mentioned error in some cases.
2916.121542] tcan4x5x spi1.0: no clock found
[ 2916.125768] tcan4x5x spi1.0: no CAN clock source defined
[ 2916.131176] spi-imx spi_imx_setup: mode 0, 32 bpw, 18000000 hz
[ 2916.160886] tcan4x5x spi1.0 (unnamed net_device) (uninitialized): Failed to init module
[ 2916.191100] tcan4x5x spi1.0: m_can device registered (irq=216, version=32)
[ 2916.198048] tcan4x5x spi1.0 can0: TCAN4X5X successfully initialized.
it is not coming every time during driver loading. we are trying 15 times then 5 to 7 times this error is coming.
Could you please guide us and tell us what can be a root cause for this message and how we can fix it.
Regards
Ramji Mishra
Hello Ramji,
This is a forum that supports the TCAN4550 at a device level, and it is not a Linux forum. The tcan4x5x driver was upstreamed into the kernel and is supported by the Linux community. My expertise is with the TCAN4550 device and not with the Linux driver. Is there any way to monitor or log the SPI register configuration during this process? If so I may be able to determine where the error is occurring by reviewing the various Status, Interrupt, and configuration registers.
Regards,
Jonathan
Hi Jonathan,
I checked Modes of Operation and Pin Configuration Registers (address = h0800) [reset = hC8000468 ]. it seems like TCAN is in standby mode.
*******READ-REG-CONFIG=A8000048******
Could you please tell us what possible reasons for this standby mode can be?
Regards
Ramji Mishra
Hi Ramji,
Can you tell me what the Status (0x000C), Interrupts (0x0820), and MCAN Interrupts (0x0824) register values are?
If the driver is supposed to initialize and configure the device into Normal mode, there may be some issue causing the device to transition to Standby mode that will be reflected in the Status or Interrupt registers that can give us a clue.
Regards,
Jonathan
Hi Jonathan,
Please find the attached register value.
Interrupts (0x0820)
READ-REG-INT-FLAGS=0x81004400
MCAN Interrupts (0x0824)
READ-REG-MCAN_INT-FLAGS=0x0
Status (0x000C)
READ-REG-TCAN5X5X-STATUS=0x8000000
Regards
Ramji Mishra
Hi Ramji,
From the Interrupts register (0x0820) I see the following bits are set:
31: CAN Bus normal (meaning it has changed to normal mode and seen at least one Dominant to Recessive transition)
24: Part of reserved block 30:24 (no information provided)
14: Local wake up has occurred
10: CAN bus is silent (meaning there is no activity on the CAN bus) However, when this bit is set we should also see the CAN error (CANERR bit 5) get set which is the logical OR of the CAN Silent (CANSLNT bit 10) and CAN Stuck Dominant (CANDOM bit 8). But CANERR is '0' which is unexpected.
From the MCAN Interrupts register (0x0824) I see there are no bits set, so I can't tell if the device has actually participated in any CAN communication that would have led to a Bus Off condition which would have forced itself back into Standby mode. Typically I would generally see at least one bit have a value such as the Timestamp Wraparound bit get set to indicate the timestamp counter has wrapped around because this isn't a long counter, so this would be a bit I would look for to determine if the register is returning a real value instead of a default value of all 0's. However, if the register is read quickly after initialization, then this still may be an accurate value. But it doesn't appear CAN errors are responsible for placing the device into standby mode.
The Status Register (0x000C) shows a single bit set.
27: Internal_error_log_write (meaning that there was some error related to a SPI register, or MRAM, Read or Write). There is a FIFO like shift register used to pass data from the digital core and MCAN controllers that operate off of the device's system clock (20 or 40 MHz) and the SPI bus that is operating off of the SPI clock at a lower frequency. This FIFO shift register handles the clock domain crossing and if there is an error, it is usually caused by some sort of clock related issue that prevents the device from passing data into or out of the device through the SPI bus. However, I would also usually expect to see some sort of SPI Error associated with this, and I don't see any of those bits getting set.
Looking back to the information in the previous posts, the initial log shows some clock related messages. My expertise is with the TCAN4550 and not Linux, but the internal_error_log_write may correlate some sort of clock issue being reported with the "No Clock Found" and "No CAN clock source defined" messages.
I also do not know why the CAN Bus Normal bit is getting set if the device was stuck in Standby mode based on the previous information.
Can you tell me if you are using a custom board, or one of the development boards designed by TI (TCAN4550EVM or BOOSTXL-CANFD-LIN)?
If you are using a custom board, can you share the schematics related to the TCAN4550 so I can check them?
Regards,
Jonathan