This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread NCP SPI pin configuration

I can not find where to change the default pins to connect the nrf52840 to the rpi over SPI.

The default pins are

SPI pin     Raspberry Pi pin     nRF52833, nRF52840 or nRF52811 pin
MOSI     pin 19 (GPIO10)     P0.04
MISO     pin 21 (GPIO09)     P0.28
SCK     pin 23 (GPIO11)     P0.03
CSN     pin 26 (GPIO07)     P0.29
INT     pin 40 (GPIO21)     P0.30

In the infocenter sais "The SPI pins on the Development Kit (nRF52833, nRF52840 or nRF52811) can be configured when building the example. " but i can not find where are they configured.

Please help

Parents Reply
  • I figured that you need also to set the SPI_INT_GPIO_PIN in wpantund init config script found in /etc/init.d/wpantund for the GPIO to be initialized correctly. Did you modify this as well, or only the /etc/wpantund.conf file? I tested with GPIO20, and this seems to work correctly. Note that some GPIOs may collide with the NFC shield used by the MeshCop example for commissioning. From the schematics of the shield, it can look like GPIO25 is used for switching between SPI and I2C mode. 

    gpio25 is also listed in /sys/class/gpio, which may indicate that it is used by another module. I can't find any references to this the BR image, but a grep tells me that it found a match for "/sys/class/gpio/export" inside a few binary files:

    pi@raspberrypi:~ $ grep -r "/sys/class/gpio/export" / 2> /dev/null
    Binary file /proc/11933/task/11933/cmdline matches
    Binary file /proc/11933/cmdline matches
    /etc/init.d/wpantund:        echo "$SPI_INT_GPIO_PIN" > /sys/class/gpio/export
    Binary file /usr/sbin/nfccommissiond matches
    Binary file /usr/sbin/MQTT-SNGateway matches
    Binary file /usr/sbin/MQTT-SNLogmonitor matches
    Binary file /usr/lib/python2.7/dist-packages/RPi/_GPIO.arm-linux-gnueabihf.so matches
    

Children
Related