# ip link set can0 up
nuc970-can0 nuc970-can0 can0: bit-timing not yet defined
nuc970-can0 nuc970-can0 can0: failed to open can device
ip: SIOCSIFFLAGS: Invalid argument
#
# ifconfig -a
can0: flags=128<NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 58
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 0 (Local Loopback)
RX packets 702 bytes 51832 (50.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 702 bytes 51832 (50.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
#
离线
buildroot 增加 BR2_PACKAGE_IPROUTE2=y 报如下的错误,记录下
# ip link set can0 up
nuc970-can0 nuc970-can0 can0: bit-timing not yet defined
nuc970-can0 nuc970-can0 can0: failed to open can device
RTNETLINK answers: Invalid argument
离线
启动日志
Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Initializing cgroup subsys cpuacct
Linux version 3.10.108+ (root@nrm) (gcc version 4.8.5 (Buildroot 2016.11.2) ) #24 PREEMPT Wed Oct 9 08:52:35 CST 2019
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC970
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 16384
free_area_init_node: node 0, pgdat c050bd60, node_mem_map c0546000
Normal zone: 128 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 16384 pages, LIFO batch:3
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 rootfstype=yaffs2 rootflags=inband-tags console=ttyS0,115200n8 rdinit=/sbin/init mem=64M
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 59512k/59512k available, 6024k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc048aeec (4620 kB)
.init : 0xc048b000 - 0xc04cdbf0 ( 267 kB)
.data : 0xc04ce000 - 0xc050c540 ( 250 kB)
.bss : 0xc050c540 - 0xc0545848 ( 229 kB)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:625
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
console [ttyS0] enabled
Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys perf_event
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc0387658 - 0xc0387694
devtmpfs: initialized
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c_gpio_probe - pdev = i2c-gpio
platform i2c-gpio.2: Driver i2c-gpio requests probe deferral
cfg80211: Calling CRDA to update world regulatory domain
NET: Registered protocol family 2
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
ROMFS MTD (C) 2007 Red Hat, Inc.
yaffs: yaffs built Oct 9 2019 08:49:24 Installing.
msgmni has been set to 116
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
[nuc970fb_probe] 10
Console: switching to colour frame buffer device 60x34
fb0: nuc970fb frame buffer device
nuc970-uart.0: ttyS0 at I/O 0x0 (irq = 36) is a NUC970
nuc970-uart.6: ttyS6 at I/O 0x0 (irq = 40) is a NUC970
nuc970-uart.8: ttyS8 at I/O 0x0 (irq = 41) is a NUC970
nuc970-uart.9: ttyS9 at I/O 0x0 (irq = 46) is a NUC970
brd: module loaded
nuc970 mtd nand driver version: 20160331
NAND device: Manufacturer ID: 0xef, Chip ID: 0xf1 (Winbond NAND 128MiB 3,3V 8-bit), 128MiB, page size: 2048, OOB size: 64
nand: SMRA size 64, 32
Bad block table not found for chip 0
Bad block table not found for chip 0
Scanning device for bad blocks
Bad block table written to 0x000007fe0000, version 0x01
Bad block table written to 0x000007fc0000, version 0x01
Creating 3 MTD partitions on "nand0":
0x000000000000-0x000000200000 : "u-boot"
0x000000200000-0x000001600000 : "Kernel"
0x000001600000-0x000008000000 : "user"
fmi-sm: registered successfully! mtdid=nand0
CAN device driver interface
nuc970-can0 nuc970-can0: nuc970_can0_platform device registered (regs=f800b000, irq=58)
libphy: nuc970_rmii0: probed
nuc970-emac0 nuc970-emac0: phy_find_first() failed
nuc970-emac0 nuc970-emac0: nuc970_mii_setup err
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci_nuc970_probe() - name: nuc970-ehci
nuc970-ehci nuc970-ehci: Nuvoton NUC970/N9H30 EHCI Host Controller
nuc970-ehci nuc970-ehci: new USB bus registered, assigned bus number 1
nuc970-ehci nuc970-ehci: irq 23, io mem 0xb0005000
nuc970-ehci nuc970-ehci: USB 2.0 started, EHCI 0.95
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc970-ohci nuc970-ohci: Nuvoton NUC970/N9H30 OHCI Host Controller
nuc970-ohci nuc970-ohci: new USB bus registered, assigned bus number 2
nuc970-ohci nuc970-ohci: irq 24, io mem 0xb0007000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new interface driver usb-storage
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
nuc970adc_probe - pdev = nuc970-adc
i2c-core: driver [ns2009-ts] using legacy suspend method
i2c-core: driver [ns2009-ts] using legacy resume method
nuc970-rtc nuc970-rtc: rtc core: registered nuc970-rtc as rtc0
i2c /dev entries driver
ns2009_ts_detect: Detected chip ns2009-ts at adapter 0, address 0x48
input: ns2009-ts as /devices/virtual/input/input0
nuc970-i2c0 nuc970-i2c0: i2c-0: nuc970 I2C adapter
nuc970-i2c1 nuc970-i2c1: i2c-1: nuc970 I2C adapter
ios->clock=400000
leds-nuc970: set(led-0)(33) outputu
TCP: cubic registered
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20120528 t)
can: netlink gateway (rev 20130117) max_hops=1
lib80211: common routines for IEEE802.11 drivers
lib80211_crypt: registered algorithm 'NULL'
lib80211_crypt: registered algorithm 'WEP'
lib80211_crypt: registered algorithm 'CCMP'
lib80211_crypt: registered algorithm 'TKIP'
Key type dns_resolver registered
i2c_gpio_probe - pdev = i2c-gpio
Please Check GPIOG01's multi-function = 0x8
platform i2c-gpio.2: Driver i2c-gpio requests probe deferral
console [netcon0] enabled
netconsole: network logging started
nuc970-rtc nuc970-rtc: setting system clock to 2005-01-01 01:35:14 UTC (1104543314)
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags "inband-tags"
yaffs: yaffs: Attempting MTD mount of 31.2,"mtdblock2"
g_serial gadget: high-speed config #2: CDC ACM config
yaffs: block 845 is bad
yaffs: block 846 is bad
yaffs: block 847 is bad
yaffs: block 848 is bad
yaffs: 563 blocks to be sorted...
yaffs: yaffs_read_super: is_checkpointed 0
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
devtmpfs: mounted
Freeing unused kernel memory: 264K
MAJOR IS 250
qgpio driver Registered
nuc970-can0 nuc970-can0 can0: bit-timing not yet defined
nuc970-can0 nuc970-can0 can0: failed to open can device
nuc970-can0 nuc970-can0 can0: bit-timing not yet defined
nuc970-can0 nuc970-can0 can0: failed to open can device
离线
执行此命令即可以用了,不像网上说的执行其它的命令
ip link set can0 up type can bitrate 125000
离线
正常了,明天在自己打的两块板上对调一下can通信。
离线
求助,我执行ip link set can0 up type can bitrate 125000这个命令却没有效果。
我用的是can1,管脚是PH14,PH15。
root@nuc972 /sys/devices/platform/nuc970-can1/net/can0# ifconfig -a
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:59
dummy0 Link encap:Ethernet HWaddr 62:85:89:C1:6D:3D
BROADCAST NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 08:00:27:00:01:92
inet addr:192.168.1.186 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3382 errors:0 dropped:786 overruns:0 frame:0
TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:420105 (410.2 KiB) TX bytes:4356 (4.2 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
root@nuc972 /sys/devices/platform/nuc970-can1/net/can0# ip link set can0 up type
can bitrate 125000
ip: either "dev" is duplicate, or "type" is garbage
root@nuc972 /sys/devices/platform/nuc970-can1/net/can0#
最近编辑记录 Gentlepig (2020-04-18 15:34:21)
离线