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 Children
  • Ok, now i am having trouble to build the libraries

    C:\Users\User\Documents\nRF5_SDK_for_Thread_and_Zigbee_v4.0.0\external\openthread\project>py build_gcc_libs.py
    Compiling file: cli.cpp
    make: se ingresa al directorio `C:/Users/User/Documents/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0/external/openthread/project/nrf52840/openthread_cli/ftd/armgcc'
    "'C:" no se reconoce como un comando interno o externo,
    programa o archivo por lotes ejecutable.
    make: *** [_build/libopenthread_cli_ftd_nrf52840/cli.cpp.o] Error 1
    make: se sale del directorio `C:/Users/User/Documents/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0/external/openthread/project/nrf52840/openthread_cli/ftd/armgcc'
    Traceback (most recent call last):
      File "build_gcc_libs.py", line 28, in <module>
        subprocess.run(make_cmd, check=True)
      File "C:\Users\User\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 512, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['make', '-C', 'nrf52840\\openthread_cli/ftd\\armgcc']' returned non-zero exit status 2.

  • Did you checkout the correct commit after cloning the OpenThread repository? If you try to build master, the project files in the SDK may not include all the required paths and source files.

    The commit used by the SDK is indicated in the project readme-file: external\openthread\project\readme.txt

  • I checked the commit version and still have the same problem

  • I'm not speaking Spanish, but from what I can see from Google translate it looks like an issue with the paths. Can you try to move the SDK closer to the root of the drive? I have sometimes seen issues when the paths get too long.

  • I was able to compile the libraries:


    - I move the SDK closer to the root of the drive
    - I move the compiler binaries closer to the root of the drive
    - Remove the quotes for the # Toolchain commands in the file Makefile.common

    Compiled the example successfully but the NCP crashes a few seconds after being running.

    pi@raspberrypi:~ $ sudo wpantund
    wpantund[2439]: Starting wpantund 0.08.00d (Dec 13 2019 21:37:34) . . .
    wpantund[2439]: Configuration file "/etc/wpantund.conf" read.
    wpantund[2440]: About to exec "/usr/bin/spi-hdlc-adapter -i /sys/class/gpio/gpio24 /dev/spidev0.1"
    spi-hdlc-adapter[2440]: spi-hdlc-adapter 0.07 (21:37:34 Dec 13 2019)
    wpantund[2439]: Ready. Using DBUS bus ":1.63"
    wpantund[2439]: Running as root without dropping privileges!
    wpantund[2439]: State change: "uninitialized" -> "offline"
    wpantund[2439]: NCP is running "OPENTHREAD/20180926-01143-g8a1992e2; NRF52840; Mar 16 2020 17:35:06"
    wpantund[2439]: Driver is running "0.08.00d (; Dec 13 2019 21:37:34)"
    wpantund[2439]: Network is not joinable
    wpantund[2439]: State change: "offline" -> "offline:commissioned"
    wpantund[2439]: [-NCP-]: SLAAC enabled
    wpantund[2439]: Finished initializing NCP
    wpantund[2439]: AutoResume is enabled. Trying to resume.
    wpantund[2439]: NCP is commissioned. Resuming...
    wpantund[2439]: State change: "offline:commissioned" -> "associating"
    wpantund[2439]: State change: "associating" -> "associated"
    wpantund[2439]: Node type change: "unknown" -> "leader"
    wpantund[2439]: Adding on-mesh prefix "fd11:22::/64" to NCP
    wpantund[2439]: SpinelNCPTask.cpp:86: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
    wpantund[2439]: SpinelNCPTaskSendCommand.cpp:323: Requirement Failed ((mRetVal == kWPANTUNDStatus_Ok) || (mRetVal == kWPANTUNDStatus_Busy))
    wpantund[2439]: SendCommand task encountered an error: 7 (0x00000007)
    wpantund[2439]: SpinelNCPTask.cpp:86: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
    wpantund[2439]: SpinelNCPTaskSendCommand.cpp:381: Check Failed (error 7)
    wpantund[2439]: Error Timeout (7) while performing "adding on-mesh prefix" on NCP - Resetting NCP.

    Caught SIGHUP!

Related