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

DEBUG in preprocessor definition cause issue in bluetooth connection

hello,

I am using SDK v15.2.0,s140,pca100056. In my custom application I am using 3 SPI, RTC, timers, USBD, etc.

Actually during the development stage I have used DEBUG in preprocessor definition to see logs . All works fine according to the flow. But when I removed DEBUG from the preprocessor definitions, I am not able to connect my device to the phone via bluetooth. On connecting to the advertised device, the connection get disconnected and will never get advertised again. 

Why this could be so?

I am attaching my sdk_config.h file with this.sdk_config.h

Please  provide me some suggestions on this.

Regards,

Shilpa

Parents
  • Hi,

    But when I removed DEBUG from the preprocessor definitions, I am not able to connect my device to the phone via bluetooth.

    Which line did you remove in the sdk_config.h?

    If I understand your problem correctly, you can set the log level to other option instead of removing.   

    // <0=> Off
    // <1=> Error
    // <2=> Warning
    // <3=> Info
    // <4=> Debug 

    -Amanda H. 

Reply
  • Hi,

    But when I removed DEBUG from the preprocessor definitions, I am not able to connect my device to the phone via bluetooth.

    Which line did you remove in the sdk_config.h?

    If I understand your problem correctly, you can set the log level to other option instead of removing.   

    // <0=> Off
    // <1=> Error
    // <2=> Warning
    // <3=> Info
    // <4=> Debug 

    -Amanda H. 

Children
  • Hello,

    I didn't remove any line intentionally . But I suspect some changes have occurred there which is the reason for this behavior.

    Is there any other possibilities for this issue

    Regards,

    Shilpa  

  • Hi Shilpa,

    shilpa said:
    But I suspect some changes have occurred there which is the reason for this behavior.

    What are those changes in code or sdk_config.h

    -Amanda H.

  • Hello,

    I identify it as sdk_config.h, the value of the NRF_LOG_DEFAULT_LEVEL  is set as 4, i.e, in 'debug'.  when I changed it to 0, this issue was resolved. But the bluetooth connection is getting disconnected soon.

    If I add 3 as the value DFU update is not working properly

    Actually in my application I am plotting a graph in our phone app by sending data from device via bluetooth. The graph becomes slower then and got disconnected soon.

    Why this could be so?

    Regards,

    Shilpa

  • Hi, 

    shilpa said:
    I identify it as sdk_config.h, the value of the NRF_LOG_DEFAULT_LEVEL  is set as 4, i.e, in 'debug'.  when I changed it to 0, this issue was resolved. But the bluetooth connection is getting disconnected soon.

     

    shilpa said:
    got disconnected soon.

    Could you print the disconnect reason?

    Set NRF_LOG_DEFAULT_LEVEL as 3

    In ble_evt_handler, you could do something like this:

    case BLE_GAP_EVT_DISCONNECTED:
    
    NRF_LOG_INFO("Disconnected reason: %d.",p_ble_evt->evt.gap_evt.params.disconnected.reason);
    

    -Amanda H. 
  • hello,

    Thank you for the advice .I could successfully resolve this issue by your guidance.

    I want to know further that is there any parameters in sdk_config which may change the speed of sending data via bluetooth?

    In my application from the custom device we are actually sending some values via bluetooth and plot that values a s a graph. In my case I am able to plot the graph but on plotting for some time the speed at which the graph is plotted get reduced and is almost stuck. Later the graph retains its speed.

    What might be the possibility of this issue? I suspect this might be due to some parameters in sdk_config.h file. If so what could be the reason?

    Regards,

    Shilpa

Related