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

Re-building OpenThread Libraries - Thread SDK4.0.0 - missing libopenthread-cli-ftd.a and libopenthread-cli-mtd.a

When I carefully follow the instructions at https://infocenter.nordicsemi.com/topic/sdk_tz_v4.0.0/thread_ot_libraries_building.html , I am missing some of the openthread libraries that originally shipped with Thread SDK 4.0.0.  Specifically, the files libopenthread-cli-ftd.a and libopenthread-cli-mtd.a are not generated.

Environment: Ubuntu 16.04 LTS version on Windows10

Steps to reproduce:

  1. Sudo apt-get update
  2. Sudo apt-get upgrade
  3. mkdir ot
  4. cd ot
  5. git clone https://github.com/openthread/openthread.git
  6. cd openthread
  7. git checkout 8a1992e2e42fb707babe9491a6a1456e553490e8
  8. ./bootstrap

  9. make -f examples/Makefile-nrf52840 BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DISABLE_BUILTIN_MBEDTLS=1 DNS_CLIENT=1 DIAGNOSTIC=1 EXTERNAL_HEAP=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_FORWARD=1 ECDSA=1 SNTP_CLIENT=1 COAPS=1 DHCP6_SERVER=1 DHCP6_CLIENT=1
  10. cd output/nrf52840/lib
  11. notice that files libopenthread-cli-ftd.a and libopenthread-cli-mtd.a are not present

Please clarify the exact steps Nordic uses in building and copying the compiled OpenThread libraries and other files to the SDK folders.

Also, as previously reported, Step 5 of the instructions (link above) "Because the SDK provides libraries with USB CDC, UART, and SPI support, rename the following USB and SPI libraries:" remains very confusing.  I need a reliable process to build all of the OpenThread files that may be required by any of the Nordic Thread/Multiprotocol examples.

Thanks,

Rob

  • My error.  When running a fresh build as described above, the files are generated. 

    I made the mistake of running a "make -f examples/Makefile-nrf52840 .... with the NCP_SPI=1 flag set first (which inhibits the CLI).  I failed to issue a "make -f examples/Makefile-nrf52840 clean" before making the UART or USB variants (which DO include the CLI).

    So I understand the corrected script (rebuilding SDK4.0.0 for GCC or SES without modification), in linux, is as follows:

    1. sudo apt-get update
    2. sudo apt-get upgrade
    3. mkdir ot
    4. cd ot
    5. git clone https://github.com/openthread/openthread.git
    6. cd openthread
    7. git checkout 8a1992e2e42fb707babe9491a6a1456e553490e8
    8. ./bootstrap
    9. make -f examples/Makefile-nrf52840 clean
    10. make -f examples/Makefile-nrf52840 BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DISABLE_BUILTIN_MBEDTLS=1 DNS_CLIENT=1 DIAGNOSTIC=1 EXTERNAL_HEAP=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_FORWARD=1 ECDSA=1 SNTP_CLIENT=1 COAPS=1 DHCP6_SERVER=1 DHCP6_CLIENT=1 NCP_SPI=1
    11. rename and copy the five SPI files from /output/ and stash them in a safe location so they don't get cleaned up:
      old name new name
      libopenthread-ncp-ftd.a libopenthread-ncp-ftd-spi.a
      libopenthread-ncp-mtd.a libopenthread-ncp-mtd-spi.a
      libopenthread-rcp.a libopenthread-rcp-spi.a
      libopenthread-nrf52840-sdk.a libopenthread-nrf52840-sdk-spi.a
      libopenthread-nrf52840-softdevice-sdk.a libopenthread-nrf52840-softdevice-sdk-spi.a
      libopenthread-nrf52811-sdk.a libopenthread-nrf52811-sdk-spi.a
    12. make -f examples/Makefile-nrf52840 clean
    13. make -f examples/Makefile-nrf52840 BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DISABLE_BUILTIN_MBEDTLS=1 DNS_CLIENT=1 DIAGNOSTIC=1 EXTERNAL_HEAP=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_FORWARD=1 ECDSA=1 SNTP_CLIENT=1 COAPS=1 DHCP6_SERVER=1 DHCP6_CLIENT=1 USB=1
    14. rename and copy the two USB files from /output/ and stash them in a safe location so they don't get cleaned up:
      old name new name
      libopenthread-nrf52840-sdk.a libopenthread-nrf52840-sdk-usb.a
      libopenthread-nrf52840-softdevice-sdk.a libopenthread-nrf52840-sdk-softdevice-usb.a
    15. make -f examples/Makefile-nrf52840 clean
    16. make -f examples/Makefile-nrf52840 BORDER_AGENT=1 BORDER_ROUTER=1 COAP=1 COMMISSIONER=1 DISABLE_BUILTIN_MBEDTLS=1 DNS_CLIENT=1 DIAGNOSTIC=1 EXTERNAL_HEAP=1 JOINER=1 LINK_RAW=1 MAC_FILTER=1 MTD_NETDIAG=1 SERVICE=1 UDP_FORWARD=1 ECDSA=1 SNTP_CLIENT=1 COAPS=1 DHCP6_SERVER=1 DHCP6_CLIENT=1
    17. Copy the UART set of libraries from <OpenThreadFolder>/output/<target>/lib to the SDK folder: /external/openthread/lib/<target>gcc.
    18. Copy the unique SPI and USB libraries from wherever you stashed them to the SDK folder: /external/openthread/lib/<target>gcc.
    19. Copy the <OpenThreadFolder>/include folder to the /external/openthread folder.
    20. Copy the platform specific platform-fem.h and platform-softdevice.h files from /external/project/openthread/examples/platforms/nrf528xx/src to the /external/openthread/include/platform folder.
    21. Copy openthread-system.h file from /external/project/openthread/examples/platforms to the /external/openthread/include/platform folder.

    Please confirm I haven't missed anything or if there is a more efficient way to achieve the same result.

    Thanks,
    Rob

  • Hi Rob,

    The solution you proposed looks correct.

    I do not think it is possible to build it in a more efficient way, as the libraries can only be built with one transport defined at a time.

    Best regards,
    Jørgen

Related