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与 Linux 板连接。 启动时、内核日志显示时钟源未定义。 tcan4x5x 驱动程序的探针失败。
这是我的日志。
tcan4x5x spi1.0: TCAN: tcan4x5x probe TCAN: tcan4x5x probe [DEBUG]-----------tcan4x5x_can_probe,spi device: tcan4x5x, irq:49 tcan4x5x spi1.0: TCAN: Allocating memory tcan4x5x spi1.0: no clock found tcan4x5x spi1.0: TCAN: no CAN clock source defined tcan4x5x spi1.0: TCAN: SPI CLK freq is 1000000 tcan4x5x spi1.0: TCAN: Parsing config tcan4x5x spi1.0: TCAN: configuring SPI tcan4x5x spi1.0: TCAN: tcan4x5x init TCAN: tcan4x5x init TCAN: tcan4x5x clear interrupts start TCAN: tcan4x5x status flags clear start TCAN: tcan4x5x status flags clear end, ret = 0 TCAN: tcan4x5x enable mcan interrupts function start TCAN: tcan4x5x enable mcan interrupts function end, ret = 0 TCAN: tcan4x5x interrupt flags clear start TCAN: tcan4x5x interrupt flags clear end, ret = 0 TCAN: tcan4x5x error status clear start TCAN: tcan4x5x error status clear end, ret = 0 TCAN: tcan4x5x clear interrupts end, ret = 0 TCAN: tcan4x5x write tcan reg start TCAN: tcan4x5x write tcan reg end, ret = 0 TCAN: tcan4x5x regmap update bits start TCAN: tcan4x5x regmap update bits end, ret = 0 random: fast init done tcan4x5x spi1.0: TCAN: tcan4x5x init returned 0 tcan4x5x spi1.0: TCAN: tcan4x5x m_can class register TCAN: m_can_class_register - calling m_can_dev_setup Core release register value is 1999568896 Endian register value is 1999568896 Endian register value is 1999568896 tcan4x5x spi1.0: Unsupported version number: 0 TCAN: m_can_class_register - m_can_dev_setup returned -22 tcan4x5x spi1.0: TCAN: tcan4x5x m_can class register returned -22 tcan4x5x spi1.0: TCAN: Probe failed, err=-22 tcan4x5x spi1.0: TCAN: Probe failed, err=-22 tcan4x5x: probe of spi1.0 failed with error -22
器件树:
&spi1{ pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>; rtk,spi-for-kernel = <1>; rtk,spi-slave-mode = <0>; // SPI master rtk,spi-cs-gpios = <&gpioa 2 0>; status = "okay"; tcan4x5x: tcan4x5x@0 { compatible = "ti,tcan4x5x"; reg = <0>; #address-cells = <1>; #size-cells = <1>; spi-max-frequency = <10000000>; bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>; interrupt-parent = <&gpioa>; interrupts = <8 IRQ_TYPE_EDGE_BOTH>; device-state-gpios = <&gpioa 1 0>; device-wake-gpios = <&gpioa 6 0>; reset-gpios = <&gpioa 0 0>; }; };
在这里有人能帮我吗?
尊敬的 Sai:
我们不直接支持此器件的 Linux 驱动程序、因为它们由开源社区管理、因此我们在这里的专业知识可能会受到限制。 我们将能够为解决有关 TCAN4550本身的问题提供更多帮助。
SPI 接口的时钟信号由系统的 MCU 控制、因此时钟源可能以直接连接到处理器的晶体为基准。 TCAN4550的 CAN 时钟通常是 IC 附近的独立晶振、可以是20MHz 或40MHz 振荡器。 此处缺失的字段可能需要知道要使用此 CAN 时钟源的值、以便正确确定 CAN 数据速率。
TCAN4550EVM 电路板上配有一个40MHz 晶体、如果使用该晶体可将驱动器配置为正确的 CAN 数据速率配置。
如果这是您正在寻找的内容、以及您还有任何问题、请告诉我。
此致、
埃里克·肖特
尊敬的 Sai:
感谢您在此处分享逻辑分析仪的照片。 在 TCAN4550中、有几项操作看起来与预期的 SPI 操作不一致。
每个事务的第一个字节(在 SPI-Enable 驱动为低电平之后)应为读取命令(READ_B_FL = 8'h41)或写入命令(WRITE_B_FL = 8'h61)。 在前几个事务中、该第一个字节不包含这些值、字节值0x00或0x20很常见。 这将是 TCAN4550的无效输入并会导致 SPI 错误、任何数据都将被忽略。
同样可以清楚地看到、MISO 线路在整个捕获过程中处于空闲状态。 即使第一个字节中的命令无效、我仍然希望 TCAN4550在事务的第一个字节期间发送中断寄存器(h0820)的值。 这导致我认为 TCAN4550的时钟输入存在问题、或者逻辑分析仪无法正确识别来自器件的数据。 请确保逻辑分析仪能够检测 TCAN4550根据器件的 Vio 电源所驱动的逻辑电平。 我还建议检查晶体振荡器是否工作正常。 您可以通过尝试读取 h0000 - h000C 之间的任何寄存器来检查这一点。 这些寄存器无需激活振荡器即可访问、而包括中断寄存器(h0820)在内的所有其他寄存器均需要该振荡器输入处于激活状态并保持稳定。
此致、
埃里克·肖特