2008-08-13 11:44:32     BF548 CAN Baud Rate

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

2008-08-13 11:44:32     BF548 CAN Baud Rate

Patrick Mc Donnell (IRELAND)

Message: 60412   

 

Hi,

 

When testing the CAN on the BF548 I have noticed that the Baud rate is not been set properly.

 

To test the CAN I am using Vector CANalyzer, when I set CANalyzer to 125KBaud with any sampling point and use the can4linux example can_send, all I  get is error frames as can be seen in the attachment (125KB_BF548)(CAN 1bus is in use on the CANalyzer).

 

The command I use to send the messages in uClinux is "can_send -b 125 -t 10"

 

Through trial and error I found that the command above will succesfully send messages to CANalyzer when i set the CANalyzer to 133.333KBaud (it works best with a sampling point of 75%) as can be seen in the attachment (133.33KB_BF548).

 

Seen as 125K is a standard for CAN I would rather have my CAN running at this speed instead of 133.333K, so can anyone offer me help in how to get the BF548 communicating at 125K.

 

I have confirmed that my CANalyzer is functioning properly by testing it on the other equipment we have in the lab.

 

Thanks,

 

Patrick

 

133.33KB_BF548.bmp

125KB_BF548.bmp

QuoteReplyEditDelete

 

 

2008-08-13 22:35:37     Re: BF548 CAN Baud Rate

Yi Li (CHINA)

Message: 60430   

 

Patrick,

 

Could you try to set SCLK to 125 MHz and test again?

 

This thread may help you:

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_sort_by=message_count&_forum_sort_order=desc&_forum_thread_total_items=50&_forum_thread_page=2&_forum_action=ForumMessageBrowse&thread_id=17924

 

-Yi

QuoteReplyEditDelete

 

 

2008-08-14 03:17:26     Re: BF548 CAN Baud Rate

Michael Hennerich (GERMANY)

Message: 60436   

 

This page also includes information about this:

 

The default baud rate of 125k works only if you set 125MHz SCLK - this can be changed ...

 

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:can_module

 

-Michael

QuoteReplyEditDelete

 

 

2008-08-14 08:12:49     Re: BF548 CAN Baud Rate

Patrick Mc Donnell (IRELAND)

Message: 60470   

 

Yi and Michael,

 

Thanks for the reply.

 

When I made the changes you suggested, ie

 

Blackfin Processor Options --->

 

Board Customizations --->

 

[*] Re-program Clocks while Kernel boots?

 

(20) VCO Multiplier

 

(1) Core Clock Divider (NEW)

 

(5) System Clock Divider (NEW)

 

When I compile the kernel and tftp it down to my board it won't boot, It just freezes in the same place as shown below:

 

bfin> bootm

## Booting image at 01000000 ...

   Image Name:   Linux-2.6.22.18-ADI-2008R1-svn

   Created:      2008-08-14  11:15:01 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    4846447 Bytes =  4.6 MB

   Load Address: 00001000

   Entry Point:  00220000

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

Starting Kernel at = 220000

 

Any opinions on this?

 

Thanks,

 

Pat

QuoteReplyEditDelete

 

 

2008-08-14 08:29:32     Re: BF548 CAN Baud Rate

Mike Frysinger (UNITED STATES)

Message: 60472   

 

i recall the BF54x kernel reprogramming of clocks being broken in 2008R1.  you should try 2008R1.5 ... or change the SCLK using u-boot.

QuoteReplyEditDelete

 

 

2008-08-14 08:45:51     Re: BF548 CAN Baud Rate

Patrick Mc Donnell (IRELAND)

Message: 60473   

 

Mike,

 

I am running 2008R1-RC8.

 

How can i change the clock using u-boot?

 

Thanks,

 

Pat

QuoteReplyEditDelete

 

 

2008-08-14 08:50:42     Re: BF548 CAN Baud Rate

Michael Hennerich (GERMANY)

Message: 60474   

 

I guess it's this bug:

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_id=141&tracker_item_id=4191

 

As Mike suggested change SCLK in u-boot.

 

Or better update the CAN timing using the spreadsheets posted here:

 

http://blackfin.uclinux.org/gf/project/uclinux-dist/forum/?action=ForumBrowse&forum_id=39&_forum_sort_by=message_count&_forum_sort_order=desc&_forum_thread_total_items=50&_forum_thread_page=2&_forum_action=ForumMessageBrowse&thread_id=17924

 

 

 

-Michael

QuoteReplyEditDelete

 

 

2008-08-14 09:10:40     Re: BF548 CAN Baud Rate

Mike Frysinger (UNITED STATES)

Message: 60475   

 

hmm, i guess i havent documented this yet.  just open the board config for u-boot and there will be comments in there explaining the defines.

Attachments

Outcomes