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.

Getting error while setting bitrate in CAN interface for android ICS

Hi,

I am trying to set the bit-rate in android ICS.

I am using iproute2 utility to set bitrate for CAN controller. The command used to set the bitrate is given below:

#ip link set can0 type can bitrate 125000

While I am trying to set the bitrate in android using below command, I am getting below error message:

Garbage instead of arguments \"bitrate ...\". " "Try \"ip link help\""

Please suggest me any solution to solve this issue. I am struggling with this one for 3 weeks.

Thanks in advance,

regards,

Salih

  • Hi Salih,

    On which platform you are trying?

    1. Have you downloaded latest iproute2 package and builded properly?

    http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Utilities

    2. One point I can think of here is "can" is not integrated into iproute2, can you verify this?

    Note: check the result of ip link help ;ensure that the TYPE field contains can

    3. Make sure that the build images and execution images are correct? Execute iproute2 directly, go to the binaries folder and run this "./ip"

    (OR)

    One more option you have is, set bittimming parameters use "canconfig"

    canconfig can0 bitrate 50000 ctrlmode triple-sampling on
     canconfig can0 start 

    Thanks

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Hi Anil,

    Actually I am getting this error only when i will test in the android file system. If once I tested with this uImage in the Linux file system, it works properly.

    I debugged the iproute2 application and found that there was an error in the file ip/iplink.c

    I analysed and debugged inside the source code of this utility and compared with the Linux utility source. I found that the error was occurred in the system call dlsym().

            l = dlsym(dlh, buf);
            if (l == NULL)
                    return NULL;

    This function suppose to return some valid address. But in my case, its returning the NULL.

    In Linux, its returning the proper address and it is passed in the case.


    After I called this system call dlerror(), I am getting the below message:

     symbol not found:

    Please suggest me any solution to solve this issue.

     Thanks in advance,
    regards,
    Salih