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

How to combine the ble_app_uart with libuartes example ?

Hi,
I have a project that is comunication between nRF and Smartphone via BLE and using libuartes to comunicate with 2 another devices via 2Uarts.
Now I need to combine 2 examples into 1 project. How many stepI have to do ?
I have compared 2 sdk_config.h of 2  examples. there are some differences in 2 sdk_config.h. I think just merge them into one file

What about another files? What I need to combine them and work in 1 project step by step? 
Hope your reply soon. Thank you 
Best regard,

  • 51804.sdk_config.h
    Here is my sdk_config.h
    I have enabled NRFX_TIMER1 and not found NRF_TIMER1 problem was not solved.
    devzone.nordicsemi.com/.../app_util-h-118-41-error-static-assertion-failed-unspecified-message
    I follow this thread but It doesn't work
    ble_libuarte.rar
    Here is all my project

  • Sorry, I meant TIMER1_ENABLED, not NRF_TIMER1_ENABLED.

    I see that TIMER1_ENABLED is set to 0. Try to set it to 1. And set TIMER_ENABLED to 1 as well. So change these on line 5443 and 5379, respectively.

    Try this first, and let me know if it doesn't work.

  • Hi Edvin,
    Above errors disappeared ^^

    But I got  new errors like this

    Building ‘ble_app_uart_pca10056_s140’ from solution ‘ble_app_uart_pca10056_s140’ in configuration ‘Debug’
    3> Compiling ‘nrf_log_backend_rtt.c’
    4> Compiling ‘nrf_log_backend_serial.c’
    5> Compiling ‘nrf_log_default_backends.c’
    6> Compiling ‘nrf_log_frontend.c’
    7> Compiling ‘nrf_log_str_formatter.c’
    8> Compiling ‘app_button.c’
    2> Compiling ‘app_error_handler_gcc.c’
    1> Compiling ‘app_error_weak.c’
    1> Compiling ‘app_fifo.c’
    4> Compiling ‘app_scheduler.c’
    5> Compiling ‘app_timer2.c’
    6> Compiling ‘app_uart_fifo.c’
    7> Compiling ‘drv_rtc.c’
    2> Compiling ‘hardfault_implementation.c’
    3> Compiling ‘nrf_atfifo.c’
    8> Compiling ‘nrf_atflags.c’
    3> Compiling ‘nrf_atomic.c’
    2> Compiling ‘nrf_balloc.c’
    1> Compiling ‘nrf_fprintf.c’
    5> Compiling ‘nrf_fprintf_format.c’
    4> Compiling ‘nrf_memobj.c’
    6> Compiling ‘nrf_pwr_mgmt.c’
    7> Compiling ‘nrf_ringbuf.c’
    8> Compiling ‘nrf_section_iter.c’
    5> Compiling ‘nrf_sortlist.c’
    3> Compiling ‘nrf_strerror.c’
    2> Compiling ‘retarget.c’
    1> Compiling ‘nrf_libuarte_async.c’
    8> Compiling ‘nrf_libuarte_drv.c’
    4> Compiling ‘nrf_queue.c’
    7> Compiling ‘boards.c’
    6> Compiling ‘nrf_drv_clock.c’
    5> Compiling ‘nrf_drv_uart.c’
    3> Compiling ‘nrfx_atomic.c’
    2> Compiling ‘nrfx_clock.c’
    7> Compiling ‘nrfx_gpiote.c’
    1> Compiling ‘nrfx_prs.c’
    4> Compiling ‘nrfx_uart.c’
    8> Compiling ‘nrfx_uarte.c’
    6> Compiling ‘nrfx_ppi.c’
    5> Compiling ‘nrfx_rtc.c’
    3> Compiling ‘nrfx_timer.c’
    7> Compiling ‘bsp.c’
    2> Compiling ‘bsp_btn_ble.c’
    5> Compiling ‘main.c’
    1> Compiling ‘SEGGER_RTT.c’
    3> Compiling ‘SEGGER_RTT_Syscalls_SES.c’
    4> Compiling ‘SEGGER_RTT_printf.c’
    6> Compiling ‘ble_advdata.c’
    7> Compiling ‘ble_advertising.c’
    8> Compiling ‘ble_conn_params.c’
    3> Compiling ‘ble_conn_state.c’
    2> Compiling ‘ble_link_ctx_manager.c’
    4> Compiling ‘nrf_ble_gatt.c’
    8> Compiling ‘nrf_ble_qwr.c’
    1> Compiling ‘ble_nus.c’
    6> Compiling ‘nrf_sdh.c’
    7> Compiling ‘nrf_sdh_ble.c’
    5> Compiling ‘nrf_sdh_soc.c’
    1> Linking ble_app_uart_pca10056_s140.elf
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_async.o: in function `nrf_libuarte_async_init':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:480: undefined reference to `nrfx_ppi_channel_alloc'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:489: undefined reference to `nrfx_ppi_channel_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:489: undefined reference to `nrfx_ppi_channel_fork_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:494: undefined reference to `nrfx_ppi_channel_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:494: undefined reference to `nrfx_ppi_channel_fork_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_async.o: in function `nrf_libuarte_async_enable':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:597: undefined reference to `nrfx_ppi_channel_enable'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_async.c:599: undefined reference to `nrfx_ppi_channel_enable'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `nrfx_ppi_channel_include_in_group':
    1> c:\nrf_sdk\modules\nrfx\drivers\include/nrfx_ppi.h:219: undefined reference to `nrfx_ppi_channels_include_in_group'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_channel_configure':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:117: undefined reference to `nrfx_ppi_channel_alloc'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:123: undefined reference to `nrfx_ppi_channel_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:131: undefined reference to `nrfx_ppi_channel_fork_assign'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_group_configure':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:147: undefined reference to `nrfx_ppi_group_alloc'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:161: undefined reference to `nrfx_ppi_group_enable'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_ch_free':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:178: undefined reference to `nrfx_ppi_channel_disable'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:180: undefined reference to `nrfx_ppi_channel_free'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_group_free':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:189: undefined reference to `nrfx_ppi_group_free'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_ch_enable':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:206: undefined reference to `nrfx_ppi_channel_enable'
    1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.68/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/ble_app_uart_pca10056_s140/nrf_libuarte_drv.o: in function `ppi_ch_disable':
    1> C:\nrf_sdk\components\libraries\libuarte/nrf_libuarte_drv.c:214: undefined reference to `nrfx_ppi_channel_disable'
    Build failed
     

  • When doing this kind of work, I just start with the first error. In this case, that would be the line 63 in the log that you pasted above. 

    the compiler can't find nrfx_ppi_channel_alloc.

    So start by checking what .c (must be .c, not .h) file that defines this function in the libuarte example. Then see whether 1: Did you include this file in your current project? And 2: does this file have an #if "some sort of check" near the top of that file. If there is, and everything is working as intended, then the text that is not included in the project because of the #if will be grayed out:

    In that case, it is caused by a define in SDK_CONFIG not being set correctly. Looking at your project, it is the same situation as with the timer. I know it is not intuitive, because you already set "#define NRFX_PPI_ENABLED 1", but there exists a file called "apply_old_config.h" which will check if both "legacy" definitions and "nrfx" definitions of the same peripherals/libraries are defined, and if they are, then it will overwrite the nrfx one based on the legacy one. So in this case, you set the NRFX_PPI_ENABLED to 1, but PPI_ENABLED 0 is set to 0. Looking at apply_old_config,h, line 411:

    #if defined(PPI_ENABLED)
    
    #undef NRFX_PPI_ENABLED
    #define NRFX_PPI_ENABLED  PPI_ENABLED

    It will undefine NRFX_PPI_ENABLED that you set in sdk_config.h, and give it the same value as PPI_ENABLED, which is 0.

    Ignore the "gray out" in the apply_old_config.h. The compiler is confused of the undef and re defining.

    So to work around the "legacy" and "nrfx" double definitions:

    1: Either use the non-nrfx definitions when they are defined.

    2: or set them to match eachother.

    3: or remove the non-nrfx definitions when nrfx definitions are present.

  • So to work around the "legacy" and "nrfx" double definitions:

    1: Either use the non-nrfx definitions when they are defined.

    2: or set them to match eachother.

    3: or remove the non-nrfx definitions when nrfx definitions are present.

    Hi Edvin, Can you give me some examples. I'm new embedded so it's really hard to understand. Thank you so much for quick replies

Related