Using SocketCan in native custom service, for the same need to configure can interface at system boot (AOSP Android 8.0)

44 views
Skip to first unread message

deshmukh....@gmail.com

unread,
May 11, 2018, 10:12:19 AM5/11/18
to android-porting

Hi,
As mentioned in subject line i need to configure can interface at boot time im using TI's Jacinto6evm board.
Manually i configured it with commands.

                          su ip link set can0 type can bitrate 500000
                          su ifconfig can0 up

Respective can drivers built as a kernel module and loaded properly checked using
                        
                          lsmod | grep can
                                             
                          can_gw                  8564  0
                          can_bcm                14307  0
                          can_raw                 6781  1
                          can                    29922  3 can_gw,can_bcm,can_raw
                          c_can_platform          6830  0
                          c_can                   9697  1 c_can_platform
                          can_dev                12389  1 c_can

For make it up at system-boot made entry in "init.rc" in AOSP at path : $AOSP//system/core/rootdir/init.rc as shown below
                         
                          on boot
                         
                          su ip link set can0 type can bitrate 500000
                          su ifconfig can0 up

Its not getting up if i check it with command "ifconfig"

It logged error which i viewed using "dmesg"
                            [    3.952061] init: /init.rc: 535: invalid keyword 'su'
                            [    3.959166] init: /init.rc: 536: invalid keyword 'su'

Even tried without "su" i.e.
                         
                          ip link set can0 type can bitrate 500000
                          su ifconfig can0 up

In this case logged error which i viewed using "dmesg"
       
                           [    3.912085] init: /init.rc: 535: invalid keyword 'ip



Reply all
Reply to author
Forward
0 new messages