[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4694: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4695: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4696: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
8devices Community - View topic - usb2can: Linux driver
www.8devices.com
View unanswered posts | View active topics It is currently 18 Apr 2024, 14:42



Reply to topic  [ 21 posts ]  Go to page Previous  1, 2, 3  Next
 usb2can: Linux driver 
Author Message

Joined: 07 Dec 2011, 16:01
Posts: 525
Location: Lithuania
How to calculate BRP, SJW,TSEG1,TSEG2 you can find here:
http://www.st.com/internet/com/TECHNICA ... str730.pdf
http://www.st.com/internet/com/TECHNICA ... str71x.pdf

APB_CLK seems to me was like 32 MHz... I don't remember exactly now...


22 Nov 2012, 16:31
Profile

Joined: 28 Oct 2012, 09:11
Posts: 25
Thank you very much.

Updated the source code to use 32 MHz instead of 8 MHz (this was an assumption based on the circuit).
Bit timing calculation will be done by the linux kernel. I assume this should also work for this device. I will try to patch, if it does not.

regards,
Bernd


22 Nov 2012, 17:13
Profile

Joined: 28 Oct 2012, 09:11
Posts: 25


25 Nov 2012, 16:26
Profile

Joined: 07 Dec 2011, 16:01
Posts: 525
Location: Lithuania
void Set_System(void)
{

/* MRCC configuration --------------------------------------------------------*/
/* MRCC system reset(for debug purpose) */
MRCC_DeInit();

/* Wait for OSC4M start-up */
OSC4MStartUpStatus = MRCC_WaitForOSC4MStartUp();

if(OSC4MStartUpStatus == SUCCESS)
{
/* Set HCLK to 60MHz */
MRCC_HCLKConfig(MRCC_CKSYS_Div1);

/* Set CKTIM to 60MHz */
MRCC_CKTIMConfig(MRCC_HCLK_Div1);

/* Set PCLK to 30MHz */
MRCC_PCLKConfig(MRCC_CKTIM_Div2);

/* Enable Flash burst mode */
CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);

/* Set CKSYS to 60MHz */
MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);
}

}


26 Nov 2012, 08:36
Profile

Joined: 28 Oct 2012, 09:11
Posts: 25
The driver should work now.

Many thanks to gedass and Gerd!

Source: https://github.com/krumboeck/usb2can

regards,
Bernd


27 Nov 2012, 19:37
Profile

Joined: 28 Oct 2012, 09:11
Posts: 25
Linux kernel 3.9 will support USB2CAN converter:
http://git.kernel.org/cgit/linux/kernel ... usb_8dev.c

Summary:
* linux driver is open (GPLv2)
* firmware is open (GPL and compatible License)
* linux kernel support (version 3.9; in very near future)
* good benchmark results (done by some developers and testers)

START ADVERTISING!!!

regards,
Bernd


09 Mar 2013, 07:03
Profile

Joined: 07 Dec 2011, 16:01
Posts: 525
Location: Lithuania
Fine!


09 Mar 2013, 09:07
Profile

Joined: 30 Dec 2013, 05:58
Posts: 1
Hi,

I am wondering if there is any (or you guys could point me in the right direction) example available how to use your usb2can driver?
I have never developed any sophisticated application using drivers. Have been using Qt5 c++ under ubuntu12.04 I have application up and running and the rs232 communication with some devices is working ok, this is kind of easy to implement it is all inbuilt in qt5:-). Now I have to get this can2usb going and coming from assembler and simple C for microcontrollers I find it bit too confusing to comunidcate with outside world.
BTW I run kernel 3.9.4 and your driver is already ther and running I can do:
modprobe can_raw
modprobe can_dev
insmod usb_8dev.ko
ip link set can0 up type can bitrate 125000 sample-point 0.875

and it all does what I think it should, but how the h.... I can talk to it in Qt5???
Bit lost I am!

thank you
Best regards
Josef


30 Dec 2013, 06:24
Profile

Joined: 04 May 2012, 08:55
Posts: 61


03 Jan 2014, 08:58
Profile

Joined: 22 Feb 2014, 18:35
Posts: 1
Hello,

I am having a problem using the linux driver [1].
modprobe can_raw
modprobe can_dev
insmod usb_8dev.ko
Seems to work properly and usb_8dev is visible in lsmod.
But when I use "ip link set can0 up type can bitrate 1000000 sample-point 0.875" it says "RTNETLINK answers: Invalid argument "
ip link gives me "can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN qlen 10
link/can"

I am running Ubunutu with kernel version 2.6.35

Are there any ideas on what went wrong or did anyone encouter that problem before?

Every kind of help would be highly appreciated.

thanks,
Daniel

[1] https://github.com/krumboeck/usb2can/tree/pre-3.3


22 Feb 2014, 18:48
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page Previous  1, 2, 3  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.