Hi Jan,

So I put a simple wire between pin 18 and 21 and try to run the 
spidev_test... Same result... FF only.... I also check with an 
oscilloscope. I see nothing... I am not able to see my data.

root@beaglebone:~# ./spidev_test -D /dev/spidev1.0 
> spi mode: 0
> bits per word: 8
> max speed: 500000 Hz (500 KHz)
> FF FF FF FF FF FF 
> FF FF FF FF FF FF 
> FF FF FF FF FF FF 
> FF FF FF FF FF FF 
> FF FF FF FF FF FF 
> FF FF FF FF FF FF 
> FF FF 


So first I am currently using my own dtc file from input on the web :

/dts-v1/;
> /plugin/;
> / {
>     compatible = "ti,beaglebone", "ti,beaglebone-black";
>     /* identification */
>     part-number = "spi0pinmux";
>     fragment@0 {
>         target = <&am33xx_pinmux>;
>         __overlay__ {
>             spi0_pins_s0: spi0_pins_s0 {
>                 pinctrl-single,pins = <
>                   0x150 0x30  /* spi0_sclk, INPUT_PULLUP | MODE0 */
>                   0x154 0x30  /* spi0_d0, INPUT_PULLUP | MODE0 */
>                   0x158 0x10  /* spi0_d1, OUTPUT_PULLUP | MODE0 */
>                   0x15c 0x10  /* spi0_cs0, OUTPUT_PULLUP | MODE0 */
>                 >;
>             };
>         };
>     };
>     fragment@1 {
>         target = <&spi0>;
>         __overlay__ {
>              #address-cells = <1>;
>              #size-cells = <0>;
>              status = "okay";
>              pinctrl-names = "default";
>              pinctrl-0 = <&spi0_pins_s0>;
>              spidev@0 {
>                  spi-max-frequency = <24000000>;
>                  reg = <0>;
>                  compatible = "linux,spidev";
>             };
>         };
>     };
> };


So I build the dtbo file :

dtc -O dtb -o /lib/firmware/BB-ARTHUR-SPI0-00A0.dtbo -b 0 -@ 
> BB-ARTHUR-SPI0-00A0.dts
> echo BB-ARTHUR-SPI0 > /sys/devices/bone_capemgr.9/slots


Then I run uname -r to get the current linux version :  3.8.13-bone47
I download kernel source from kernel.org to get the spidev_test.c file. I 
compile it on the board and I run it.

Do I wrong somewhere ? I am currently running the original EMMC 
distribution of the beaglebone black ( The board was ordered few weeks ago, 
so I can guess that I used a very recent version of the beagleboard 
binary). 

I also found in your link something about patching the kernel :

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> index 911e9e0..622adf5 100644
> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -646,6 +646,7 @@ static int spidev_remove(struct spi_device *spi)
>  
>  static const struct of_device_id spidev_dt_ids[] = {
>         { .compatible = "rohm,dh2228fv" },
> +       { .compatible = "linux,spidev" },
>         {},
>  };


Do I have to download my own source to build a beagleboard image and to 
patch the kernel before with this patch to be able to use SPI ? 

Thanks & Regards,
Arthur.

Le mardi 11 novembre 2014 00:54:29 UTC+1, [email protected] a écrit :
>
> Hi,
>
>  Following the links: http://elinux.org/BeagleBone_Black_Enable_SPIDEV 
> and 
> http://www.nagavenkat.adurthi.com/2014/02/spi-communication-beaglebone-black-as-master-to-arduino-as-slave/
>  
> I was able to make it work, but I have a SS too long (1.4ms) for my need. 
> For easy test connect MOSI and MISO with a wire (loopback) to eliminate 
> connection problem with you SPI slave.
> Hope this will help. When you done, can you measure the timing a let me 
> know?
> I can post you my code if you need it.
>
> Jan
>
> On Tuesday, November 11, 2014 5:03:38 AM UTC+11, [email protected] 
> wrote:
>>
>> Hi,
>>
>> I am trying to communicate with a device (ADS1299à by using the 
>> Beaglebone black but without success. First I have to enable spi dev 
>> entries in /dev. There are plenty of blog/tuto which are giving dtc file to 
>> generate our own dtbo. But dtc files seems to not be always the same.
>>
>> In fact I can see that there are already some dtbo files in /lib/firmware 
>> : 
>> root@beaglebone:~# ls /lib/firmware/ | grep SPI
>> ADAFRUIT-SPI0-00A0.dtbo
>> ADAFRUIT-SPI1-00A0.dtbo
>> BB-SPIDEV0-00A0.dtbo
>> BB-SPIDEV1-00A0.dtbo
>> BB-SPIDEV1A1-00A0.dtbo
>>
>> So I want to use only SPI0 because I know that SPI1 is already used by 
>> HDMI. Can I used theses dtbo files ? Is it better to write my own ? It is 
>> quite strange, when I enable one of theses dtbo files, I get not only one 
>> but two entries in /dev ??
>>
>> Currently I want to validate my wiring between the two boards. I found a 
>> piece of code to read the device id in register of the device though SPI. 
>> But when I try to read this register, I can only get 1 or only get 0 
>> (depends of the dtbo files)
>>
>> Any advice of the good way to process here ?
>>
>> Thanks & Regards,
>> Arthur.
>>
>>
>>
>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to