-
Notifications
You must be signed in to change notification settings - Fork 18
/
canNontes.txt
107 lines (67 loc) · 2.41 KB
/
canNontes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
Board0
can1
IRQ 12
Basic Port 1 Memory da000h
HW reset Basic Port 1 da100h
can2
IRQ 15
Basic Port 2 Memory da200
HW reset Basic Port 2 da300
sudo modprobe sja1000_isa "mem=0xda000,0xda200" "irq=12,15"
Board1
can1
IRQ 10
Basic Port 1 Memory CC00h:CCFFh
HW reset Basic Port 1 CD00h:CDFFh
can2
IRQ 11
Basic Port 2 Memory CE00h:CEFFh
HW reset Basic Port 2 CF00h:CFFFh
sudo modprobe sja1000_isa "mem=0xda000,0xda200,0xcc000,0xcc200" "irq=12,15,10,11"
put in /etc/modules
sja1000_isa "mem=0xda000,0xda200,0xcc000,0xcc200" "irq=12,15,10,11"
/etc/ssh/sshd_config:78 setting UseDNS no
bing can up and down
sudo ifconfig can0 down
// set can0 to baud 500000
sudo ip link set can0 type can tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
// show details
ip -details link show can0
// says it is 1mb
sudo ip link set can0 type can tq 125 prop-seg 5 phase-seg1 1 phase-seg2 1 sjw 1
// says it is 1mb
sudo ip link set can1 type can tq 125 prop-seg 5 phase-seg1 1 phase-seg2 1 sjw 1
// says it is 1mb - robs try
sudo ip link set can1 type can tq 100 prop-seg 1 phase-seg1 2 phase-seg2 4 sjw 2
// says it is 1mb - from kavaser
sudo ip link set can1 type can tq 125 prop-seg 1 phase-seg1 2 phase-seg2 4 sjw 1
flush
fflush
fsflush
bit timing calculator:
http://www.kvaser.com/en/support/bit-timing-calculator.html
// send a can packet
cansend can1 123#1122334455667788
(note ctrl+r looks for recent termanal searchers)
// cansend source
svn checkout svn://svn.berlios.de/socketcan/trunk
// driver info
http://svn.berlios.de/wsvn/socketcan/trunk/kernel/2.6/Documentation/networking/can.txt
// useful document
http://www.google.com/url?sa=t&rct=j&q=socketcan%20example%20code&source=web&cd=45&ved=0CFcQFjAEOCg&url=http%3A%2F%2Fchemnitzer.linux-tage.de%2F2012%2Fvortraege%2Ffolien%2F1044_SocketCAN.pdf&ei=XM_KT7j3Iez46QGu55Qv&usg=AFQjCNHnubhtEhcfjU4nr76NvZBbrOoxsg&sig2=Mukg5QcV_r2loxtt6-SrMg
// to read data
select or poll()
it sends a file discripter to the kernel and it says if it is read tobe read or not
richard stevens advanced programmign in tyheunixx enviroment v2 in bookmarks
'also look a ppoll()
ARCH=x86 make menuconfig // this configures it
ARCH=x86 make -j4 deb-pkg // where 4 is the number of cores you want to use
the file is .confg in the source directory
this will make a debian package then you just install the debian package
setup vcan
Try
modprobe vcan
and
ip link add type vcan
and
ifconfig vcan0 up