Go to advanced search

by msperl
Wed May 13, 2015 6:30 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

I would recommend first testing with this: http://www.nxp.com/demoboard/OM13012.html to see if it works and only then I would look into the HW portion. One thing is that I have no Idea about the LCP11CXX and how to program those (I am more used to Atmel chips) and would require quite a learning-curv...
by msperl
Tue May 12, 2015 6:17 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

If you look at other devices, then you can also look at SJA1000 with 64 byte FIFO, for which there exists a driver in the kernel - but it is a 5V device... As said: a MCU can run with mcp2515 or with an internal CAN-controller (whatever technology). The price point is 2.5Eu for the mcp25625 (= mcp25...
by msperl
Tue May 12, 2015 4:54 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Well - things would get more tolerant with 8 FIFO buffers (giving you 0.376ms in the worsted case of 1MBit and 0-byte can messages, 1.2ms in the best case), but you still can not avoid buffer overflows when the OS is under heavy load. Also you would need to write a new driver for that chip... Cost i...
by msperl
Wed May 06, 2015 6:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Thank you for your reply Martin. I was thinking about this last night - maybe I can start removing unneeded components from the system, like USB, network, video, disable paging, etc. to reduce interrupt demands. Could the real time kernel be used to solve some of these issues? Or something more blu...
by msperl
Wed May 06, 2015 6:31 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Maybe I'm missing something fundamental but shouldn't the RPI2 be capable of pulling the data out of the MCP2515 fast enough, especially with a kernel driver? The problem is that sometimes (especially at times of lots of interrupts because of disk-io and such) the OS sometimes decides to run other ...
by msperl
Tue May 05, 2015 1:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99572

Re: SPI driver latency and a possible solution

At least with a 4.1 kernel you should be able to use spi-dev directly with now minimal overhead (when using spi-bcm2835) and get (most) of the benefits as the userland driver (for short transfers). There is also a version in the pipeline that does DMA for longer transfers, but that is not a necessit...
by msperl
Thu Apr 30, 2015 5:24 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

The producers of pican have created this page that contains all the steps:
http://skpang.co.uk/blog/archives/1165

The only thing left unmentioned there is how to install the can-tools...
You find it here: http://elinux.org/Can-utils
by msperl
Sat Apr 25, 2015 8:33 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Martin - I see valid CAN data on the Pi via candump - but only for a couple of seconds or so, before it stops receiving completely. 1. Do you think this is related to the 2 buffer mcp2515 limitation you've mentioned before? 2. If so, is it possible to update to the 3.18 version of the kernel on a M...
by msperl
Fri Apr 24, 2015 9:59 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

msperl, thank you very much for reply. What improvement has kernel version 4.0 or later? Is this patch will be included in kernel 4.0? 4.0 contains an improvement that improves speed of spi_sync calls when the spi-bus driver use a newer driver model (which the bcm2835 does). This has the effect tha...
by msperl
Thu Apr 23, 2015 5:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Only on my rpi for now... Here my quick patch: diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index bf63fee..78014a9 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -70,6 +70,7 @@ #include <linux/module.h> #include <linux/netdevice.h> #in...
by msperl
Wed Apr 22, 2015 3:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

@nikkotorcita: I had a look at the mcp251x driver today while thinking about reducing latencies further and making sure that more packages arrive... So here the summary: if you wire the RX0BF and RX1BF pins (10 and 11) of the mcp2515 to some GPIOs on the rpi then - with the corresponding patch to th...
by msperl
Mon Apr 20, 2015 8:39 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Realtime was enabled earlier, but i am not sure if it still is. On top Realtime generally gives some guarantees on response, but it is not necessarily in the us range. but you have tho think of the times it takes to transfer a message on the bus: between 47us (11-bit ID, 0 byte data) and 158us (29-b...
by msperl
Sat Apr 18, 2015 1:16 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

500KHz and lots of CAN-messages getting sent back to back over the bus are still happening to trigger delays with the current framework - but even then you can not make 100% sure you receive every message - it is linux (not hard real-time) and the 2 receive buffers on the mcp251x are too few to make...
by msperl
Fri Apr 17, 2015 5:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

created pull request: https://github.com/raspberrypi/linux/pull/933 it actually already got merged, so with the next build it should become available @pier1999: if it is really urgent then download this one: https://github.com/msperl/linux-rpi/blob/rpi-3.18.y-fix-mcp2515-dts-with-binary/mcp2515-can0...
by msperl
Fri Apr 17, 2015 4:01 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Totally depends on popcornmix to run the next build and my time to get the patch in place first (but that should be in the next 2 hours I guess)
by msperl
Fri Apr 17, 2015 3:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

I understand - there seems to be an error with the device-tree-overlay that does set the clock in the "wrong" location... This will need a patch/update of the firmware (when it comes out) - working on that... Essentially the following: oscillator = <&can0_osc>,"oscillator-frequency"; needs to be: os...
by msperl
Fri Apr 17, 2015 3:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Note the 20 MHz oscillator which is the freq of my can device. The problem is that when I show the status of can interface it shows a clock of 8000000 which is the value of the default value and which means that ‘oscillator=20000000’ parameter isn’t picked up. the status (via ip -d -s link show can...
by msperl
Wed Apr 15, 2015 7:29 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99572

Re: SPI driver latency and a possible solution

for user-space SPI (requireing root) see: http://abyz.co.uk/rpi/pigpio/index.html that might help you as well. Still note that in user-space you may also experience scheduling issues, where the process gets interrupted for 10ms or more... Future changes to the kernel driver will improve further - es...
by msperl
Tue Apr 14, 2015 2:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99572

Re: SPI driver latency and a possible solution

here the updates that are now scheduled to get added to 4.1: spi: bcm2835: fix all checkpath --strict messages spi: bcm2835: fill/drain SPI-fifo as much as possible during interrupt spi: bcm2835: clock divider can be a multiple of 2 spi: bcm2835: enable support of 3-wire mode spi: bcm2835: move to t...
by msperl
Tue Apr 14, 2015 12:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99572

Re: SPI driver latency and a possible solution

well - this driver does not offer that many improvements to the kernel any longer. Also it is not maintained for 3.18 any longer. But on the other hand there are several improvements that possibly will go into the 4.1kernel version, which the foundation might want to back-port to 3.18 at some point....
by msperl
Mon Apr 13, 2015 3:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Interesting to know about differences in IRQ, don't know where this differences come from. One question, when you say stock kernel, what image you exactly mean. I thought using rpi-3.18.y kernel is a stock image. If not, could you please point to a working image in your opinion and I can directly u...
by msperl
Mon Apr 13, 2015 6:58 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

If it worked before, then revert back to that (if possible) and then bisect until you get back to when it stopped working. Again: I would confirm that it still works with the foundation kernel and their device-tree + overlays first and only when it is confirmed to be working move to your personal se...
by msperl
Sun Apr 12, 2015 7:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

That is why I have said: use the latest foundation provided kernel 3.18! There it works!
by msperl
Sun Apr 12, 2015 6:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Hi msperl! I've been following your development of an improved SPI driver with DMA for the Pi as well as your mcp2515a driver and it's been very helpful! I'm developing a sensor system that has at least 8 CAN nodes that need to run at full 1mbit/s speed. There is a case where I need to broadcast >5...
by msperl
Sat Apr 11, 2015 6:57 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301610

Re: CAN controller

Well in principle things work, - the mcp251x is recognized and thus you can configure can0. I see 2 possible reasons: you have configured the wrong bitrate for the bus you are connected to - you have been initially been confused about 500kHz or 250kHz, so I wonder if you are using the right paramete...

Go to advanced search