/********************************************************************* * i.mx6 Android CAN command line Test * Description: * Use Can-utils to test the can driver here. * 2016-8-9 Shenzhen Nanshan Ping Shan village Zengjianfeng ************************************************************* *******/one, Shell command flow:1. netcfg Can0 Down2. IP linkSetCan0 type can bitrate1000000Triple-sampling on (or: IP linkSetCan0 up type can bitrate1000000) 3. Ip-details-statistic link Show can04. netcfg Can0 up5. ./cansend Can0111#1122334455667788 6. Ip-details-statistic link Show can07. ./canfdtest-VV Can08. Ip-details-Statistic link Show Can0 II, operating process: [email protected]:/# netcfg Can0 down [email protected]:/# IP LinkSetCan0 type can bitrate1000000triple-sampling on [email protected]:/# Ip-details-statistic link Show can02: Can0: <NOARP,ECHO> MTU -Qdisc NoOp State down QlenTenLink/can can<TRIPLE-SAMPLING> State STOPPED (Berr-counter TX0Rx0) Restart-ms0bitrate1000000Sample-point0.733TQ theProp-seg5Phase-seg15Phase-seg24Sjw1FLEXCAN:TSEG14.. -Tseg22..8Sjw1..4Brp1.. theBrp-inc1Clock30000000Re-started bus-errors arbit-lost Error-warn error-pass bus-off0 0 0 0 0 0rx:bytes packets Errors dropped overrun Mcast0 0 0 0 0 0tx:bytes packets errors dropped carrier Collsns0 0 0 0 0 0[email protected]:/# netcfg Can0 up Flexcan imx6q-flexcan.0: Writing Ctrl=0x01232084 127| [Email protected]:/# cd/data/local [email protected]:/data/local #./cansend can0111#1122334455667788[email protected]:/data/local # Ip-details-statistic link Show can02: Can0: <NOARP,UP,LOWER_UP,ECHO> MTU -Qdisc Pfifo_fast State UNKNOWN QlenTenLink/can can<TRIPLE-SAMPLING> State error-active (Berr-counter TX0Rx0) Restart-ms0bitrate1000000Sample-point0.733TQ theProp-seg5Phase-seg15Phase-seg24Sjw1FLEXCAN:TSEG14.. -Tseg22..8Sjw1..4Brp1.. theBrp-inc1Clock30000000Re-started bus-errors arbit-lost Error-warn error-pass bus-off0 0 0 0 0 0rx:bytes packets Errors dropped overrun Mcast0 0 0 0 0 0tx:bytes packets errors dropped carrier Collsns8 1 0 0 0 0[email protected]:/data/local # Ip-details-statistic link Show can02: Can0: <NOARP,UP,LOWER_UP,ECHO> MTU -Qdisc Pfifo_fast State UNKNOWN QlenTenLink/can can<TRIPLE-SAMPLING> State error-active (Berr-counter TX0Rx0) Restart-ms0bitrate1000000Sample-point0.733TQ theProp-seg5Phase-seg15Phase-seg24Sjw1FLEXCAN:TSEG14.. -Tseg22..8Sjw1..4Brp1.. theBrp-inc1Clock30000000Re-started bus-errors arbit-lost Error-warn error-pass bus-off0 0 0 0 0 0rx:bytes packets Errors dropped overrun Mcast8 1 0 0 0 0tx:bytes packets errors dropped carrier Collsns8 1 0 0 0 0[email protected]:/data/local #./canfdtest-VV Can0Interface= Can0, family = in, type =3, Proto =1 0037: [8]Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng -C9xx 0037: [8]Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng -C9xx 0037: [8]Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng -C9xx 0037: [8]Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng Panax Notoginseng -C9xx^crecv Failed:bad file number Exiting ...255| [Email protected]:/data/local # ip-details-statistic link Show can02: Can0: <NOARP,UP,LOWER_UP,ECHO> MTU -Qdisc Pfifo_fast State UNKNOWN QlenTenLink/can can<TRIPLE-SAMPLING> State error-active (Berr-counter TX0Rx0) Restart-ms0bitrate1000000Sample-point0.733TQ theProp-seg5Phase-seg15Phase-seg24Sjw1FLEXCAN:TSEG14.. -Tseg22..8Sjw1..4Brp1.. theBrp-inc1Clock30000000Re-started bus-errors arbit-lost Error-warn error-pass bus-off0 0 0 0 0 0rx:bytes packets Errors dropped overrun Mcast + 5 0 0 0 0tx:bytes packets errors dropped carrier Collsns + 5 0 0 0 0[email protected]:/data/local #
i.mx6 Android CAN command line test