I tried the logi-com-test in the logi-hard git repo, however the test_wishbone failed with error message "Transfer Failed". On the hw side, I replaced the ucf in logi-com-test with the ucf file logibone_r1_5.ucf from the master_ucf section of the git. I generated the bit file (logibone_com_test_spi.bit) using Xilinx ISE and loaded the bit file using the logi_loader. On the sw side, I ran the makefile to generate the "test_wishbone" executable. After loading the bit file I ran the test_wishbone executable and this is the error message I get.
Time in Microsecond=132
W Speed=====121 KB/Sec
Time in Microsecond=73
R Speed=====219 KB/Sec
Transfer failed [0] = 0000
Transfer failed [1] = 0000
Transfer failed [2] = 2000
Transfer failed [3] = b6ef
Transfer failed [4] = 0000
Transfer failed [5] = 0000
Transfer failed [6] = 0000
Transfer failed [7] = 0000
Time in Microsecond=10
W Speed=====1600 KB/Sec
Time in Microsecond=9
R Speed=====1777 KB/Sec
Transfer failed [0] = 0000
Transfer failed [1] = 0000
Transfer failed [2] = 2000
Transfer failed [3] = b6ef
Transfer failed [4] = 0000
Transfer failed [5] = 0000
Transfer failed [6] = 0000
Transfer failed [7] = 0000
Appreciate any pointers in solving this issue.
Thanks,
Kumar
Comments
static const char * device = "/dev/spidev0.0";
into
static const char * device = "/dev/spidev1.0
The compile on the BBB and run the code.
Regards,
Jonathan Piat
cape_enable=capemgr.enable_partno=BB-SPIDEV1
to enable spi. Then you can configure your image with logi-tools. In the init_logibone.sh script comment the lines :
#cd init_logibone
#sudo ./init_eeprom.sh
This will avoid the init script to flash the cape eeprom and will disable the auto-loading of the cape.
Once done, you can use the com test project with SPI (i have updated the project on the git). Just make sure that unused pins are left floating by doing a right click on "generate programming file" -> process properties -> COnfiguration Options -> Unused Pins -> Floating.
Then you can use the sw logibone_spi from the git (logi-com-test/sw/logibone_spi) on the beaglebone to test the communication. I have tested with a SPI clock of 48MHz and it seem to work fine( but speed is lower than what i get on the rapsberry pi with same clock speed).
Could you summarize the steps to get running SPI on the logibone, please?
Thanks.
Time in Microsecond=198
W Speed=====80 KB/Sec
Time in Microsecond=803
R Speed=====19 KB/Sec
Transfer failed [0] = 0000
Transfer failed [1] = 0000
Transfer failed [2] = 0000
Transfer failed [3] = 0000
Transfer failed [4] = 0000
Transfer failed [5] = 0000
Transfer failed [6] = 0000
Transfer failed [7] = 0000
Time in Microsecond=185
W Speed=====86 KB/Sec
Time in Microsecond=145
R Speed=====110 KB/Sec
Transfer failed [0] = 0000
Transfer failed [1] = 0000
Transfer failed [2] = 0000
Transfer failed [3] = 0000
Transfer failed [4] = 0000
Transfer failed [5] = 0000
Transfer failed [6] = 0000
Transfer failed [7] = 0000
I have the same ubuntu image loaded into the SD card, the only thing I did'nt find the same was the changes in "init_logibone.sh" I've got "install_logibone.sh" instead but I did the same changes for it.
Appreciate any help about that.
Thanks.
But in the meantime I'm trying to get it ready, reading this post seems to be possible...
I made some progress, I can check that I've got the SPI signals working.I did manage to setup a easy VHDL code only with spi_wishbone_wrapper.vhd the intercon.vhd and my custom testing code in order to test if the data is correct.
The transmision MOSI is working, I'm able to check that the data transmited is correct, the problem comes whe I'm trying to read back this data, I'm getting a nice 0.
Is there any setup about the SPI that I did miss? seems like the receiving module is not working fine...
Any ideas?
Thanks!
gettimeofday(&temp1,NULL);
if((i = wishbone_write(writeVals, 2, 0x0000)) < 2){
printf("Write error !, returned %d \n", i);
}
gettimeofday(&temp2,NULL);
gettimeofday(&temp1,NULL);
if((i = wishbone_read(readVals, 2, 0x0000)) < 2){
printf("Read error !, returned %d \n", i);
}
gettimeofday(&temp2,NULL);
for (i=0;i<2;i++){
printf("returned %i \n", readVals[i]);
}
Thanks in advance.
do you still have your logibone cape recognized as such (do a "dmesg | grep LOGI" in a console ? If you fail to read from SPI, this can be a BBB mux setup issue. When the LOGIBONE is properly detected it does not set the SPI pins for true SPI but only FPGA programming interface (no need for MISO), so if the cape is detected, the SPI reads might not work.
[ 0.577265] bone-capemgr bone_capemgr.9: slot #0: 'BB-BONE-LOGIBONE,00R1,VALENTFX,BB-BONE-LOGIBONE'
[ 0.689211] bone-capemgr bone_capemgr.9: loader: before slot-0 BB-BONE-LOGIBONE:00R1 (prio 0)
[ 0.689225] bone-capemgr bone_capemgr.9: loader: check slot-0 BB-BONE-LOGIBONE:00R1 (prio 0)
[ 0.689785] bone-capemgr bone_capemgr.9: loader: after slot-0 BB-BONE-LOGIBONE:00R1 (prio 0)
[ 0.689812] bone-capemgr bone_capemgr.9: slot #0: Requesting firmware 'BB-BONE-LOGIBONE-00R1.dtbo' for board-name 'BB-BONE-LOGIBONE', version '00R1'
[ 0.689836] bone-capemgr bone_capemgr.9: slot #0: dtbo 'BB-BONE-LOGIBONE-00R1.dtbo' loaded; converting to live tree
[ 0.733852] bone-capemgr bone_capemgr.9: loader: done slot-0 BB-BONE-LOGIBONE:00R1 (prio 0)
[ 0.734160] bone-capemgr bone_capemgr.9: slot #4: BB-BONE-EMMC-2G conflict P8.21 (#0:BB-BONE-LOGIBONE)
Many thanks.
sudo sh -c "echo 'abcd' > /sys/bus/i2c/drivers/at24/1-0054/eeprom"
this will overwrite the first bytes of the eeprom and linux won't automatically load the description
Compiled for LOGI-BONE
Board variant is LOGIBONE_R1.5
can't open SPI spi_device
can't open SPI bus
No logi-board detected !!
thanks.
cape_enable=capemgr.enable_partno=BB-SPIDEV1
to uEnv.txt in /boot ?
I just fixed that with intall_logibone.sh
But I still have the problem in the receiving data...
yes, I've got that line in the uEnv.txt file and all previous steps..
The thing is I've got working the spi but only in trasmision to the FPGA when I'm reading back only I'm reading a 0, as long was the same address which I wrote before otherwise I'm getting high numbers like 65321 o something like that...
I did check the bus lines with a logical analizer and I saw the MISO(working but receiving a 0) line a low level logic and the MOSI (working) at high level...I don't know if this is a clue or not but maybe I have to setup something else in the spi configuration...
Other thing I'm thinking maybe a problem in the sw functions, when I'm compiling the test_wishbone.c file (sudo make) I'm getting a warnings with the values passed to de write and read functions:
test_wishbone.c:74:3: warning: passing argument 1 of ‘wishbone_read’ from incompatible pointer type [enabled by default]
if((i = wishbone_read(readVals, NB_VAL, 0x0800)) < NB_VAL){
^
but it doesn't affect to the transmition...
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
uname_r=3.8.13-bone63
#dtb=
uuid=9c9ea694-43de-45a4-9e35-0190f1f19063
cmdline=quiet
##Example
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=
##enable BBB: eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v2.sh
cape_enable=capemgr.enable_partno=BB-SPIDEV1
thanks.
The weird thing is the transmision works even with the strange clock signal supposed to be continuous, I mean 8 clocks per byte...I don't know what is going on...