2008-07-22 11:00:57     dev/can0 missing 2008R1-RC8

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-22 11:00:57     dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59231   

 

Hi,

 

When I try to use can_send or recieve from the can4linux examples on the BF548 I get an error which indicates that dev/can0 is missing. I comfirmed this to be true by checking the dev folder.

 

When I checked my kernel build options I noticed that I had not checked the options in make menuconfig, when i check the box in Device drivers -> Character Devices -> CAN, the car bus and industrial fieldbus -> can4linux support I get the error shown in the log (see attached)

 

I want to use the 8MHz clock but I am not sure in how to select that option.

 

I am using uClinux-dist-2008R1-RC8

 

Thanks,

 

Pat

 

log

QuoteReplyEditDelete

 

 

2008-07-22 22:10:06     Re: dev/can0 missing 2008R1-RC8

Mike Frysinger (UNITED STATES)

Message: 59254   

 

unfortunately, the can driver does not support dynamic node creation

 

please look at /proc/devices to find out the major number and then create the device node in /dev/ by hand using "mknod"

QuoteReplyEditDelete

 

 

2008-07-22 22:43:19     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59257   

 

For the error message you saw, please check whether you select:  CONFIG_CAN_BLACKFIN

 

Please read drivers/char/can4linux/Makefile for details.

 

The verbose command when building the driver:

 

  bfin-uclinux-gcc -Wp,-MD,drivers/char/can4linux/.core.o.d  -nostdinc -isystem /home/adam/workspace/toolchain/08r1/opt/uClinux/bfin-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/include -D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -mno-fdpic -mcpu=bf537-0.2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -g  -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DAD_BLACKFIN -DDEBUG=1 -DCAN_MAJOR=91 -DCAN_SYSCLK=125 -DMAX_CHANNELS=1  -Wno-undef -DVERSION=\"3.4.6_AD_BLACKFIN\"  -DMODULE -mlong-calls -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(core)"  -D"KBUILD_MODNAME=KBUILD_STR(can)" -c -o drivers/char/can4linux/core.o drivers/char/can4linux/core.c

 

QuoteReplyEditDelete

 

 

2008-07-23 06:03:06     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59275   

 

Thanks for the reply,

 

Mike I have attached my file /proc/devices. I'm not 100% sure which major number I should use.

 

I know the command i should use is "mknod /dev/can0 c (major) 0".

 

From what i have read in the forums a lot of people are suggesting 91 as the major number but this is not in my devices file/

 

Is there something missing in my kernel?

 

I am using the BF548 and I don't get the option to include Analog Devices BlackFin CAN Controller as outlined on the website

 

Character devices --->

    CAN, the car bus and industrial fieldbus  --->

     [*] can4linux support, the car bus and industrial fieldbus

     <M>   Analog Devices BlackFin CAN Controller

 

Thanks,

 

Pat

 

devices

devices

QuoteReplyEditDelete

 

 

2008-07-23 10:49:29     Re: dev/can0 missing 2008R1-RC8

Mike Frysinger (UNITED STATES)

Message: 59282   

 

then you'll probably need to follow Yi's advice and make sure your drivers are loaded.  if can stuff isnt showing up in /proc/devices, it means the driver isnt loaded/initialized properly.

QuoteReplyEditDelete

 

 

2008-07-23 11:17:00     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59283   

 

When i run the command "bfin-uclinux-gcc -Wp,-MD,drivers/char/can4linux/.core.o.d  -nostdinc -isystem" i get the following error:

 

bfin-uclinux-gcc:argument to '-isystem' is missing

 

Also when i did a search for CONFIG_CAN_BLACKFIN in the CAN in menuconfig i got the following:

 

Depends on (CAN4LINUX && EMBEDDED && (BF534 ||BF536 || BF537))

 

Does this mean this driver does not work with the BF548?

 

To be honest I am not entirely sure what Yi was telling me to do, any chance you good break in down into steps?

 

Thanks,

 

Pat

 

 

QuoteReplyEditDelete

 

 

2008-07-23 15:13:18     Re: dev/can0 missing 2008R1-RC8

Robin Getz (UNITED STATES)

Message: 59288   

 

Patrick:

 

Yi's command  was one entire long line (with no line breaks) you can't copy/paste (since it has his paths in it, which will be dfiferent than yours). You need to edit and do the whole thing as one line.

 

-Robin

QuoteReplyEditDelete

 

 

2008-07-23 22:04:29     Re: dev/can0 missing 2008R1-RC8

Mike Frysinger (UNITED STATES)

Message: 59297   

 

Yi was showing the output from the kernel build during verbose mode ... you shouldnt run that command yourself

QuoteReplyEditDelete

 

 

2008-07-23 22:41:36     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59298   

 

I just noticed that in the kernel configure options, CONFIG_CAN_BLACKFIN can only be enabled for BF536, BF537 and BF534. If you are going to test on BF548, you may try to modify drivers/char/can4linux/Kconfig as:

 

