Go to advanced search

by msperl
Thu Apr 09, 2015 8:48 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Assuming a 16MHz clock 01 b5 01 is configured for 500khz can-bus speed 03 b5 01 is configured for 250khz can-bus speed So you have been using different bitrate parameter to get the different values. You can also find the "typical" values with: can-calc-bit-timing -c 16000000 mcp251x Which gives you ...
by msperl
Wed Apr 08, 2015 4:39 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

That is the only thing you have to get from somewhere else unfortunately... I still wonder why there is no package to install those automatically in wheezy. The next debian contains such a package. but in principle it works like this: git clone https://git.gitorious.org/linux-can/can-utils.git make ...
by msperl
Wed Apr 08, 2015 7:54 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

The foundation kernels now come with can and mcp251x drivers compiled in.
But you only get those updates only if you update via rpi-update.
by msperl
Tue Apr 07, 2015 9:12 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

It looks like hardware is fine. Do I need some other device on bus? same as the answer before - you need to configure the can-bus speed via: /sbin/ip link set can0 up type can bitrate 500000 You also need at least a second CAN device with identical bitrates configured on the CAN-BUS for communicati...
by msperl
Mon Apr 06, 2015 1:56 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

The message signifies that the HW itself is recognized correctly. It just means you need to do the final setup step to configure the baud rate on the bus, which is dependent on your use-case. To set the bit-rate to 500khz you need to run the following: /sbin/ip link set can0 up type can bitrate 5000...
by msperl
Tue Mar 31, 2015 3:19 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

Hi msperl, If i understand you correctly DMA is not suitable for byte-wise transfer (very small data chunks) or unpredictable transfers. In case i can find a good 4 channel simultaneously sampling ADC it would give me a single data stream containing all channels - thus causing a single transfer of ...
by msperl
Tue Mar 31, 2015 1:36 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

I had a look at spidev, but it seems as if the spidev as of now does not make use of any of those "advances" for spi_sync but relies instead on spi_async, which requires context-switches,... You may want to patch spidev.c and there change spidev_sync so that it uses spi_sync instead of spi_async. Th...
by msperl
Tue Mar 31, 2015 1:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

