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驱动对CCCR寄存器有配置BRS位为1,但是通过CANFD 分析仪抓取数据发现数据段还是未加速

你好,通过在驱动中读取CCCR寄存器的值(CCCR=0x0303)发现,有把FDOE以及BRS位置为1,说明寄存器配置成功,但是通过CANFD分析仪抓取TCAN发来的帧发现数据段并为加速(通过示波器抓波形也分析出未加速),想问下这个问题怎么解决?

  • 您好,您的意思是通过分析仪测试下来,data rate并未提高到5Mbps,是这样的吗? 目前测试data rate 为多少?
    英文论坛上有一篇类似的帖子,您可以看下,如果仍有疑问,请随时反馈:
    e2e.ti.com/.../3440235
  • 你好,我的问题不太一样,我这边分析仪不会报错;不管是data rate设置成2M、5M,实际分析波形都是1M。

  • 陈工你好,目前我这边调试就只剩这一个问题了 还希望能够得到你的回复

  • 您好,关于data rate一直是1Mbps的这个问题我帮您再确认一下。
  • 您好,在改变 NBTP 和DBTP 寄存器之前,需要将CCCR的寄存器 INIT 和CCE设置为1.如果CCCR的寄存器设置的0x0303,那么需要重新配置NBTP 和DBT的值,并且在配置完成之前,需要将 CCE 和 INIT 位再配置为0.
    另外,您可以提供一下读写寄存器的顺序, Nomina 和Data bit rates 怎么配置的?以及clock frequency 是多少?
  • 你好,我用的是官方TCAN linux驱动,寄存器配置顺序是按照你说的这个顺序来的;另外仲裁段和数据段波特率是通过最新版本的iproute工具设置的,设置后可查看设置状态,确认仲裁段波特率和数据段波特率分别设置成了1M、5M;晶振是40Mhz的。

  • 你好,请问这个问题有解决方法了吗?目前我这边一直卡在这个问题上。

  • 您好,还在确认中,但是还没收到答复,我这边再问下,给您带来不便非常抱歉。
  • 好的,麻烦了哈
  • ni好,我其他相应的寄存器配置:101c 0x1e07, 100c 0x800410, 1048 0x600。

    期待你的回复,万分感谢。

  • 您好,我已经收到美国工程师的回复,他希望您这边能够提供完整的寄存器顺序和寄存器的值,以便帮助分析,另外,他也给了一些建议。我将他的回复贴在这里,您看下:
    The Linux driver has been included into the Kernel and the Linux community is responsible for driver support. This is a device support forum and I can help you with device specific issues, but I will not be of much help if the issue is with the linux driver.

    I previously asked you to send me the complete register sequence and values they are writing/reading from the device in their configuration sequence. Can you please provide that so that I can check it for errors? Without this information, I am unable to answer your question.

    I also previously mentioned the required registers and sequence that needed to be followed to change the frequency.

    The INIT and CCE bits of the CCCR register must be set to '1' prior to changing the NBTP and DBTP registers that configure the Nominal and Data phase bit timing. If the CCCR register eqals 0x0303, then you should be able to set the NBTP and DBTP registers with the new values. Then you will need to set the CCE and INIT bits in the CCCR register back to '0' before the configuration is complete.


    Can you tell me the value of the CCCR (0x1018), NBTP (0x101C), DBTP (0x100C) and TDCR (0x1048) so that I can check the settings?

    In order to change the frequency settings you will need to do the following:

    Set the INIT (bit 0) and CCE (bit 1) to '1' in the CCCR register (0x1018). This require a couple of writes to get both the INIT and CCE bits set to '1' because of the protected bit status and CCE can only be set when INIT is equal to '1'. Therefore the first write sets the INIT bit, but since the INIT bit at the time of write was set to '0' the CCE bit does not take the new value and remains at '0'. Then a second write to the CCCR register will allow the CCE bit and other bits to take the new values because the INIT bit is '1' at the time of the write. You have mentioned that the CCCR register was 0x0303, so it appears that the INIT and CCE bits are getting set to allow configuration.

    Once the CCCR register is set to allow initialization and configuration, you can write the new values to the NBTP, DBTP, and TDCR registers for the desired Nominal and FD Data rates.

    Once you have written the new values to these registers (and any other registers in the device), you need to change the INIT and CCE bits back to '0' so that the device exits the initial mode state and enters the normal operation mode. If you are able to see device transmit data on the CAN bus, then the INIT and CCE bits in the CCCR register should be set to '0' and the CCCR register should be 0x0300.

    This is the process. You mentioned "the programming sequence has no problem" so if that is true, the register NBTP, DBTP, and TDCR values must be set incorrectly. Can you verify that these registers are taking the values that are being written to them? If the INIT and CCE bits of the CCCR register are not set, the NBTP, DBTP adn TDCR registers will not take the new values and this could point to a sequence issue. But if these registers are taking the new values, then the NBTP, DBTP and TDCR register values are set incorrectly for the desired bit rates.

    Once you provide me the register specific information, I can check the values for errors.