2008-04-23 01:51:59     Problem with the driver can4linux on Blackfin BF537-stamp

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

2008-04-23 01:51:59     Problem with the driver can4linux on Blackfin BF537-stamp

ludovic s (FRANCE)

Message: 54751    Hi all,

 

I try of work the CAN Bus with the driver can4linux on the board Blackfin BF537-stamp.

My problem is:

- when the driver can4linux and the receiver CAN have the same baudrate (125kbit/s) the receiver show:

 

lolitech@lolitech-desktop:~$ receivetest -f=/dev/pcan32 -b=0x031C

 

receivetest Version "Release_20060501_a" (<a onclick="javascript:window.open('http://'+'www.peak-system.com', 'linkWin', 'scrollbars=yes, location=yes, menubar=yes,resizable=yes,toolbar=yes')" href="https://webmailcluster.1and1.fr/xml/webmail/mailContent;jsessionid=429917C8D5DE0A218D6AB158C583D6D2.TC153b#">www.peak-system.com)

 

------- Copyright (C) 2004-2007 PEAK System-Technik GmbH ------

 

receivetest comes with ABSOLUTELY NO WARRANTY. This is free

 

software and you are welcome to redistribute it under certain

 

conditions. For details see attached COPYING file.

 

 

 

receivetest: device node="/dev/pcan32"

 

Only standard frames are accepted, init with BTR0BTR1=0x031c

 

receivetest: driver version = Release_20080218_n

 

receivetest: m s 0x00000000 4 0x00 0x00 0x00 0x08

 

receivetest: pending CAN status 0x002c read.

 

receivetest: m s 0x00000000 4 0x00 0x00 0x00 0x08

 

receivetest: pending CAN status 0x0028 read.

 

receivetest: m s 0x00000000 4 0x00 0x00 0x00 0x08

 

receivetest: pending CAN status 0x0028 read.

 

receivetest: m s 0x00000000 4 0x00 0x00 0x00 0x08

 

receivetest: pending CAN status 0x0028 read.

 

receivetest: m s 0x00000000 4 0x00 0x00 0x00 0x08

 

receivetest: pending CAN status 0x0028 read.

 

receivetest: type = usb

 

Serial Number = 0xffffffff

 

Device Number = 255

 

count of reads = 5

 

count of writes = 0

 

count of errors = 658

 

count of irqs = 1499

 

last CAN status = 0x0020

 

last error = 0

 

open paths = 1

 

driver version = Release_20080218_n

 

receivetest: finished (0).

 

 

- And when the driver can4linux is configure 100kbit/s and the receiver CAN in 125kbit/s the communication work.

 

You have a solution to resolve this problem?

 

Thank you

TranslateQuoteReplyEditDelete

 

 

2008-04-23 03:57:18     Re: Problem with the driver canlinux on Blackfin BF537-stamp

Michael Hennerich (GERMANY)

Message: 54756    The the baudrate is hardcoded for a SCLK of 125MHz.

I bet you run your SCLK at 100MHz.

Change SCLK to 125MHz (VCO multiplier = 20, SCLK Divider = 4).

I remember I saw a Excel or OpenOffice spread sheet on this forum a while ago - which allows you to calculate different baudrates. Please search this forum.

 

-Michael

QuoteReplyEditDelete

 

 

2008-04-23 07:35:25     Re: Problem with the driver can4linux on Blackfin BF537-stamp

ludovic s (FRANCE)

Message: 54780    Can you me detail the procedure to follow, because I do not find  or to modify value of the VCO an the SCLK in the menuconfig of kernel .

I use the version uClinux-dist-2008R1-RC8.tar.bz2

 

Thank you

TranslateQuoteReplyEditDelete

 

 

2008-04-23 08:09:55     Re: Problem with the driver can4linux on Blackfin BF537-stamp

Michael Hennerich (GERMANY)

Message: 54782    Have a look here:

 

http://docs.blackfin.uclinux.org/doku.php?id=faq&s[]=vco#common_questions_about_kernel_settings

 

To change the clocks, edit the PLL settings in the configuration settings <code>Customize Kernel Settings</code> → <code>Blackfin Processor Options</code> → <code>Clock Settings</code> → <code>Re-program Clocks while Kernel boots</code>. The way the PLL works on the Blackfin is by taking the external crystal frequency, multiplying that up by <code>VCO Multiplier</code> (If you have a 25MHz clock, and set the Multipler to be 24, the VCO will be running at 600MHz). The core speed can be run slower than the VCO by programming the <code>Core Clock Divider</code> (Normally 1), and the <acronym title="System Clock">SCLK</acronym> must be run slower than the VCO, so it has it's own divisor, <code>System Clock Divider</code>. (If the VCO is running at 600MHz, a system clock divider of 5 will run things at 120MHz). Depending on the software load, it might be better to optimize things to have the fastest system clock possible, rather than the faster core clock.

 

While you can change the clocks in U-Boot by editing <code>CONFIG_<acronym title="System Clock">SCLK</acronym>_DIV</code> in <code>./include/configs/<board_name>.h</code>, it is not recommended, since you can quickly turn your board into a doorstop. Changing clocks in the kernel is the recommended way.

Attachments

    Outcomes