We use cookies to provide our visitors with an optimal site experience. View our privacy notice and cookie notice to learn more about how we use cookies and how to manage your settings. By proceeding on our website you consent to the use of cookies.
Hello,
Lots of information is scattered around the web related to device tree overlay and device tree , I am trying to use a SPI peripheral with the BBB ( kernel 4.14 + ubuntu 20.04 => git checkout origin/am33x-v4.14 -b tmp) on spi0.
Which way should i go :
(1) Using Device tree overlay
(2) Modifying the device tree
I proceeded with #2 and tried to find the device tree entry of the SPI0 and the corresponding driver node
I did the modification in the file : KERNEL/arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi
but on ./tool/rebuild.sh (rebuilding) I noticed this file was not picked up .
I wanted to know which all device tree files I need to modify and how to include them in the build?
second which one is better way #1 or #2
If you can please point me to the appropriate/official link which can help me interfacing or you can suggest changes here.
Thanks in advance !
Br,
S
Do I need to define gpio4 somewhere else as well , or include some other file as well? Why it didnt give error for gpio0? btw am335x-bone-pinmux-spi0.dtsi is the correct file right where I have to make an entry for my slave device to be interfaced with spi0?
This is the h/w connection
(P9_Header Pin : GPIO controller) BBB <--------> Slave ST NFC Transceiver
(P9_17 : gpio0[5]) SPIO_CS0<---------------------> Slave-CS
(P9_21 : gpio0[3]) SPIO_D0<-----------------------> Slave-MISO
(P9_18) : gpio0[4]) SPIO_D1<----------------------> Slave-MOSI
(P9_22 : gpio0[2]) SPIO_SCLK<------------------> Slave-CLK
(P9_1 : gpio1[15]) GPIO_48<-----------------------> Slave-ENABLE(enable-gpio entry in the DT) ( to be configured as GPIO Output for slave wakeup from Host)
(P9_16 : gpio1[16]) GPIO_51<--------> Slave-IRQ (interrupt-parent entry in the DT) to be configured as GPIO Input for interrupt from slave)
for IRQ I am using Pin number 16 of P9 Header ( if this is not available I will use Pin number 23 of P9 header)
for ENABLE I am using Pin number 15 of P9 Header.
Hello @RobertCNelson,
While interacting with the driver using a test application(provided by nfc framework from linux) , I am getting this below error(dmesg) :
[ 655.775300] stnfc spi1.0: phy timeout error [ 655.779524] stnfc spi1.0: send receive of frame fail with -110
Do you have any idea could it be related to spi configuration or hardware wiring I
did?
I could see the driver loading and the entry in /sys/bus/spi/devices/spi1.0 , so i think we are right as far as the matter of hardware connection and device tree configuration .
lrwxrwxrwx 1 root gpio 0 Dec 20 06:17 driver -> …/…/…/…/…/…/…/bus/spi/drivers/stnfc
-r–r--r-- 1 root gpio 4096 Dec 20 06:17 modalias
drwxrwxr-x 3 root gpio 0 Dec 20 06:17 nfc
lrwxrwxrwx 1 root gpio 0 Dec 20 06:17 of_node -> …/…/…/…/…/…/…/firmware/devicetree/base/ocp/spi@48030000/stnfc@0
drwxrwxr-x 2 root gpio 0 Dec 20 06:17 power
drwxrwxr-x 2 root gpio 0 Dec 20 06:17 statistics
lrwxrwxrwx 1 root gpio 0 Dec 20 06:17 subsystem -> …/…/…/…/…/…/…/bus/spi
Correct, test all 4 cases of the possible enable-gpio and interrupt values… -110 means it wasn’t detected, so you have 1 of the 4 confirmed to be wrong…
Not really, but you should be able to test all 4 combinations in under 5-10 minutes. As id doesn’t require a full kernel build, just rebuild, install, boot and test…
Simple, while you “explicitly” told the pn54x driver to use them… You still need to configure the “pinmux” of the gpio into the proper mode. (in this case MUX_MODE7)… Otherwise those signals will not be actually routed to the pins on the SOC.
You only posted a small section, i’m betting gpio5_11/gpio5_12 are pre-configured as GPIO by default somewhere in the Device Tree for that other device…