i.MX35 FlexCAN 1Mbps Linux problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

i.MX35 FlexCAN 1Mbps Linux problem

2,110 次查看
z0oba
Contributor I

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.

标记 (1)
0 项奖励
回复
2 回复数

1,661 次查看
gusarambula
NXP TechSupport
NXP TechSupport

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.

0 项奖励
回复

1,661 次查看
z0oba
Contributor I

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.

0 项奖励
回复