Hello I sent an email.
in can4linux-examples, please execute make git_track.h it should execute the script git_track and of course you must have installed git and you must have cloned can4linux using git clone. I can not say what the reason for not loading can4linux.ko is. If the driver module can4linux.ko is compiled against the current kernel you are using, insmod should load the module. Which source are you using now, which kernel? Did you make changes, which? Heinz
Can we pleas switch to using private email addresses? can4linux development is not longer at Sourceforge. Please use my email hj.oertel@t-online.de) I just installed the latest Armbian kernel 5.10.4 and try to compile TARGET=BANANAPI. There are some things to change, all module to compile but bananapi.c which is the hardware related code. It seems tha some definitions have changed. Hope to can solve it tomorrow.
Heinz I was able to create can4linux.ko but when I use insmode can4linux.ko I get an unexpected error: >>> Loading Driver Module to Kernel /sbin/insmod can4linux.ko insmod: ERROR: could not insert module can4linux.ko: Invalid module format Makefile:811: recipe for target 'load' failed make: *** [load] Error 1 And when I want to compile the examples : gcc -g -Wall -pedantic -I../can4linux -DUSE_RT_SCHEDULING -DCANFD -c -o receive.o receive.c receive.c:48:23: fatal error: git_track.h: No such file...
Thank you for your help and time, if it's not a problem, I'll be waiting. Regards
You must have a so called kernel development package installed. At least these are the kernel headers and a lot of other stuff. Depending on your distribution it could be added by sudo apt-get install build-essential I switched some time ago to Armbian, which is a more current kernel. https://www.armbian.com/bananapi/ If you can wait a bit, I just try to compile it on my Armbian Banana Heinz Am Dienstag, 12. Januar 2021, 14:23:49 CET schrieb John: Heinz, Thank you very much for your help, I only...
Heinz, Thank you very much for your help, I only have: compile with KDIR=/lib/modules/3.4.111-bananian/build/, at /root/can4linux/can4linux CC = cc make -C /lib/modules/3.4.111-bananian/build/ V=0 C=0 M=/root/can4linux/can4linux TARGET=BANANAPI modules make[1]: *** /lib/modules/3.4.111-bananian/build/: No such file or directory. Stop. Makefile:800: recipe for target 'all' failed make: *** [all] Error 2 make: Nothing to be done for '/mnt'. Could you please help me understand how to compile the code...
John, active development for can4linux is now on GitLab https://gitlab.com/hjoertel/can4linux May be you will have more success with this version. Heinz
Hi Heinz, Thank you so much for your help, I fixed some bugs and tested it on an older version of bananian, because as I read can4linux was made with bananian15-01 in mind. I got the following result: # make TARGET=BANANAPI compile with KDIR=/lib/modules/3.4.104+/build/, at /root/can4linux-code/can4linux CC = cc make -C /lib/modules/3.4.104+/build/ V=0 C=0 M=/root/can4linux-code/can4linux TARGET=BANANAPI \ EXTRA_CFLAGS="""" modules make[1]: Entering directory `/root/linux-bananapi' '/root/can4linux-code/can4linux/version.inc'...
Hi Heinz, Thank you so much for your help, I fixed some bugs and tested it on an older version of bananian, because as I read can4linux was made with bananian15-04 in mind. I got the following result: # make TARGET=BANANAPI compile with KDIR=/lib/modules/3.4.104+/build/, at /root/can4linux-code/can4linux CC = cc make -C /lib/modules/3.4.104+/build/ V=0 C=0 M=/root/can4linux-code/can4linux TARGET=BANANAPI \ EXTRA_CFLAGS="""" modules make[1]: Entering directory `/root/linux-bananapi' '/root/can4linux-code/can4linux/version.inc'...
Hi Heinz, Thank you so much for your help, I fixed some bugs and tested it on an older version of bananian, because as I read can4linux was made with bananian15-04 in mind. I got the following result: # make TARGET=BANANAPI compile with KDIR=/lib/modules/3.4.104+/build/, at /root/can4linux-code/can4linux CC = cc make -C /lib/modules/3.4.104+/build/ V=0 C=0 M=/root/can4linux-code/can4linux TARGET=BANANAPI \ EXTRA_CFLAGS="""" modules make[1]: Entering directory `/root/linux-bananapi' '/root/can4linux-code/can4linux/version.inc'...
Hi Heinz, Thank you so much for your help, I fixed some bugs and tested it on an older version of bananian, because as I read can4linux was made with bananian15-04 in mind. I got the following result: compile with KDIR=/lib/modules/3.4.104+/build/, at /root/can4linux-code/can4linux CC = cc make -C /lib/modules/3.4.104+/build/ V=0 C=0 M=/root/can4linux-code/can4linux TARGET=BANANAPI \ EXTRA_CFLAGS="""" modules make[1]: Entering directory `/root/linux-bananapi' '/root/can4linux-code/can4linux/version.inc'...
Hello John, normally files like read.c, write.c, etc, files without hardware access should compile without problems. Please check read.c, What is really at line 89 ? /root/can4linux-code/can4linux/read.c:89:30: warning: passing argument 1 of 'iminor' makes pointer from integer without a cast unsigned int minor = i minor(file_inode(file)); It should be: unsigned int minor = iminor(file_inode(file)); and not unsigned int minor = i minor(file_inode(file)); ^ the letter 'i' should not be there. Regards...
Hello, I use Banana Pi M1, I wanted to ask for help. I have not dealt with such an error before: #make TARGET=BANANIAN compile with KDIR=/lib/modules/3.4.108-bananian/build/, at /root/can4linux-code/can4linux CC=cc make -C lib/modules/3.4.108-bananian/build/ V=0 C=0 M=/root/can4linux TARGET=BANANAPI \ EXTRA_CFLAGS=''''''' modules make[1]: Entering directory '/root/linux-bananapi' WARNING: Symbol version dump /root/linux-bananapi/Module.symvers is missing; modules will have no dependencies and modversion....
Am Donnerstag, 3. Dezember 2020, 08:31:23 CET schrieb Nikkk: Thank you for your help, I just wanted to ask because I haven't found it yet. If I send 3 frames and there is no device, then I get 3 tx errors, or if the device receives 4 frames with wrong CRC, then rx will return 4 errors? Nikkk the best would be reading the ISO 11898 papers, But for the error confinement you can look at the old BOSCH paper at http://esd.cs.ucr.edu/webres/can20.pdf Much more links are collected at the CAN Wiki http://www.can-wiki.info/doku.php?id=can_links:main...
Thank you for your help, I just wanted to ask because I haven't found it yet. If I send 3 frames and there is no device, then I get 3 tx errors, or if the device receives 4 frames with wrong CRC, then rx will return 4 errors?
mcp2515funcs.c: stat->rx_errors = CANin(board, REC); stat->tx_errors = CANin(board, TEC); Yes, with the mcp2515 it is possible to read out both error counters .As user you have to issue a ioctl()call: Please lookt at can4linux-examples/getstat.c
Hello, What if there is a disturbance in connection? Is a damaged frame received? If so, is a notification about a damaged frame sent? Can the TEC and REC error counters be read in the MCP2515 that I am using?
Hello Nikkk, sorry no. That will only be possible if there is support by the ghardware, by the CAN controller istself. If you have no access to the CTC register, writing or reading, the driver will not be able to read or write, means change the the calculated CTC. May be in the future FPGA based controllers will offer this. By the way, can4linux is now in GitLab https://gitlab.com/hjoertel/can4linux
Hello, is there a way or a function to read and modify ACK and CRC at the sender and receiver?
Hello I am using Can4linux revision 518 as it is only compatible to banana pro with lubuntu 3.4.103 lemaker os. On my can bus one module is connected with stored large amount of data around 3/4 mb. Module have command to receive that data. When it receives that command it sends that 3/4 mb data in extended data format in data fields on particular can ID. I wanted to collect all data and extract it from data fields and stored it in file. When such data packets comes, can bus get hangs, even receive...
Hello Heinz, You are right about the clock module... I did not have the same compatible name between my device tree and the string in the chart xcan_of_match... So now, the function xcan_probe is called and I can see that I have a "Device clock not found" problem as you can below. FYI, I compile the can4linux driver with a CAN_SYSCLK = 100000000 and I adapted the values in xcanps.h (for my test I just use the 125k and 500k) : /// for more CAN_SYSCLK values / //#if CAN_SYSCLK == 100000000 //# define...
Hello Am Donnerstag, 5. Oktober 2017, 13:29:43 CEST schrieb rrrroro: Thank you for the answer. OK, So when I had the "default" CAN driver of the kernel, I already had the entries : # cat /proc/iomem e0008000-e0008fff : /amba/can@e0008000 e0009000-e0009fff : /amba/can@e0009000 That's why I got an EBUSY error. correct So now I have disabled all the CAN related stuff inside the kernel config. It is better, I don't get the EBUSY error anymore. When I call open(/dev/can0) or open(/dev/can1), the function...
Thank you for the answer. OK, So when I had the "default" CAN driver of the kernel, I already had the entries : cat /proc/iomem e0008000-e0008fff : /amba/can@e0008000 e0009000-e0009fff : /amba/can@e0009000 That's why I got an EBUSY error. So now I have disabled all the CAN related stuff inside the kernel config. It is better, I don't get the EBUSY error anymore. When I call open(/dev/can0) or open(/dev/can1), the function request_mem_region is called and I can see : cat /proc/iomem e0008000-e0008fff...
can4linux is using request_mem_region() to ask for access to the XCAN registers. if nit succesful, you should find a message in the kernel log, like: Request_mem_region CAN-IO failed at %lx\n if succesful, it is registere at the kernel and you should see it doing a $ cat /proc/iomen there should be line containing the string "xcanps" See line 493 in zedboard.c With this command you can as well see if another driver has already allocated the memory area. Heinz
That's a good information, thanks. So you mean, i should change the compatible property to the name of CAN4LINUX driver (and put status to "enabled")? Which is, in my case, called : ps7-can I am going to try this...
By default the can0 and can1 entries appear to be disabled: https://github.com/Xilinx/linux-xlnx/blob/master/arch/arm/boot/dts/zynq-7000.dtsi line 85: can0: can@e0008000 { *compatible = "xlnx,zynq-can-1.0";* *status = "disabled";* clocks = <&clkc 19>, <&clkc 36>; clock-names = "can_clk", "pclk"; reg = <0xe0008000 0x1000>; interrupts = <0 28 4>; interrupt-parent = <&intc>; tx-fifo-depth = <0x40>; rx-fifo-depth = <0x40>; }; The compatible property should be changed so it will match CAN4LINUX driver...
Yes, my error is probably due to the fact that another driver accesses to these memory area. For a test, I've built a kernel without any "CAN related" stuff but i still have the same problem. I was telling myself that, if only the can4linux driver is activated, it couldwork better... I've can0 and can1 in my device tree (in zynq-7000.dtsi). I don't know if i must remove these entries because can4linux driver uses the device-tree nodes /amba/can@e0008000 and /amba/can@e0009000 to retrieve properties...
Perhaps another driver has already claimed the hardware region? For example the socketcan driver is often used on Zynq devices. Search your device tree (.dts and .dtsi) for other devices with address 0xe0008000... R On 4 October 2017 at 07:18, POIX rrrroro@users.sf.net wrote: After more researches, it's the function "request_mem_region" called in CAN_VendorInit()) that gives an EBUSY error. Does anyone have an idea why the function request_mem_region does returns NULL ? If i add a call to release_region()...
After more researches, it's the function "request_mem_region" called in CAN_VendorInit()) that gives an EBUSY error. Does anyone have an idea why the function request_mem_region does returns NULL ? If i add a call to release_region() before calling request_mem_region(), I don't get the EBUSY error but, strangely, my code freezes at the first call to readl() or writel() (after the ioremap function). If I insmod the can4linux module with option virtual=1, all seems to be OK. I am still looking for...
Hi all, I have a problem when I want to use the kernel drivers CAN4LINUX on my Zedboard. I am booting a Linux OS on my Zynq (via Petalinux tool), I've cross-compiled the CAN4LINUX drivers, as well as the CAN4LINUX-EXAMPLES and when I try to launch a test programm (such as baud.c), I get the following error: root@software:/# ./bin/baud /dev/can0 125 usage: ./bin/baud [dev] [bit_rate] e.g.: ./baud /dev/can0 125 sends out a message at /dev/can0 with 125Kbit/s which can be watched at the CAN cable using...
Heinz, I received an "Undelivered Mail Returned to Sender" using your personal email address. KB Le 18/07/2017 à 14:52, KB4 a écrit : Dear Heinz, Thanks for your help, it works. Regards, KB. Le 18/07/2017 à 13:22, "Heinz-Jürgen Oertel" a écrit : Am Dienstag, 18. Juli 2017, 09:33:28 CEST schrieb KB4: However, I don't find the executables "receive" end "can_send". I am attaching a screenshot showing what I have done. Hoping that such attachment is allowed here. I hope also you can help me also at this...
Am Montag, 17. Juli 2017, 14:56:56 CEST schrieb KB4: ... If it works, I will look for using can4linux in my courses. What courses are you talking about - and where. If you like, please answer to my personal address hjoertel@t-online.de Heinz
Dear Heinz, Thanks for your help, it works. Regards, KB. Le 18/07/2017 à 13:22, "Heinz-Jürgen Oertel" a écrit : Am Dienstag, 18. Juli 2017, 09:33:28 CEST schrieb KB4: However, I don't find the executables "receive" end "can_send". I am attaching a screenshot showing what I have done. Hoping that such attachment is allowed here. I hope also you can help me also at this step. Of course. after downloading the svn repo you schould have two directories: - can4linux - can4linux-examples simply cd to can4linux-examples...
Am Dienstag, 18. Juli 2017, 09:33:28 CEST schrieb KB4: However, I don't find the executables "receive" end "can_send". I am attaching a screenshot showing what I have done. Hoping that such attachment is allowed here. I hope also you can help me also at this step. Of course. after downloading the svn repo you schould have two directories: - can4linux - can4linux-examples simply cd to can4linux-examples and do a make As result you will have some executables. look at the Readme and try to call these...
Thanks Heinz for your answer, I had to install the linux headers (in my case, apt-get install linux-headers-amd64) ; then "make TARGET=GENERIC" & "sudo make simload" seems to have been successful (?). However, I don't find the executables "receive" end "can_send". I am attaching a screenshot showing what I have done. Hoping that such attachment is allowed here. I hope also you can help me also at this step. Thanks. KB. Le 17/07/2017 à 17:48, "Heinz-Jürgen Oertel" a écrit : Am Montag, 17. Juli 2017,...
Am Montag, 17. Juli 2017, 14:56:56 CEST schrieb KB4: Hi, I tried to compile can4inux, both the tgz file (can4linux-4.2) and the one in the svn. a. Under debian 8.7 Jessie : uname -r ==> 3.16.0-4-amd64 b. With and without CANDFLAG : (1) EXTRA_CFLAGS = (2) EXTRA_CFLAGS = -DCANFD b. With no hardware option : make simload In all cases, I had this message : /sbin/insmod can4linux.ko virtual=1 insmod: ERROR: could not load module can4linux.ko: No such file or directory Makefile:814: recipe for target 'simload'...
Hi, I tried to compile can4inux, both the tgz file (can4linux-4.2) and the one in the svn. a. Under debian 8.7 Jessie : uname -r ==> 3.16.0-4-amd64 b. With and without CANDFLAG : (1) EXTRA_CFLAGS = (2) EXTRA_CFLAGS = -DCANFD b. With no hardware option : make simload In all cases, I had this message : /sbin/insmod can4linux.ko virtual=1 insmod: ERROR: could not load module can4linux.ko: No such file or directory Makefile:814: recipe for target 'simload' failed make: *** [simload] Error 1 I would like...
- removed some wrong array decl. to be used with th last commit
- introduce module load parameter proc_baud to set initial bit rate at
- removed warning sign-compare becauaes of difficulties with
- disbale DATE/TIME Warning for gcc-4-9 with TARGET=RASPI
using EXTRA_CFLAGS when using gcc-4.9
don't know what to remove anymore. Any suggestions?
don't know what to rmeove anymore. Any suggestions?
see related /var/log/messages
Hello Heinz, I retried first removing from /boot/config.txt lines ans see lsmod. See attachmente as in attachment configTxt-lsmod-can_send.txt - There's not anymore can_dev and mcp251x So I perfomed steps (make inodes and make load). Run can_send -D can0 . Same results (see configTxt-lsmod-can_send.txt)
Hello Heinz, first of all thanks for your support. I'll make the tests you are proposing and let you know. I would need 2 channels (because I have 2). After I will see the first channel working properly I'll maybe discuss with you (and if I can help I'm available) how to add the support of the second. I'll keep you posted. Thanks Massimo
according to the log: Jun 7 00:51:19 raspberrypi kernel: [ 769.109386] PC is at mutex_lock_slowpath+0x80/0x164 Jun 7 00:51:19 raspberrypi kernel: [ 769.109408] LR is at mutex_lock_slowpath+0x54/0x164 Jun 7 00:51:19 raspberrypi kernel: [ 769.109421] pc : [<80715d88>] lr : [<80715d5c>] psr: a0000013 it looks like the problem ist with the lock()/unlock() mcp2515funcs. line 529
By the way, do you need two CAN channels, two mcp2515 supported? can4linux currently supports only one.
By the way, do you need two CAN channels, two mcp1515 supported. can4linux currently supports only one.
In your syslog: Jun 7 00:20:05 raspberrypi kernel: [ 3.293328] CAN device driver interface Jun 7 00:20:05 raspberrypi kernel: [ 3.353891] mcp251x spi0.1 can0: MCP2515 successfully initialized. Jun 7 00:20:05 raspberrypi kernel: [ 3.365609] mcp251x spi0.0 can1: MCP2515 successfully initialized. Not sure if this is the reason, but this conflicts with can4linux. Your Raspi loads automatically the SocketCAN driver. Before loading can4linux, you schould unload all Socketcan modules, at least the MCP2515...
I also attach the whole /var/log/messages of the test
Hello Heinz. I apologize but robably I'm not enough expert. If you mean enabling debugging putting 7 on /proc/sys/dev/Can/dbgMask I did it. Attached what I see. In summary here below whet I do: $ sudo make load Loading Driver Module to Kernel /sbin/insmod can4linux.ko chmod 666 /dev/can* echo 7 >/proc/sys/dev/Can/dbgMask and then run ./can_send -D can0 this is the output: Segmentation fault Message from syslogd@raspberrypi at Jun 7 00:12:41 ... kernel:[ 348.786884] Internal error: Oops: 817 [#1]...
Sorry, will need some more time, One remark, I'm not sure if the driver already is using the device tree information, max be addresses are fixed. Please enabele debug code in syslog and send me the last lines with the segmentation fault and the lines before.
Hello Heinz, same error. I attach messages from var log. this happen running both can_send or ctest. examples $ ./ctest using CAN device /dev/can0 Message from syslogd@raspberrypi at Jun 4 21:00:22 ... kernel:[ 209.646838] Internal error: Oops: 817 [#1] SMP ARM Segmentation fault Message from syslogd@raspberrypi at Jun 4 21:00:22 ... kernel:[ 209.647110] Process ctest (pid: 1267, stack limit = 0xb45ec210) this happens with or without following lines in /boot/config.txt dtparam=spi=on dtoverlay=spi-bcm2835...
Hello Heinz, 1st of all thanks for replying. I forgot to detail that I'm using R. 3. I hope performance will not be a problem once I'll successfully run can_send (I hope). About conf file, so I'm going to remove my file since it is not used. About messages, core.c already has #if 0.... so proc_dbgmask as defined in debug.c should be 0. echo 7 > /proc/sys/dev/Can/dbgMask is performed by "make load"; I'm going to remove it to avoid messages. I'll make othe tests and post results here. For now thanks...
First of all, it has been one or two years ago I used can4linux on the first version of the Raspberry. What I can say, it worked, but you can not reach a high performance regarding the use of the SPI protocol. I could only use it up to 125kbit/s in order to handle high bus loads on the receiver side. May be it is better now with a Raspberry 3. I just tested compiling 'make TARGET=RASPI' on my desktop system with compiler gcc version 4.8.5 (SUSE Linux) it compiles without any warning, don't ask me...
Please wait. I can give some instructions in two hours. Am 4. Juni 2017 12:31:56 MESZ schrieb Massimo Dardano mdardano@users.sf.net: I aplogize once again. This is the first time I use this application. Adding the attachmemnt the and pressing save I submitted the post only partially. I adde further info here below. Since the warnings were really minor I simply remove dthese kinds of warning to be treated as errors and succesfully compiled. Then I tried to find a suitable conf file but I didn't find...
I aplogize once again. This is the first time I use this application. Adding the attachmemnt the and pressing save I submitted the post only partially. I adde further info here below. Since the warnings were really minor I simply remove dthese kinds of warning to be treated as errors and succesfully compiled. Then I tried to find a suitable conf file but I didn't find any specific for Raspberry (I'm using mcp2515 board, a common http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html)....
support in trying to use can4linux on raspberry
- very early chekin - NOTHING working for Kvase...
- new message flag MSG_FDNISO to set CANFD non-...
- slightly different format version info for mo...
- added PCI vendor data for PCIe CANFD ...
- removed spelling error
- added project specific pr_fmt() macro
did you try the example/receive.c ./receive -n -s 1000 /dev/can0 or ./receive-select...
Hi Heinz Jürgen Oertel, I tried open call with O_NONBLOCK flag enable canfd=open("/dev/can0",O_RDWR...
You have different options. One is call open() in non-blocking mode. Examples are...
I am using can4linux revision number 518 on banana pro. As i read in some post that...
Regarding the TIME and DATE macros. The only solution I know is removing it. Don't...
Dear development team, I try to get can4linux running on my Banana Pi (non-Pro) with...
- created base support for the Kvaser CANFD PCI...
- ISO_ENA and STCMD__7_9_8_8_BIT_OFST correction
- small cast correction for proc_baud[]
- added a new target for the i82527 with indexe...
- removed spelling errors
- cleand up the code and put some debug message...
- removed wrong call to can_vendor_init() from ...
- IXXAT IB500 now supports the ISO CAN FD mode
- changed memory model of GENERIC_I82527 from '...
- cast for using unsigned int with printf()
- removed some spelling errors
- 1st try to again support the Intel I82527 for...
- 1st try to again support the Intel I82527 for...
- 1st try to again support the Intel I82527 for...
- update the copyright holder
- removed two spelling errors
Am Montag, 22. August 2016, 14:13:55 schrieb Maaike: Hello Heinz-Jürgen, I am using...
Hello Heinz-Jürgen, I am using kernel 3.18. I think if it works for 3.16, it will...
Maaike Which kernel are you using? I can try doing the changes so that it will compile...
Thanks for your quick reply! It is indeed old hardware, I have to rewrite the software...
- adopted the setting for the CAN FD transmitte...
Hello in 2013 I started changing the can4linux coding style to the linux kernel coding...
Today I tried to get can4linux working for an Intel i82527 chip on a PC104 ISA card....
Today I tried to get can4linux working for an Intel i82527 chip on a PC104 ISA card....
Today I tried to get can4linux working for an Intel i82527 chip on a PC104 ISA card....
Today I tried to get can4linux working for an Intel i82527 chip on a PC104 ISA card....
- repaired extended frame id handling, now assu...