This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Generate NCP firmware for UART with UART pins modified

I am using Nordic's NRF_SDK_For_Thread_and_Zigbee_4.1.0.

In that example/thread/ncp, I want to build NCP firmware for uart.

Original uart pins for rx and tx are 8 and 6.

While I want to build that firmware for pins 26 and 6.

UART Rx is 26 and Uart Tx is 4.

So where I should update these pins so that my custom nordic module, that has uart Rx on 26 and Tx on 4, can be interfaced with my custom gateway board, which I use as border router.

Also, should I add some Pullup or Pulldown to Rx pin in the NCP's main code?

nrf_gpio_cfg_input(0x1A, NRF_GPIO_PIN_PULLUP);
Parents
  • I have generated a new image for NCP from the latest openthread directory, i.e., "ot-nrf528xx".

    I have followed the steps provided on https://github.com/openthread/ot-nrf528xx/blob/main/src/nrf52840/README.md .

    Also, I have made the following changes in the transport-config.h file at ot-nrf528xx/src/nrf52840:

    1. 

    #ifndef UART_PIN_TX
    #define UART_PIN_TX 4
    #endif

    2.
    #ifndef UART_PIN_RX
    #define UART_PIN_RX 26
    #endif

    3.
    #ifndef UART_HWFC_ENABLED
    #define UART_HWFC_ENABLED 0
    #endif

     

    I have changed TX, RX pin numbers as per my custom hardware. and disabled HWFC  and generated the new image.

    On flashing that image I am able to communicate with the border router but the NCP state is constantly "offline".

    Can you help me in debugging this issue? What is causing the NCP state in offline mode?

    I have checked everything on my side but couldn't find any reasonable solution.

  • Hello Bhumika,

    As I mentioned above, you have to use the same OpenThread commit as was used in the nRF5 SDK for the T&Z release.

    The ot-nrf528xx repository was created just recently and is not compatible with nRF5 SDK for T&Z.

    So please just clone OT repo, checkout to the c6a258e3a5bd90aa26d8245c435c0ae5797027f4 commit and generate libraries according to the documentation.

    I would then recommend checking with default UART pins that all works correctly and only then configure the pins and regenerate libraries one more time.

    Please let me know about the progress.


  • Thanks for clarifying my doubt.

    I have done this and the NCP image is working now. 

    But that open thread commit is more than a year old.

    Since then, there are multiple improvements in openthread repository, and I want to port my current application on the latest openthread commit.

    Kindly guide me through the process for the same.

    Bcoz when I applied the process mentioned https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fthread_ot_libraries_building.html&cp=8_3_2_1_4 , my application won't compile. 

    there are many API related error like below:

    ../../../../../nrf_sdk_thread/components/thread/utils/thread_utils.c: In function 'platform_init':
    ../../../../../nrf_sdk_thread/components/thread/utils/thread_utils.c:129:5: error: implicit declaration of function 'otHeapSetCAllocFree'; did you mean 'otHeapCAlloc'? [-Werror=implicit-function-declaration]
         otHeapSetCAllocFree(ot_calloc, ot_free);
         ^~~~~~~~~~~~~~~~~~~
         otHeapCAlloc
    ../../../../../nrf_sdk_thread/components/thread/utils/thread_utils.c: In function 'thread_cli_init':
    ../../../../../nrf_sdk_thread/components/thread/utils/thread_utils.c:258:5: error: implicit declaration of function 'otCliUartInit'; did you mean 'otCliInit'? [-Werror=implicit-function-declaration]
         otCliUartInit(mp_ot_instance);
         ^~~~~~~~~~~~~
    

    How to port my current application on the latest openthread stack or nrf connect SDK ?

  • If you need the newest OpenThread version, I would strongly recommend trying to port your application to nRF Connect SDK. The nRF5 SDK for T&Z is currently maintained but, will not be released with new features.

    In nRF Connect SDK you can also use the OT API directly, but there is no migration guidelines, as our new SDK is completely different from the previous one.

    You can check the following webinar: https://webinars.nordicsemi.com/developing-thread-products-with-nrf-1

    If you are new to Zephyr and nRF Connect SDK itself, you will find many more interesting videos there as well.

Reply Children
No Data
Related