Hi,
Is it possible to change the tcan wake pin configuration via command line.
Similarly is there any command to set watermark level(RX buffer) in the command line?
Regards,
Akshay
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,
Is it possible to change the tcan wake pin configuration via command line.
Similarly is there any command to set watermark level(RX buffer) in the command line?
Regards,
Akshay
Hi Akshay,
I assume you are referring to a Linux Command Line configuration of the TCAN4550 registers. If so, I believe you are able to write to the registers using the tcan4x5x_write_tcan_reg function.
static int tcan4x5x_write_tcan_reg(struct m_can_classdev *cdev, int reg, int val) { struct tcan4x5x_priv *priv = cdev_to_priv(cdev); return regmap_write(priv->regmap, reg, val); }
And I believe you are able to read the registers using the tcan4x5x_read_reg function.
static u32 tcan4x5x_read_reg(struct m_can_classdev *cdev, int reg) { struct tcan4x5x_priv *priv = cdev_to_priv(cdev); u32 val; regmap_read(priv->regmap, TCAN4X5X_MCAN_OFFSET + reg, &val); return val; }
The WAKE_CONFIG bit field is located in register 0x0800[31:30] and can be set at any time.
The Watermark settings are valid only for the RX FIFOs and not when configured to use the dedicated RX Buffers. So I assume you are referring to the RX FIFO 0 and RX FIFO 1 watermark bit fields located in the respective RX FIFO 0 Configuration register 0x10A0[30:24] and RX FIFO 1 Configuration register 0x10B0[30:24].
These bit fields are "write protected" and can only be changed when the INIT and CCE bits of the Control Register 0x1018[1:0] are each set to '1'. However, also note that the CCE bit is write protected and the INIT bit must already equal '1' for the CCE bit to be set to '1', therefore you may need to write to this register several times to get both the INIT and CCE bits to be set to '1'. Once both these bits are set to '1' you can then configure any of the write-protected register bits in the TCAN4550 including the watermark bits.
Once you are done with your register configuration changes, you will need to write a '0' to the INIT bit to resume "normal operation". You write a '0' to CCE if you would like, or leave it set to '1' to allow re-configuration of the bits anytime the INIT bit is equal to '1'.
However, it is recommended to only set CCE to '1' when you need to make changes to write-protected bits and to set it back to '0' once complete. This is because the INIT bit will be set to '1' any time the device is not configured to communicate on the CAN bus including fault conditions. Leaving CCE set to '1' may expose the configuration bits to inadvertent changes.
Through these read and write functions, you should be able to read, write, and modify any of the TCAN4550 registers through the command prompt.
Regards,
Jonathan
Hi Jonathan,
As mentioned in one of the earlier post "TCAN4550: Error Code generated during insmod of tcan module".
Any update on the 3rd party updated driver.
Regards,
Akshay
Hi Jonathan,
Any update on the above query regarding the driver.
Regards,
Akshay Naik
Hi Akshay,
The last update we received from the developers last week was that they are still working on identifying areas of improvements and implementing the changes. They have found a few improvements that result in minor amounts of throughput improvement of roughly 10% to 20%. Unfortunately they have not found any large improvements that will result in the >80% throughput levels we are seeking, but they are still working on this.
Regards,
Jonathan