Hello!
I have a custom board with imx35 processor. Linux kernel is 2.6.31. I need to run CAN on 1 Mbps (on 500 Kbps work fine).
Configure bitrate:
echo 1000000 > /sys/devices/platform/FlexCAN.1/bitrate
The bitrate 1000000 can't supported with clock rate of 66500000
Ok, then i want to choose the other clock source, 24576000Hz as described in the datasheet:
echo osc > /sys/devices/platform/FlexCAN.1/br_clksrc
Then:
ifconfig can1 up
flexcan software Reset Timeouted
ifconfig: SIOCSIFFLAGS: No such device
It` s mean that SOFT_RST bit in MCR doesn`t want to be cleaned.
Have any ideas on this?
Thanks.
It is recommended to change the clock source bit only when the module is in disable mode. I would recommend changing the source code at the flexcan driver’s header file so the driver is loaded with the updated information.
On the flexCAn driver at Linux directory /rpm/BUILD/linux/drivers/net/can/flexcan
You will see the CTRL_CLK_SRC parameter in flexcan.h :
#define __CTRL_CLK_SRC (0x1 << 13)
Change it to (0x0 << 13)
Let me know if this helps.
Thanks for your reply!
But changing the source code " #define __CTRL_CLK_SRC (0x0 << 13)" is not helpful.
flexcan software Reset Timeouted
I have used for bit time calculation CAN Bit Time Calculation. And there are not correct parameters for 1Mbs, if we use 66.5Mhz or 24576000Hz clock source.
Maybe, i can change other clock? I can see only these clock sources in the datasheet.