On 10/03/11 05:21, li guohu wrote:

> I am using the socketcan to try to send can message. But now I encounter some
> questions. So I write this mail to seek help.
> 
> The CPU I am using is freescale's MPC5125. And the board is TWR-MPC1525. The
> linux kernel I am using is linux 2.6.29.1 and patched by freescale.


As i can see from the source code you provided in the zip file ...

    ifr.ifr_ifru.ifru_ivalue = 1000000;
    ret = ioctl(s, SIOCSCANBAUDRATE, &ifr);

you set the baudrate via ioctl() which is specific to the freescale patches.

The best is, if you could upgrade to a recent mainline kernel which uses the
netlink configuration interface for the bitrate setting (with the 'ip' tool
from the iproute2 package). Or you can ask freescale to provide mainline CAN
support in their BSP ;-)

Also the

> NETDEV WATCHDOG: can0 (fsl-mscan): transmit timed out 


handling has changed in the mainline kernel.

Btw. if you don't have the chance to update (or only put the stuff from
linux/drivers/net/can into your tree) you can try to go with your current setup.

I assume that you CAN setup has some general problems.

Please check, if you have

- a second(!) CAN node using the same(!) bitrate that can acknowledge your
sent data

- a properly terminated(!) and connected CAN bus

Having only one CAN node does NOT work!

Usually it's the best approach to connect to a working CAN network first and
to check, if the reception of CAN frames works properly on your system. This
ensures the two points above are solved.

Regards,
Oliver
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to