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

Thread SDK hardcodes UART pins

From what I can tell, the SDK for Thread provided from Nordic uses a precompiled Openthread library that hardcodes the UART pin configuration. This means that users of this SDK must modify and recompile the library manually if they want to use the Thread SDK on their own boards with different pin configurations. The Openthread library is meant to compile as a platform independent binary, and the Nordic supplied SDK should include the specific lower layer code separately. This along with an application/board specific sdk-config.h file would allow the required flexibility.

Are there any plans to support this?

Thanks!

  • Hello,

    It looks like you are correct. Please let me check with the guys working on our OpenThread solution, and I will let you know. For all I know they are already planning to do this. "Our" OpenThread (the one used in the Thread SDK) library is still in the development stage.

     

    I will forward your feedback, and I will get back to you!

     

    Best regards,

    Edvin

     

  • Ok that sounds great thanks!

    As an example of where this can be problematic, I'm trying to build an Openthread application that uses UART1 for printf functionality, since UART0 is already used in the Openthread code that's compiled within the library. I get a linker error as follows:

    ../../make/../sdk/nrf5_sdk_15.0.0_thread/external/openthread/lib/gcc/libopenthread-nrf52840-sdk.a(libopenthread_nrf52840_sdk_a-uart.o): In function `UARTE0_UART0_IRQHandler':
    /build/KNG-OL-JOB1/openthread/examples/../examples/platforms/nrf52840/uart.c:273: multiple definition of `UARTE0_UART0_IRQHandler'
    _build/nrfx_prs.o:nrfx_prs.c:(.text.UARTE0_UART0_IRQHandler+0x0): first defined here
    collect2: error: ld returned 1 exit status
    ../../make/Makefile:675: recipe for target '_build/thread_hello_world_blank.hex' failed
    make: *** [_build/thread_hello_world_blank.hex] Error 1

    I am almost certain I've set up my sdk_config.h correctly. I've disabled UART0, UARTE0, and ensured nrf_drv_uart and app_uart use UART1. Here is my sdk_config.h just in case I missed a define or two and someone is willing to look it over. I'm having a very hard time tracing down where UARTE0_UART0_IRQHandler is defined within all the platform/device macros. I don't see where it would be defined in nrfx_prs.c.

  • Is there any update on this? I can't even get an app that uses I2C/TWI to compile with the OpenThread binary, since the SPI component already defines the 'SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler'. While I could do without UART, I need TWI/SPI to interface with sensors on my system.

    Is there at least a workaround that will allow my compilation to override the handler defined in the library?

  • Hello,

    I have asked our Thread team. Their explanation is that the solution was built on old peripheral drivers, but the plan is to port it to the new nrfx drivers, to make it easier to configure. Unfortunately, we (both in customer support and the thread team) is quite short staffed during the summer,  due to vacation season. They will look into this as soon as they can.

     

    Regarding the SPI, they gave a short answer:

    "When it comes to the second problem with SPI, there is a simple solution. He needs to build the OpenThread library with DISABLE_SPI=1 flag.

    The instruction is here:
    http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.thread_zigbee.v1.0.0%2Fthread_intro.html&cp=4_2_0_1_0_4&anchor=thread_qsg_libraries

    To keep full compatibility with the released SDK, customer would need to use the same OpenThread commit as it is in our release notes. 

    The full command is:

    $ make -f examples/Makefile-nrf52840 COMMISSIONER=1 JOINER=1 COAP=1 DNS_CLIENT=1 MTD_NETIAG=1 BORDER_ROUTER=1 MAC_FILTER=1 TMF_PROXY=1 DISABLE_SPI=1

    I verified using GCC."

     

    So you can try this to get the SPI working.

     

    Best regards,

    Edvin

     

Related