Issue in bringing-up CAN service during Boot-up

Hi There,

I am working on TI-J6 board over which I have ported Android-6.0.1. I am facing some issues while enabling the CAN protocol automatically while Boot-up. Though I am able to enable it manually after every boot using following command i.e. ip link set can0 up type can bitrate 500000.

I have already tried inserting this command in the init.rc file (Such that it gets enabled at the time of board boot-up only), but actually it is not working as expected. Also I am not sure in which file should I modify it i.e. I have two file "init.rc" and "init.jacinto6evmboard.rc". If my approach is correct, can anyone help me which files to be modify and at which place.

Or else suggest me the better way of doing it such that I can resolve the issue.

Thanks in advance.

Alkesh Shah

  • Hi Alkesh,

    I have forwarded your question to an Android expert.

  • Hi Alkesh,

    You can modify either file to define a new service that will launch a script and in that script you can add actions you want to do at boot time.
    Note that modifying init.*.rc files directly on target won't help. These files are part of ramdisk and not persistent.

    You have to update ramdisk.img, create a new boot.img out of it and flash the updated boot.img file

    Example below for launching a script at boot time

    Step 1) Define a new service in init.jacinto6evmboard.rc file, append below lines to the file

    service bringupcan /system/vendor/bin/
    class main
    user root
    group root

    Step 2) Write a script file and place it in system partition with executable permissions to the file

    ip link set can0 up type can bitrate 500000