As far as i understood, the crucial part is latency here, since context switches or scheduler interrupts may delay the SPI communication. I have some questions left where i hope you could help me: - Is the default spidev driver (spi_bcm2708) included in 3.12. Kernel (got a RT kernel with that versi...
by msperl
Mon Mar 30, 2015 7:14 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

As said: if you want to make it quick for your solution - as explained - use one core for the communication from the FPGA into the rpi. Then you can avoid the kernel barrier and keep everything in user-space and do not have to focus on those details... But if you wanted to really do some communicati...
by msperl
Mon Mar 30, 2015 6:08 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

Hey Martin, this was my idea to interrupt on the CS -> LOW from the FPGA/ASIC and poll out the data. Yes MCU utilisation will be high during this event but it is also critical to get all data as there is no resend possibility. Second option would be to implement at hardware buffer (SPI storage) or ...
by msperl
Mon Mar 30, 2015 3:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 99448

Re: SPI driver latency and a possible solution

RPI as a SPI slave seems very unlikley to ever work efficiently. There is a chance for it it to work using the other (BSC) slave-SPI engine, but that is quite an effort for this new driver and someone who is interrested in taking up that task. Also the specs (BCM2835-ARM-Periphials page 160) indicat...
by msperl
Sun Mar 29, 2015 8:05 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Oscillator is defining the Quartz/resonator on your board. The ip command unfortunately shows this value divided by 2. So the oscillator setting is fixed by your setup. This value needs to get set in your device-tree as a parameter when loading the overlay via /boot/config.txt. The can-bus bitrate y...
by msperl
Sat Mar 28, 2015 3:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Looks to me as if there is some missmatch in bit-clock-speeds, or a polarity issue on the bus or missing bus termination. Anyway: I would recommend disabling ifplugd for the can interfaces to avoid the shutting down of the interface - look at /etc/default/ifplugd and modify HOTPLUG_INTERFACES to onl...
by msperl
Thu Mar 26, 2015 9:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI TFT without D/C pin (9-bits SPI)
Replies: 2
Views: 1222

Re: SPI TFT without D/C pin (9-bits SPI)

From what I have gleaned from the driver the reason is that the device is actually 9-bit spi, which is not supported by the linux framework as is, but has an 8-bit spi + d/c (d=data, c=command) to emulate the same thing. Note also that the lossi mode (9bit mode) of the hardware spi has some special ...
by msperl
Mon Mar 23, 2015 12:29 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Also it is important that the clock of the mcp2515 is running correctly!

Without a connected clock/crystal the mcp2515 will not respond on SPI and return 0x00 (or 0xff if you have added a pullup to MISO)...

So you may want to check that as well!

Martin
by msperl
Mon Mar 23, 2015 8:28 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

I have just checked - for me MISO/MOSI are typically low, so there must be something pulling it high on your end to result in 0xff to get read - especially if that ONLY happens with CS0 (=default) but you are reading 0x00 for CS1 (=argument 7)...
by msperl
Mon Mar 23, 2015 7:26 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Secondary SD/MMC interface
Replies: 23
Views: 12525

Re: Secondary SD/MMC interface

OK - i think I found my issue:
You need to add a pullup resistor for CS!

Note: If you have got 2 devices on a brakeout-board but you only connect one SPI device via CS you HAVE to HAVE pullup on both CS! This happened to me with a Adafruit 1.8"TFT+SD card adapter.

Martin
by msperl
Mon Mar 23, 2015 6:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

For completeness: Connect gpio7 (cs1) with gpio9 (miso) directly(maybe with a 1k resistor) without anything else connected to the pi. Then run the script above again, but give an argument of "7" to the script to use the second chip-select. If it returns 255/0xff for all then the portion on the pi is...
by msperl
Sun Mar 22, 2015 11:31 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Just check with an mcp2515 on a breadboard - Just connect miso/mosi/sck/cs0/gnd/3v3 to the mcp2515 and the script should work and show the values above. But beware: you may also need a working clock/resonator to get spi on the mcp2515 working in the first place - can not remember if I have ever trie...
by msperl
Sun Mar 22, 2015 10:36 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Secondary SD/MMC interface
Replies: 23
Views: 12525

Re: Secondary SD/MMC interface

What I get in dmesg is:

Code: Select all

[  667.745791] mmc_spi spi0.1: SD/MMC host mmc1, no WP, no poweroff, cd polling
[  667.770415] mmc1: error -110 whilst initialising SD card
[  670.961894] mmc1: error -110 whilst initialising SD card
by msperl
Sun Mar 22, 2015 10:19 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Secondary SD/MMC interface
Replies: 23
Views: 12525

Re: Secondary SD/MMC interface

Did someone find a solution to this problem? I remember that mmc_spi has been working 2 years ago, but with the last 3.18 with device-tree it does not work any longer. Driver works and loads, spi commands get sent, but it does not fully work - spi communication seems to work, but it stops at some po...
by msperl
Sun Mar 22, 2015 10:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Device tree looks fine. Are you sure the cabling is done correctly as per your diagram? That seems to be the only thing left open. The only other thing I can think of is to run the following shell script (which runs spi bitbang inside a shell script): #! /bin/sh CS=8 test -z "$1" || CS=$1 SCLK=11 MO...
by msperl
Sun Mar 22, 2015 12:50 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

Please also add the following to /boot/config.txt:

Code: Select all

dtdebug=on
then reboot.

Please run:

Code: Select all

head /sys/bus/spi/devices/spi*/modalias
as well as:

Code: Select all

sudo vcdbg log msg
and share the output?

Thanks, Martin
by msperl
Fri Mar 20, 2015 5:35 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

actually this "one message only" issue with 3.12.x kernel could be related to some interrupt handling bug in the mcp251x driver that could only get resolved during a restart. But this was actually (mostly) related to receiving too many packets in a short time. The driver in the new 3.18.x kernel doe...
by msperl
Fri Mar 13, 2015 11:10 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 811
Views: 301400

Re: CAN controller

the approach using the foundation kernels works for RPI and RPI2.

Go to advanced search