Openthread Optimised Library & Build Size

Our product under development has tight flash requirements. As such, any optimisation to the build size of the product has a great affect on further development, therefore, we are investigating reducing our flash size by using the optimised FTD provided by the NRF5 SDK for Thread & Zigbee.

When using the optimised FTD compared against building Openthread from the source with the same switches on Reference 20200818, the provided library is ~5kb larger in build size on our stack.

Is this expected?

Are there any other optimisations that can be done within the NRF5 SDK to reduce build size?

  • Hi Hamish,

    Due to the fixed stack size provided by the OpenThread project, there is limited optimization that can be done. We have specific pages introducing the memory requirements. You may need to consider external flash if necessary.

    NRF5 SDK OpenThread memory layout and requirements

    OpenThread memory requirements — nRF Connect SDK 1.9.1 documentation (nordicsemi.com)

    When using the optimised FTD compared against building Openthread from the source with the same switches on Reference 20200818, the provided library is ~5kb larger in build size on our stack.

    Is this expected?

    Hard to explain the reason based on the current information you shared, could you explain more details about your comparation?

    Just a reminder for your development. I am not sure if you have learned (+) nRF Connect SDK and nRF5 SDK statement - Blogs - Nordic Blog - Nordic DevZone (nordicsemi.com), We encourage developers to use NCS for the new projects. NCS will have Thread 1.3 support in the coming release.

    Best regard,

    Charle

  • Hi Charlie,

    Thank you for answering the question in regards to further optimisations, I thought it might be a long shot. I am aware of the connect SDK, and we will be using this for future development, however, we are currently locked into the legacy support for this particular device. 

    The comparison is done by taking the ELF file generated using the pre-compiled library, and looking at the symbol namespace for the openthread library. For example, when using the pre-compiled optimised FTD library, the ot::commissioner:: namespace exists, something which described by the NRF5 SDK for Thread & Zigbee 4.2 should be turned off. When compiling directly on thread reference 20200818 (The reference I assume to be used by SDK gathered from other questions on this forum), the commissioner namespace does not exist (Other namespaces exist which I wouldn't expect, commissioner was just used for the example).

    The Optimised FTD is imported using the following CMake:

        PUBLIC libopenthread-ftd-optimized-ftd.a
        PUBLIC libopenthread-platform-utils-optimized-ftd.a
        PUBLIC libopenthread-nrf52840-softdevice-sdk-nodiag.a
        PUBLIC libopenthread-nrf52840-transport.a
        PUBLIC libnordicsemi-nrf52840-radio-driver-softdevice.a

  • Hi Hamish,

    I check with our developer and found we use (OT commit "c6a258e3a5bd90aa26d8245c435c0ae5797027f4")" for nRF5 SDK 4.1.2 for T&Z, and nRF5 SDK 4.2 has no update on Thread part, so it is also use (OT commit "c6a258e3a5bd90aa26d8245c435c0ae5797027f4"), can you try with this version?

    Best regards,

    Charlie

Related