cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
demke234
Visitor
Visitor
6,352 Views
Registered: ‎02-10-2015

SPI on Zynq

Jump to solution

Hi all,

 

I'm trying to use the PS SPI peripheral to speak to some logic in the PL over an EMIO channel. I've gotten this to work to the point where I can boot petalinux, cat some control bytes to the /dev/spidev-device and then read back the reply data.

 

I'd like this to work in my debian Zynq build as well but here I'm running into trouble. Using the same kernel and device-tree, performing the same level shifting enabling boot logic, I still fail to use the spidev under Debian.

 

The error message is:

 

root@zynq:~# cat /dev/spidev32766.0
cat: /dev/spidev32766.0: Message too long

 

Anyone have some ideas what to look at?

 

0 Kudos
1 Solution

Accepted Solutions
milosoftware
Scholar
Scholar
10,536 Views
Registered: ‎10-26-2012

"cat" uses a  64k block size to read data. Try using "dd bs=256 ..."  to read from the device in smaller chunks.

View solution in original post

0 Kudos
4 Replies
demke234
Visitor
Visitor
6,349 Views
Registered: ‎02-10-2015
Chipscope shows no activity on the SCLK or SS/CS-line when I access the device. SCLK stays low and CS stays high.
0 Kudos
milosoftware
Scholar
Scholar
10,537 Views
Registered: ‎10-26-2012

"cat" uses a  64k block size to read data. Try using "dd bs=256 ..."  to read from the device in smaller chunks.

View solution in original post

0 Kudos
demke234
Visitor
Visitor
6,277 Views
Registered: ‎02-10-2015

Excellent, thank you! That works :)

 

Any idea why the Petalinux rootfs would behave differenly from Debian? I am using the same kernel and device-tree for both. In petalinux 'cat' works both for reading and writing.

 

0 Kudos
mongsil.cho
Visitor
Visitor
2,548 Views
Registered: ‎08-31-2016

Hi.

i have a question of SPI recognition.

i also use spi as a PS.

SPI does NOT appear in /proc/devices after start in my petalinux env.

i use the zynq706 and petalinux 2014.4 .

could u let me know how did you set DTS file(spi part)  ?

 

any kindly comment will be helpful.

 

Best Regards. Steven.

0 Kudos