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

Data is not getting received in nus_data_handler


Hi,

I have created an eclipse based makefile project for nrf51802 module.

The sdk version that i am using is 12.3.0, and softdevice S130 .

Taking reference of ble_app_uart example i have advertised my device and i have connected with nrf android application and sent data.

It is expected that data should come into nus_data_handler. I have not enabled any other services except the default nus service which is initialized in services_init();

I kept a breakpoint in nus_data_handler() but it never reaches that breakpoint.

I also see that, it comes to BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST case in on_ble_evt() and then gets disconnected after that.

I am attaching my project for reference.

Please help me resolve this issue. I'm blocked on it since 3 days.0486.Keybox.zip

3225.My_project.zip

Parents
  • What is the difference between "My_project.zip" and "Keybox.zip"?

    As mentioned in your other ticket, we don't support Eclipse or Truestudio, so what I do is that I try to use your main.c in the ble_app_uart project.

    So the first thing I needed to change was to add the nrf_queue.c file to the project, since I don't use the same project file as you do.

    The second thing I needed to do was to change the RAM settings, because softdevice_enable() returned 4.

    I had to set RAM start/origin = 0x20003388 and size =  0xCC78.

    Did you change your RAM settings?

    After those changes, I got an interrupt when I used nRF Connect for Desktop to write to the UART rx service:

    If that doesn't happen in your case, try to debug and see what happens. Does the application crash? I don't have any possibility to help you with projects in formats that we don't support. 

    Does it work if you use the UNMODIFIED ble_app_uart example from the SDK? you can try to port it to your IDE, but I see that you have also done a lot of changes to the main.c file, and you have removed all the logging from main.c. Is there any reason for this? Can you try to do this from scratch with an unmodified SDK?

    Best regards,

    Edvin

  • Hi Edvan,

    log messages are not displaying on console... that is the reason i have removed logging..

    After i changed nus characteristics i was able to transmit and receive data with app not through nus_data_handler but some other handler..

    This issue is solved but now i have another issue.

    I want to use freertos in my project so firstly i am running the pre-compiled hex file in the below path and observed that device is not advertising.

    nRF5SDK\examples\ble_peripheral\ble_app_hrs_freertos\hex

    Can you help here?

    Thanks,

    Swetha.

Reply
  • Hi Edvan,

    log messages are not displaying on console... that is the reason i have removed logging..

    After i changed nus characteristics i was able to transmit and receive data with app not through nus_data_handler but some other handler..

    This issue is solved but now i have another issue.

    I want to use freertos in my project so firstly i am running the pre-compiled hex file in the below path and observed that device is not advertising.

    nRF5SDK\examples\ble_peripheral\ble_app_hrs_freertos\hex

    Can you help here?

    Thanks,

    Swetha.

Children
Related