Go to advanced search

by msperl
Fri Jan 10, 2014 12:48 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Reading speed of 8 GPIO pins
Replies: 4
Views: 1116

Re: Reading speed of 8 GPIO pins

In principle you can read the SOC GPILEV0 and GPLEV1 registers and get 32 and 22 pins of the SOC (see BCM2835 ARM Peripherals pdf page 96) Problem is that you have to do your own low-level programming to get access to those registers from a normal linux program... (or you write your own kernel drive...
by msperl
Mon Jan 06, 2014 3:21 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

In your driver: /* callback to execute when the transfer is finished - note that this may run in interrupt context, so no sleep!!! */ void complete_function(void*) { /* do something with data */ /* possibly register a timer callback for in X usec that schedules the next message */ } /* globally allo...
by msperl
Sun Jan 05, 2014 9:43 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

Make use of spi_async for anything that is timing critical, then you shortcut the context switch! But I believe what you really want to do is have a spi message scheduled at regular intervals. And I believe there are some ideas to implement something like this in the future in the stock kernel, but ...
by msperl
Fri Jan 03, 2014 12:47 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

not fully knowing how you do it, I assume you want to do a thing like: Read X bytes wait X ms Read X bytes wait ... using spidev. Unfortunately the issue lies with the realtime behaviour of linux and how the SPI framework is implemented. It is mostly related to scheduling latencies, because the way ...
by msperl
Tue Dec 24, 2013 1:42 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

There is actually the SN65HVD23x Series that is 3.3V only. It works quite well for my use-case and does not require any level shifting. But it might draw too much current from the 3v3 rail of the rpi when transmitting lots of data. probably low frequency can bus are more susceptible here than faster...
by msperl
Fri Dec 06, 2013 12:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

Last: I found out that the "Uncompressing Linux... done, booting the kernel." still shows up after such a treatment, but only if the /boot/kernel.img is a compressed image. If it is _uncompressed_, then it does not show... So this means you will need to build your own kernel and use the uncompressed...
by msperl
Fri Dec 06, 2013 11:21 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

OK - I have looked further into the NOOBS SD image and found that the partition scheme for the SD card looks totally different with the NOOBS image compared to a plain "raspbien" image: Plain Raspbien: root@raspberrypi:~# fdisk -l /dev/mmcblk0 Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes 4 heads, 1...
by msperl
Fri Dec 06, 2013 10:54 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

I have done a quick test installing via noobs. and with Noobs I see that when booting that: the NOOBS rescue screen comes up on the connected monitor for a few seconds prior to booting the real kernel I also see the messages on the serial console you are talking about: Welcome to the rescue system r...
by msperl
Thu Dec 05, 2013 9:52 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

The recovery system message still makes me suspicious about an intermediate bootloader that writes this message....

One question: what was your original image from which you have started your setup of the rpi when you have started?

Did you use noobs or directly the raspbian image?
by msperl
Thu Dec 05, 2013 7:19 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

well - fact is that I do not see such a behaviour on my boards. Also "Unpacking Linux" indicates that there is a linux kernel that boots. But the "Press shift for recovery" might indicate a bootloader that comes before the real kernel boots... Maybe it is the "NOOBS bootloader" that asks you if you ...
by msperl
Thu Dec 05, 2013 10:00 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

Sorry: it is in /boot/cmdline.txt

And you have to remove the following:

Code: Select all

console=ttyAMA0,115200 kgdboc=ttyAMA0,115200
martin
by msperl
Thu Dec 05, 2013 7:52 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Acts up when Raspberry Pi Boots UART
Replies: 13
Views: 3713

Re: Arduino Acts up when Raspberry Pi Boots UART

You can remove the ...=/dev/ttyAMA0 arguments in /boot/config.txt (don't know the arguments out of my head but one is for the boot and the other is for the kernel-debugger...) That removes the setting of the kernel that will report its progress during startup of the kernel prior to init starting... ...
by msperl
Wed Dec 04, 2013 5:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

Thanks for the measurements Bert! Still the effort here is there to avoid packet loss in the face of short bursts of messages on a CAN-Bus. 21.36k messages/s would be above the worsted case of 19K CAN messages/second with 1MBit , standard ID and 0 data length. That is something that a RPI can not ha...
by msperl
Tue Dec 03, 2013 9:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

True, but then: what is the challenge?
The dma driver will take some time to propagate - that is for sure...
Martin
by msperl
Tue Dec 03, 2013 8:40 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

well, that is 100 TQFP pins plus the price-tag... Also my knowledge of PIC is 0... Also as my calculations shows you would need a RPI-SPI-Bus-speed of 1.5-2x the CAN speed/BUS to transfer the amount of data realistically (with some latencies). AND that is is just communication between what the RPI a...
by msperl
Mon Dec 02, 2013 7:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

As the DMA driver is only progressing slowly (and there are some optimizations going upstream that need to filter back into the raspbien kernel eventually) and I came to the realization that there are still latencies in a heavily loaded linux kernel (say lots of IO to SD Card,...) which could result...
by msperl
Mon Dec 02, 2013 7:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

Status update: Progress is quite slow at this very moment. We need some minor changes to the upstream SPI framework to make everything work with optimal performance, so communication with upstream is needed and i need to learn the requirements for upstream kernel development. Still there is some pro...
by msperl
Thu Nov 28, 2013 10:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO on pin 8 disables /dev/spidev0.0?
Replies: 5
Views: 2718

Re: GPIO on pin 8 disables /dev/spidev0.0?

Unfortunately I know of no way to change the GPI to the alternative function again besides reloading the SPI driver... Maybe you can patch config pf the library to use a different GPIO for toggling, so that you are not impacted and it still may work. (or you remove those PIN-changes in the library i...
by msperl
Thu Nov 28, 2013 3:50 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

The wikipedia page already contains everything you need to send a message: here the portion to get from device name (can0) to device index: strcpy(ifr.ifr_name, "can0"); ioctl(s, SIOCGIFINDEX, &ifr); And then the rest of the code to get you to send a message. Receive is similar using the same socket...
by msperl
Thu Nov 28, 2013 7:27 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO on pin 8 disables /dev/spidev0.0?
Replies: 5
Views: 2718

Re: GPIO on pin 8 disables /dev/spidev0.0?

You should _not_ toggle gpio 7-10 if you use spi - these are set to the alternative mode 0 when the driver loads.

The spi hw takes care of the chip-select toggling itself - no need for any interaction on the program side to set/reset CS.

Martin
by msperl
Thu Nov 28, 2013 7:20 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: UART receive buffer?
Replies: 8
Views: 12269

Re: UART receive buffer?

Why don't you run blocking io on the serial without any delays - if you wait with sleep or if you wait for io does not make a difference... Anyway: linux has an additional data buffer - whatever that size is... The other thing is: what parts of the data is missing? At the beginning, at the end or in...
by msperl
Wed Nov 27, 2013 10:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: UART receive buffer?
Replies: 8
Views: 12269

Re: UART receive buffer?

Page 175 of the soc PDF says: 16x8 transmit 16x12 receive Beware that there are scheduling delays for interrupts so you should scale your baud-rate so that the buffers don't fill when interrupt handler is delayed... Typically 115200 baud should work with no loss - that would mean worsted case about ...
by msperl
Wed Nov 27, 2013 7:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: CAN controller
Replies: 813
Views: 338834

Re: CAN controller

Look here: http://en.wikipedia.org/wiki/SocketCAN
the page also contains some code

Martin
by msperl
Wed Nov 27, 2013 7:08 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

Well - I found out that a lot really depends on how the driver itself is written and how the driver schedules transfers. If the driver is using the synchronous interface the driver will never be able to run as many messages as possible. But if he runs the async Messages and schedules a lot of those,...
by msperl
Wed Nov 27, 2013 8:36 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI driver latency and a possible solution
Replies: 241
Views: 135430

Re: SPI driver latency and a possible solution

Update: I am currently working to get some code upstream (and that requires a lot of convincing and also cleaning up code). fact is that I am still stuck in the interrupt-driven stage, as I already try to optimize the "non-optimized" spi_messages, so that the CPU overhead (and scheduling delays) for...

Go to advanced search