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,

Parents
  • Hello,

    When combining different examples from the nRF5 SDK, my advice is usually to start with one of them (in this case I would start with the one containing the softdevice, so ble_app_uart). 

    Start by adding the libuarte functions that you see in the main.c file from the libuarte example, and the .h and .c files where these are declared and defined, respectively. Then start compiling your application, and look for the missing functions or headers. If you struggle to find what file they are defined in, look them up in the libuarte example. Remember that you need to both include the file, and enable them if they have a guard. (enable them by setting the define from sdk_config.h). If you lack the definitions from sdk_config.h, then copy them from the libuartes example.

    Give it a go, and let me know if you are stuck. 

    Best regards,

    Edvin

  • Hi Edvin,

    Thanks for your reply. I understand flow you suggested but I stuck in step how to include header file ?

    In Project Explorer window I just find .c file. 

    step1 : added the links to the folder which contain .c files in Preferences -> General -> Processors > User include directories

    step2 : then I added .c file by right clicking => add existing file.
    And I don't know where contain header file (.h file) and how to add them ?

    Addititon, How to add Dependencies and Output Files in .c file ? When I add nrfx_ppi.c I didn't find them like nrfx_gpioe.c, nrfx_clock.c....  which are already in ble_app_uart example 



  • I can flashing code to nRF

    Debug Terminal didn'n show anything ( play button(excution) in debug mode can't play)

    Can't advertising 

    Can't communicate via libuarte

    But when I disable libuarte2. The code worked correctly.

  • Are you running this on an nRF52833 DK? If so, can you please .zip the application folder and upload it here?

    Best regards,

    Edvin

  • I am using custom board with chip nRF52833. 
    The pca is pca10100.
    I think problem is related to RTC and TIMER.
    Here is my project

    this is the relevant configuration:

    #define NRF_LIBUARTE_ASYNC_WITH_APP_TIMER 1
    #define NRF_LIBUARTE_DRV_UARTE0 1
    #define NRF_LIBUARTE_DRV_UARTE1 1

    #define NRFX_RTC_ENABLED 1
    #define NRFX_RTC0_ENABLED 1
    #define NRFX_RTC1_ENABLED 0
    #define NRFX_RTC2_ENABLED 1

    #define NRFX_TIMER_ENABLED 1
    #define NRFX_TIMER0_ENABLED 1
    #define NRFX_TIMER1_ENABLED 1
    #define NRFX_TIMER2_ENABLED 1
    #define NRFX_TIMER3_ENABLED 1
    #define NRFX_TIMER4_ENABLED 0

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 1, 1, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 1, 2, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
    here is my debug terminal


    ble_libuarte_tam.rar

  • Try setting a breakpoint at uart_init() in your main() function. Is it reached?

  • Hi Edvin, I try settting a breakpoint at uart_init() and here is the result

Reply Children
No Data
Related