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

libopenthread-nrf52840-sdk is reserving a SPI instance

Hello,

I cannot add SPI0 to my application because OpenThread library was built with it without any interest of that. Could you fix it please ? (I need the 3 SPI peripherals)

Linking target: _build/nrf52840_xxaa.out
../../../../../10_Tools/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/external/openthread/lib/gcc/libopenthread-nrf52840-sdk.a(libopenthread_nrf52840_sdk_a-spi-slave.o): In function `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler':
/build/KNGP-TOLL1-JOB1/openthread/examples/../examples/platforms/nrf52840/spi-slave.c:191: multiple definition of `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler'
_build/nrf52840_xxaa/nrfx_spim.c.o:F:\Git\Leolab\Projects\Clairvoyant\6_Sources\ble_thread_swi_template\pca10056\s140\armgcc/../../../../../10_Tools/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/modules/nrfx/drivers/src/nrfx_spim.c:676: first defined here
collect2.exe: error: ld returned 1 exit status
../../../../../10_Tools/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/components/toolchain/gcc/Makefile.common:292: recipe for target '_build/nrf52840_xxaa.out' failed
mingw32-make: *** [_build/nrf52840_xxaa.out] Error 1

Parents
  • Hello,

    Please see this documentation:
    https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Thread_SDK/v2-0-0/thread_intro

    From one of the "Note" sections:

    "The above hardware resources are reserved for the OpenThread libraries delivered with this SDK. However, you can specify other instances of some peripherals such as Timers, PPIs, SWI, or UART and rebuild libraries. Refer to platform-config.h and nrf_802154_config.h to see the current configuration. You can also disable support for SPI by adding the DISABLE_SPI=1parameter."

    So you need to add this define (DISABLE_SPI=1);

    and build openthread again.

    If you want to make sure that the examples still work, please build using the same version of OpenThread that is used for creating the SDK. From another "Note" section

    "OpenThread is still in prerelease phase and its API changes frequently. Keep in mind that when the API changes, the examples might not compile with the latest OpenThread version right away without fixes."

    The version used to build the SDK is found in nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac\external\openthread\project\readme.txt:

    "OpenThread libraries projects are based on the following commit of OpenThread: 704511c96e0d093139e4b80ef0739ed2d701afb1".

    So if you build this version without the SPI, you should be able to use SPI0 as well.

    Best regards,

    Edvin

  • If you look at theses outputs. Exemples were integrated in the library so it will be better to fix it in Nordic distribution.

    ../../../../../10_Tools/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/external/openthread/lib/gcc/libopenthread-nrf52840-softdevice-sdk.a(libopenthread_nrf52840_softdevice_sdk_a-spi-slave.o): In function `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler':

    /build/KNGP-TOLL1-JOB1/openthread/examples/../examples/platforms/nrf52840/spi-slave.c:191: multiple definition of `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler'

Reply
  • If you look at theses outputs. Exemples were integrated in the library so it will be better to fix it in Nordic distribution.

    ../../../../../10_Tools/nRF5_SDK_for_Thread_and_Zigbee_2.0.0_29775ac/external/openthread/lib/gcc/libopenthread-nrf52840-softdevice-sdk.a(libopenthread_nrf52840_softdevice_sdk_a-spi-slave.o): In function `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler':

    /build/KNGP-TOLL1-JOB1/openthread/examples/../examples/platforms/nrf52840/spi-slave.c:191: multiple definition of `SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler'

Children
Related