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,

  • Try to debug and see if the entire string or only parts of the strings are there. You need to figure out whether the data is lost on the air (most likely not), or in the log, or on the UART. 

    What is your MTU? And when you initilalize the nus service, what max length do you use?

    If you set a breakpoint on line 149 in your snippet (turn off optimization), and you send a message, is p_data correct, or corrupted? If it is corrupted, try all the message lengths from ~20 and up, and see at what length it starts behaving weird.

    BR,

    Edvin

  • What is your MTU?

    I think MTU was define here


    When I enable config log of nrf_libuarte_drv.c
    I got these debug line
    Seen the maximum tx buffer can transmit is 22.
    Where is "22" define ?


    In the 1st time I send 1234567891234567891\r\n =>length = 21 => can trasmit data (everything is OK) 
    In the 2nd time I send 12345678912345678912\r\n =>length = 22 => can trasmit data (everything is OK) 

    In the 3rd time I send 123456789123456789123456789\r\n =>length = 29 => the terminal show weird text 
    Her is the debug terminal

    Here is the uart terminal
    Yellow => the 1st time

    Blue => the 2nd time

    Green => the 3rd time

  • Not sure what exactly is going on here. It looks like the packet from the mobile phone is split into two. Have you tried connecting with something else, such as nRF Connect for Dekstop? does it behave the same there?

  • Hi Edvin, you're right.
    I used BLE Scanner I downloaded from CHPlay and it splited my text
    I switched to using nRF Connect for Mobile and It work well
    Thank you, Edvin !

Related