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

ble_thread_dyn_mtd_coap_cli_pca10056_s140 with 2 UARTES

Hello

I would like to use both UARTES in the exemple "ble_thread_dyn_mtd_coap_cli_pca10056_s140". 

I tried to adapt this example using the example "nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b \ examples \ peripheral \ serial_uartes" but I have link problems with libraries that are in common between my program and the SoftDevice ...

How can I fix it?


Thank you

Parents
  • Hi,

    The OpenThread libraries are by default built with support for UART (for NCP and CLI). If you want to use UART0 for another purpose, you need to build the libraries without UART. These steps should work:

    1. Start with a fresh copy of the SDK, and make sure you place it as close to the ROOT of the hard drive as possible.
    2. Modify the file in external\openthread\project\nrf52840\openthread_nrf52840\softdevice\uart\armgcc\Makefile and comment out/remove all lines involving UART:
      1. #  $(PROJ_DIR)/../openthread/examples/platforms/nrf528xx/src/uart.c \
      2. #CFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1
      3. #CFLAGS += -DUART_AS_SERIAL_TRANSPORT=1
      4. #ASMFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1
      5. #ASMFLAGS += -DUART_AS_SERIAL_TRANSPORT=1
    3. Open command line and go to [nRF5 SDK for Thread and Zigbee v4.0.0 ROOT]\external\openthread\project.
    4. Enter the following commands:
      git clone https://github.com/openthread/openthread.git
      cd openthread
      git checkout 8a1992e2e42fb707babe9491a6a1456e553490e8
      cd ..
      make -C nrf52840\openthread_nrf52840\softdevice\uart\armgcc
    5. Open the SES project. Under directory 'OpenThread' in the project browser, remove the file named 'libopenthread-nrf52840-softdevice-sdk.a'.
    6. Add the file external\openthread\project\nrf52840\openthread_nrf52840\softdevice\uart\armgcc\libopenthread-nrf52840-softdevice-sdk.a to the project.
    7. Remove the following preprocessor symbols in the SES project settings:
      1. CFLAGS += -DNRFX_PRS_ENABLED=0
      2. CFLAGS += -DUART0_ENABLED=0
      3. CFLAGS += -DUART1_ENABLED=1

    Best regards,
    Jørgen

  • The error seems to come from the file you should remove in step 5. Did you remove it and add the newly built file?

  • You are right: because the file 'libopenthread-nrf52840-softdevice-sdk.a' was not present and the file "libopenthread-nrf52840-softdevice-sdk.a" was already present, I had not deleted it. 

    I replace the file and it compiles now :)

    To do as in the example "examples \ peripheral \ serial_uartes", I added the files "nrf_drv_power.c" and "nrfx_power.c". But I think that there are a problem with these files. 
    When I run my new project (ble_trhead_dyn_mtd_coap_cli_pca10056_s140 with my modifications for having 2 UARTES), I have this error :

    I haven't problem if I "exclude from build" the files  "nrf_drv_power.c" and "nrfx_power.c" (but these files are necessary for the UARTES) and I comment my function uart_init() :

    Here are my definitions:



    Do you have any idea why I have this problem?

Reply
  • You are right: because the file 'libopenthread-nrf52840-softdevice-sdk.a' was not present and the file "libopenthread-nrf52840-softdevice-sdk.a" was already present, I had not deleted it. 

    I replace the file and it compiles now :)

    To do as in the example "examples \ peripheral \ serial_uartes", I added the files "nrf_drv_power.c" and "nrfx_power.c". But I think that there are a problem with these files. 
    When I run my new project (ble_trhead_dyn_mtd_coap_cli_pca10056_s140 with my modifications for having 2 UARTES), I have this error :

    I haven't problem if I "exclude from build" the files  "nrf_drv_power.c" and "nrfx_power.c" (but these files are necessary for the UARTES) and I comment my function uart_init() :

    Here are my definitions:



    Do you have any idea why I have this problem?

Children
Related