KingAlex1985 wrote:Hello Zeta,
so the compiling didn't take a long time. Only an hour. But I'm not sure if I'm finished with the compiling. I did it only until this last entry in your
tutorial:
===================
You should now have the complete new kernel/modules/firmware in the "/opt/raspberrypi/build" directory. If you want to use it, simply puts its contents to the root directory. It is possible to do it directly without using a temporary build directory, but this method has the advantage of being possible on a remote machine, and to allow easier save of the binary generated (simply archive this directory if you need to give it to someone else).
===================
But haven't done the next steps "MCP2515 Asynchronous Driver" and "SPI low latency patch". Is it still important for me?
If everything compiled correcly, then it is good ! You may still have some things to tune before everything works, but you've reached an important step !
So the tutorial was not that clear now that you point it up.
The first part is only using the stock options from the kernel, like the MCP251x driver that is availlable in the kernel source code.
This is "enough" to use the CAN bus, but as you can see from the previous discussions on this forum thread, not enough for users that wanted high bus rate and load.
So some people have pointed out that the non official (as in "not in the kernel git tree") MCP2515 driver allowed higher performances but not compatible with MCP2510 anymore, and msperl developped a "low latency" patch for the SPI to handle requests faster and avoid buffer overflow in the MCP driver (only 2 buffers).
These two points are presented in separate parts of the wiki page, but could be done at once, by applying the patchs and settings the options in the menuconfig step.
You may need this to have good performances, but it should be able to work without it, at least to test it.
KingAlex1985 wrote:
And whats the right way to bring it on my raspberry pi. What I have done, is to copy all the files which are in the directory "/opt/raspberrypi/build/boot" from my Kubuntu into the directory "/boot/" of the raspberry pi. These are the files: "bootcode.bin fixup.dat kernel.img start.elf". Then I restarted my pi with "sudo reboot".
Normally, you should also copy the files in the build/lib/ directory as modules compiled for this kernel are here.
That care of the user rights there (I made the mistake once...), files should be owned by root, not the user. The "mv" command keeps the ownership while moving the files, where the "cp" command creates new files with the user launching the command.
This part of the wiki should be rewritten more clearly with explicit steps to do...
What I did was generally to tar.gz the folder, copy it to a USB stick, then plug it on the raspberry pi, extract it in a temporary folder to check things, an "cp" it to the correct place as root user. If PC was close to the raspberry pi and on the same network, I would have "scp" it (file copy through ssh).
KingAlex1985 wrote:After that I tried to initialize my PICAN-Module with the following commands that I got from this page
PICAN CAN-Bus Board for Raspberry Pi:
======================
$ 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
=======================
Notice: the folder "/home/pi/can-test" with all the files like "candump" and "cansend" I had still available.
Ok. So next step is to debug what is happening.
Can you describe more what doesn't work ?
Do you have errors messages ?
Have you tried the "ip" command to setup it with baudrate and other parameters ?
Did you configured the correct SPI clock, MCP oscillator frequency and GPIO pin used for the interrupts line when compiling the kernel ?
To help you you can try the following commands (written from memories, can't check them now):
- "dmesg | tail -50" : display the last 50 lines of the kernel messages. You can also look at the "/var/log/messages" file which may contain a bit more
- "lsmod" : lists the loaded modules, run before and after the insmod commands to check the modules are corectly loaded
- "cat /proc/interrupts" : display interrupts handled by the system. You should find the spi lines there for example.
- "ls /dev/can*" : to check the device is there (this must appear after the ip config step I think...)
- "ifconfig /dev/can0" : for more details on the can0 line (sent/received messages...)
You can find more details on the useful commands in the previous pages of this thread.
KingAlex1985 wrote:The good answer is that my Bluetooth Dongle now will be detected.
Did you do something special in the kernel configuration to enable bluetooth ? Which .config file did you start with ?