Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: CAN (Controller Area Network) Uboot driver

$
0
0

Hi Christophe,

I have taken much time to enter this, So plz use utilize it.

PLZ READ CAREFULLY ONE BY ONE & ANSWER IT

Try "ifconfig -a" command  (list all the avail networks)

-"ip -V" gives : ip utility, iproute2-ss120105

i tried to install  IPROUTE 2.6.39 but can't cross-compile it :

Do you have "ip" command in your linux filesystem?    ---> Need reply ASAP

If yes, Have you cross compiled properly ? or Are you facing any problem?

If no, No problem, You can use "canconfig" command instead "ip" command.

NOTE:

Once you run the one of the below command after that only can0 node will enable in "ifconfig" command and it may list can0 node for "ifconfig -a" command (that means it ll list even disabled networks like CAN and you can enable CAN by issuing the one of the below command)

 ip link set can0 type can bitrate 50000 triple-sampling on

OR
canconfig can0 bitrate 50000 ctrlmode triple-sampling on

Now try "ifconfig" command, If you setup all configs include kernel then you can able to see the "can0" node

You have to enable CAN by issuing the one of the above command(ip or canconfig)

i have succeeded to build "candump  canecho  cansend  cansequence" binaries for ARM3352.

What about "canconfig" command , got failed?

What am i missing to have can0 seen as an interface ? (do i need to modify u-boot ?)

Not at all

Please post your bootup logs with attachment and not simple paste,

-With ipconfig i only have "eth0" and "lo" displayed.

then CAN support is not enabled in linux kernel.

I did configured CAN driver in linux :"ip -V" gives : ip utility, iproute2-ss120105

Please ensure that you followed the below steps to enable CAN support in linux kernel.

 

 

Linux Kernel configuration Procedure for CAN:


1) make ARCH=arm CROSS_COMPILE=<ur tool chain> menuconfig   ---> To select CAN driver in linux kernel config

Ex:

make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- menuconfig

2) Linux Driver Configuration

    DCAN device driver in Linux is provided as a networking driver that confirms to the socketCAN interface
    The driver is currently build-into the kernel with the right configuration items enabled (details below)

How DCAN driver fits into Linux architecture

    DCAN driver is a can "networking" driver that fits into the Linux Networking framework
    It is available as a configuration item in the Linux kernel configuration as follows:

  Linux Kernel Configuration
     Networking support
        CAN bus subsystem support
           CAN device drivers
              Bosch D_CAN devices
                Generic Platform Bus based D_CAN driver

Detailed Kernel Configuration

To enable/disable CAN driver support, start the Linux Kernel Configuration tool:

$ make menuconfig ARCH=arm

OR

Ex: If Cross compiler is arm-arago-linux-gnueabi-

make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- menuconfig



Select Networking support from the main menu.

    ...
    ...
    Power management options --->
[*] Networking support --->
    Device Drivers --->
    File systems --->
    Kernel hacking --->
    ...
    ...


Select CAN bus subsystem support as shown here:

    ...
    ...
    Networking options  --->
[ ] Amateur Radio support  --->
<*> CAN bus subsystem support  --->
    IrDA (infrared) subsystem support  --->
    ...

Select Raw CAN Protocol & Broadcast Manager CAN Protocol as shown here:

    ...
    --- CAN bus subsystem support
<*> Raw CAN Protocol (raw access with CAN-ID filtering)
<*> Broadcast Manager CAN Protocol (with content filtering)
    CAN Device Drivers  --->

Building D_CAN driver into Kernel

By default D_CAN driver is included in the Kernel

Select Bosch D_CAN devices in the above menu and then select the following options:

<*> Virtual Local CAN Interface (vcan)
<*> Platform CAN drivers with Netlink support
[*]   CAN bit-timing calculation
< >   TI High End CAN Controller
< >   Microchip MCP251x SPI CAN controllers
< > Philips/NXP SJA1000 devices  --->  
< > Bosch C_CAN devices  --->
<*> Bosch D_CAN devices  --->
    CAN USB interfaces  --->
          ...

Note: "CAN bit-timing calculation" needs to be enabled to use "ip" utility to set CAN bitrate

Select Generic Platform Bus based D_CAN driver as shown here:

--- Bosch D_CAN devices
<*>   Generic Platform Bus based D_CAN driver

By seeing the below your CAN log from bootup logs that you have enabled CAN but im surprising why you are not getting can0 node from your "ifconfig" command output.

[    1.184204] CAN device driver interface                                      
[    1.188201] CAN bus driver for Bosch D_CAN controller 1.0      

[    1.602111] can: controller area network core (rev 20090105 abi 8)           
[    1.608673] NET: Registered protocol family 29                               
[    1.613311] can: raw protocol (rev 20090105)                                 
[    1.617767] can: broadcast manager protocol (rev 20090105 t)                 

Anyway please ensure that you have enabled all the linux kernel options which is mentioned above for CAN support.

              
PFA of screen shots for your ref.


Viewing all articles
Browse latest Browse all 25965

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>