I have CANalyzer available,
Great ! If you have enough time could you also test:
http://clientes.netvisao.pt/anbadeol/mcp2515.html
please ?
I have CANalyzer available,
Great ! If you have enough time could you also test:
http://clientes.netvisao.pt/anbadeol/mcp2515.html
please ?
ip -s -d link show can03: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 10
link/can
can state ERROR-ACTIVE restart-ms 0
bitrate 500000 sample-point 0.833
tq 166 prop-seg 4 phase-seg1 5 phase-seg2 2 sjw 1
mcp251x: tseg1 3..16 tseg2 2..8 sjw 1..4 brp 1..64 brp-inc 1
clock 6000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
1555520 194440 1 0 1 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
$ sudo su
# cd /boot
# cp can-test/kernel.img /boot
# cp -a can-test /home/pi
# shutdown -r now
$ sudo su
# cd /home/pi/can-test
# insmod spi-bcm2708.ko
# insmod can.ko
# insmod can-dev.ko
# insmod can-raw.ko
# insmod can-bcm.ko
# insmod mcp251x.ko
($ lsmod should also work, but we are "root" currently)# lsmod
# ip link set can0 up type can bitrate 500000
# dmesg | less
mcp251x spi0.0: bit-timing not yet defined
mcp251x spi0.0: unable to set initial baudrate
As far as I know, insmod means "add the modules to the kernel on runtime".
When doing "make menuconfig" I found that all these modules seem to be
allready in the kernel sources and can be compiled to the kernel when selected.
So why do we have to "insmod" the modules, when they are allready
in the kernel after recompiling?
$ sudo su
# apt-get update
# apt-get -y dist-upgrade
# apt-get -y install git ncurses-dev
# zcat /proc/config.gz > .config
# make menuconfig
[*] Networking support --->
....<M> CAN bus subsystem support --->
........<M> Raw CAN Protocol (raw access with CAN-ID filtering)
........<M> Broadcast Manager CAN Protocol (with content filtering)
............CAN Device Drivers --->
................<M> Platform CAN drivers with Netlink support
................[*] CAN bit-timing calculation
................<M> Microchip MCP251x SPI CAN controllers
................[*] CAN devices debugging messages
....Device Drivers --->
........[*] SPI support --->
............<M> BCM2798 SPI controller driver (SPI0)
............<M> User mode SPI driver support
.......-*- GPIO Support --->
............[*] /sys/class/gpio/... (sysfs interface)
# cd /usr/src/linux/arch/arm/mach-bcm2708
# cp /media/usbstick/bcm2708.diff .
# patch -p0 <mcp2515_patch.diff
# cd /usr/src/linux
# make; make modules;make modules_install
# cp arch/arm/boot/Image /boot/kernel.img
# shutdown -r now
$ sudo su
# cd /home/pi
# mkdir can
#cd can
# wget http://www.pengutronix.de/software/libs ... .8.tar.bz2
# tar xvjf libsocketcan-0.0.8.tar.bz2
# rm libsocketcan-0.0.8.tar.bz2
# cd libsocketcan-0.0.8
# .configure
# make
# make install
# cd ..
# git clone git://gitorious.org/linux-can/can-utils.git can-util
# cd can-util
# make
# make install
# cd ..
# modprobe spi-bcm2708
# modprobe can
# modprobe can-dev
# modprobe can-raw
# modprobe can-bcm
# modprobe mcp251x
# ip link set can0 up type can bitrate 500000
# candump can0
static struct spi_board_info bcm2708_spi_devices[] = {
{
.modalias = "mcp2515",
.max_speed_hz = 10000000,
.platform_data = &mcp251x_info,
.irq = 110,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_0,
} , {
.modalias = "mcp2515",
.max_speed_hz = 10000000,
.platform_data = &mcp251x_info,
.irq = 110,
.bus_num = 0,
.chip_select = 1,
.mode = SPI_MODE_0,
}
};Are the modules able to work both on the same interrupt?
How can I assure, that all modules which depend on the board configuration change
will be compiled new?