--- Kconfig    (revision 4987)

+++ Kconfig    (working copy)

@@ -77,7 +77,7 @@

 

config CAN_BLACKFIN

     tristate "Analog Devices BlackFin CAN Controller"

-    depends on CAN4LINUX && EMBEDDED && (BF534 || BF536 || BF537)

+    depends on CAN4LINUX && EMBEDDED && (BF534 || BF536 || BF537 || BF548)

     ---help---

       This is can4linux support for the integrated CAN controller

       found on Analog Devices BlackFin processors.

 

Then enable CONFIG_CAN_BLACKFIN and rebuild the kernel. I don't think we have tested can4linux on BF548 yet. I will have a try too.

 

-Yi

QuoteReplyEditDelete

 

 

2008-07-24 05:13:56     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59315   

 

Yi:

 

I made the changes as you said in Kconfig and this made the option "Analog Devices BlackFin CAN Controller" availible to me. I then selected this and tried to make my kernel again.

 

I then encountered the error shown in the log (see attached)

 

When I looked into this error myself I noticed that the AD_BLACKFIN section in core.c does not looked to be completed as can be seen from below:

 

#if defined(AD_BLACKFIN)

    /* we have a really fixed address here */

    /* starting with Mailbox config reg 1  */

    Base[i] = BFCAN_BASE;

    /* Because the AD BlackFin CAN is using more then 1 Interrupt vector,

     * what should be specified here ?

     * For information purpose let's only specify  the first used here.

     * Next one is +1

     */

    IRQ[i] = IRQ_CAN_RX;

#endif

 

Can you offer anymore help on this?

 

Thanks,

 

Pat

 

log

QuoteReplyEditDelete

 

 

2008-07-24 07:16:42     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59345   

 

Since we did not test CAN on BF548, there need some changes in the code to make it work. I am testing CAN on BF548-ezkit now. I will let you know the result when it is done.

 

-Yi

QuoteReplyEditDelete

 

 

2008-07-24 07:27:47     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59346   

 

Yi:

 

Thanks very much, look forward to your reply.

 

Pat

QuoteReplyEditDelete

 

 

2008-07-25 04:27:17     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59380   

 

Patrick,

 

I've checked in the support for can4linux on bf548 to 2008r1 brach and svn trunk, and it is tested on BF548-ezkit. Please refer to:

 

http://blackfin.uclinux.org/gf/project/linux-kernel/scmsvn/?action=browse&path=%2F&view=rev&revision=5050.

 

You can either check out from 2008r1 branch, or change you can4linux driver according to the modifications above.

 

-Yi

 

 

QuoteReplyEditDelete

 

 

2008-07-29 07:21:41     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59542   

 

Yi:

 

Sorry for the delay in replying.

 

When I made the changes you suggested the kernel compiled fine.

 

When I ported the new kernel to my board dev/can0 was still missing and when i checked /proc/devices for the major number for mknod there was no major number (91) listed for the CAN.

 

What am I missing?

 

I have attached my /proc/devices file

 

 

 

Thanks,

 

Pat

 

devices

QuoteReplyEditDelete

 

 

2008-08-05 09:25:09     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 59939   

 

Hi,

 

Can anyone offer anymore assistance with this error.

 

Anytime I use can_send or recieve from the can4linux examples I get the following error:

 

open error 6;/dev/can0: No such device or address

QuoteReplyEditDelete

 

 

2008-08-06 00:27:32     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59967   

 

Patrick,

 

Sorry that I missed your last mail.

 

You will need to build the can4linux driver as module, then do "modprobe can". The device node "/dev/can0" will be automatically created.

 

I think there is problem with the driver's makefile - when build the driver into kernel (not as kernel module), "/dev/can0" cannot be created. I am looking at this. For now, you can just use kernel module.

 

"root:/> modprobe can                                                                                                                

ISA-BlackFin-CAN CAN Driver 3.4.6_AD_BLACKFIN (c) Aug  6 2008                                                                       

BlackFin port by H.J. Oertel (oe@port.de)                                                                                          

root:/> lsmod                                                                                                                       

Module                  Size  Used by                                                                                               

can                    24516  0                                                                                                     

root:/> ls /dev/can0                                                                                                                

/dev/can0                  "

 

Does this work for you?

 

-Yi

QuoteReplyEditDelete

 

 

2008-08-06 05:12:35     Re: dev/can0 missing 2008R1-RC8

Yi Li (CHINA)

Message: 59978   

 

Looking at can4linux/Makefile, can4linux driver can only  be built as kernel module, even if you configure this driver to be built into kernel. I've checked in a fix to the 2008R1 svn branch - now both case should work.

QuoteReplyEditDelete

 

 

2008-08-06 07:31:07     Re: dev/can0 missing 2008R1-RC8

Patrick Mc Donnell (IRELAND)

Message: 60032   

 

Yi:

 

It is working now, Just have to try get my head around using it now.

 

Thanks for all the help

 

Patrick

Attachments

Outcomes