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

Commissioning Joiner support for product line nrf52811

Hi, my question is about the commissioning of the thread protocol. Not so long ago I created an ish on the github of the thread project, but with software errors I was offered to write in the devzone
link to this issue: github.com/.../6222

I am trying to implement Openthread for a device on an Nrf52811 controller. I was warned about the lack of 192 kb of memory and the lack of an accelerator module. Nevertheless, the protocol does not take up much space, even a little is left for its software. And the acceleration can be transferred to the program.

I collected a thread as follows according to the instructions from their github
make -f examples / Makefile-nrf52811 JOINER = 1

Why did I start building from source? this is due to the fact that I do not find the otJoinerStart() function in the api thread, I decided to build and compile from resources. As a result of building and slipping libraries, I get errors when compiling GCC

What I've done

Compiled the libraries of the thread downloaded through the git and slipped them into the directory of the SDK Nordic
./openthread/output/nrf52811/lib (folder openthread from github) -> (to) ./external/openthread/lib/nrf52811/gcc (folder SDK Nordic v.4.0)

/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-alarm.o): in function nrf_rtc_event_pending': <PATH_TO_OPENTHREAD>/openthread/examples/../third_party/NordicSemiconductor/nrfx/hal/nrf_rtc.h:352: multiple definition of RTC1_IRQHandler'; _build/nrf52811_xxaa/drv_rtc.c.o:<PATH_TO_NORDICSDK>/v4.0/components/libraries/timer/drv_rtc.c:349: first defined here
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: _build/nrf52811_xxaa/main.c.o: in function joiner_timer_handler': <PATH_TO_OPENTHREAD>/Other/magnetic/pca10056/blank/armgcc/../../../main.c:370: undefined reference to otJoinerStart'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: _build/nrf52811_xxaa/thread_utils.c.o: in function platform_init': <PATH_TO_NORDICSDK>/v4.0/components/thread/utils/thread_utils.c:129: undefined reference to otHeapSetCAllocFree'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-system.o): in function otSysDeinit': <PATH_TO_OPENTHREAD>/openthread/examples/../examples/platforms/nrf528xx/src/system.c:122: undefined reference to nrf5TransportDeinit'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-system.o): in function otSysInit': <PATH_TO_OPENTHREAD>/openthread/examples/../examples/platforms/nrf528xx/src/system.c:101: undefined reference to nrf5TransportInit'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-system.o): in function otSysProcessDrivers': <PATH_TO_OPENTHREAD>/openthread/examples/../examples/platforms/nrf528xx/src/system.c:142: undefined reference to nrf5TransportProcess'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-flash_nosd.o): in function nrf5FlashPageErase': <PATH_TO_OPENTHREAD>/openthread/examples/../examples/platforms/nrf528xx/src/flash_nosd.c:36: undefined reference to nrfx_nvmc_page_erase'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: <PATH_TO_NORDICSDK>/v4.0/external/openthread/lib/nrf52811/gcc/libopenthread-nrf52811-sdk.a(libopenthread_nrf52811_sdk_a-flash_nosd.o): in function nrf5FlashWrite': <PATH_TO_OPENTHREAD>/openthread/examples/../examples/platforms/nrf528xx/src/flash_nosd.c:48: undefined reference to nrfx_nvmc_bytes_write'
collect2: error: ld returned 1 exit status

Parents
  • Hello,

    If you want to compile your own openthread libraries, you should use the same commit as the one used in the SDK. This commit is mentioned in:

    SDK\external\openthread\project\readme.txt

    After checking out the correct commit, it should be quite simple to follow the guide found on infocenter.

    That is for building and importing the built libraries. 

    I don't know any details on the size of what you are building, but perhaps you can elaborate if it doesn't work.

    Best regards,

    Edvin

  • Hi, thanks for the reply!

    I changed my tactics a bit using the manual https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.0.0%2Fthread_ot_libraries_building.html
    So what have I done so far
    1. I downloaded the repository of the thread that is specified in the readm from the github and placed it at 

    /compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/openthread


    2.removed unnecessary boards in the yaml file (import_libs_config.yaml)
    3. Added a line like (ASMFLAGS += -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 CFLAGS += -DOPENTHREAD_CONFIG_JOINER_ENABLE=1) to the projects for each makefile

    4.compiled with python script (build_gcc_libs.py)

    In my project in the makefile, I prescribed the paths where the new thread libraries are located:

    LIB_FILES += \
    $(SDK_ROOT)/external/openthread/project/nrf52811/openthread/mtd/armgcc/libopenthread-mtd-nrf52811.a \
    $(SDK_ROOT)/external/openthread/project/nrf52811/openthread_platform_utils/armgcc/libopenthread-platform-utils-nrf52811.a \
    $(SDK_ROOT)/external/openthread/project/nrf52811/mbedcrypto/cc310/armgcc/libmbedcrypto-nrf52811.a \
    $(SDK_ROOT)/external/openthread/project/nrf52811/openthread_nrf52811/sdk/spi/armgcc/libopenthread-nrf52811-sdk-spi.a \
    $(SDK_ROOT)/external/openthread/project/nrf52811/nordicsemi_nrf52811/driver/armgcc/libnordicsemi-nrf52811-radio-driver.a \
    $(SDK_ROOT)/external/openthread/project/nrf52811/openthread_platform_utils/armgcc/libopenthread-platform-utils-nrf52811.a \

    I get the following errors yet it is not clear how to be with them can you tell?

    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/libopenthread-mtd-nrf52811.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::FreeMbedtls()':
    ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:113: undefined reference to `mbedtls_ssl_cookie_free'
    
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/libopenthread-mtd-nrf52811.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::SetClientId(unsigned char const*, unsigned char)':
    ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:526: undefined reference to `mbedtls_ssl_set_client_transport_id'
    
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/libopenthread-mtd-nrf52811.a(dtls.cpp.o): in function `ot::MeshCoP::Dtls::Setup(bool)':
    ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:293: undefined reference to `mbedtls_ssl_cookie_init'
    
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:295: undefined reference to `mbedtls_ssl_cookie_setup'
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:298: undefined reference to `mbedtls_ssl_conf_dtls_cookies'
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:249: undefined reference to `mbedtls_ssl_cookie_check'
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread/mtd/armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:249: undefined reference to `mbedtls_ssl_cookie_write'
    /usr/local/Cellar/arm-none-eabi-gcc/9-2019-q4-major/gcc/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread_nrf52811/sdk/spi/armgcc/libopenthread-nrf52811-sdk-spi.a(spi-slave.c.o): in function `otPlatSpiSlaveDisable':
    
    ../compile/nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b/external/openthread/project/nrf52811/openthread_nrf52811/sdk/spi/armgcc/../../../../../openthread/examples/platforms/nrf528xx/src/spi-slave.c:166: undefined reference to `nrfx_spis_uninit'

  • I am not sure what happened here, or whether or not you should have "removed unnecessary boards in the yaml file". Did you remove too much?

    Did it look like all the builds ran successfully when you ran the build_gcc_libs.py? And have you tried running the import_libs.py with the parameter gcc:

    "import_libs.py gcc"?

    BR,
    Edvin

Reply Children
Related