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

Device Restart with reset reason 4 after connecting BLE and on Mobile Application restart

Hello Everyone,

I am using NRF52840 with Custom board, SES v5.20, SDK 15.1.0, IONIC android App(as Central)

1)My problem is, our nrf52840 board will restart once after successful BLE connection then again it will connect and then no restart just work normal and fine and the reset reason will be 4

2)and also controller restart suddenly(not every time, only sometimes) when i do clear data in my android application on that time also we get reset reason 4 only.

i found that reset reason 4 means- soft reset from https://devzone.nordicsemi.com/f/nordic-q-a/48446/how-to-detect-cause-of-reset but i am not able to understand what is soft reset means exactly  

and how i can solve this issue, 

Thanks in advance

Best Regards,

Raj.

Parents
  • Hello Raj,

    A soft reset means that the application called NVIC_SystemReset() somewhere, which will reset the chip. A hard reset would be powering the chip off and on.

    Most likely, it is the application error handler that triggers the reset. Can you try to add DEBUG to your preprocessor definitions? It looks like you are using Segger Embedded Studio, is that correct?

    If so, you will find your preprocessor definitions here:

    (Note the "Common" selected from the drop down menu).

    After you set this, the error handler shouldn't reset, but rather print some error reason in the log. Can you test this and see if the log says anything right before you would normally see the reset?

    Best regards,

    Edvin

  • Hi Edvin,

    It looks like you are using Segger Embedded Studio, is that correct?

    Yes I am using Segger Embedded Studio (SES) v5.20

    --> i have tried adding debugging in the preprocessor definitions but no use.

     --> just for better clarity, This restart will not happen if i use "nrf connect" or "Serial bluetooth termianl" apps, its happens only when i use our custom Android app which is dedicated to this project only, and this custom app is having auto reconnect feature , that means when ble disconnects its try to reconnect again until its connects back. (do you think this reconnecting feature causing any issue in our NRF microcontroller) and before restart our NRF microcontroller will not receive any data through ble.

    i hope you understand the problem statement.

    Best Regards,

    Raj.

  • Hi edvin,

    I need to complete this issue as soon as possible please help me soon

    I am awaiting for your replay

    Best Regards

    Raj

  • There are couple of NVIC_SystemReset() added into your main.c file. They are the reason for the resets on your device. Look at the snapshot of the debugging window that i started using your project.

    Why did you add those resets?

  • Hi Susheel,

    Thank you for the response,

    actually found out the block of code causing my controller reset i.e., my ble_data_process function in my main.c

    i am parsing the received ble data in the function called ble_data_process()

        if (ble_data_flag)
        {
          ble_data_process(ble_data_array, strlen(ble_data_array));
          ble_data_flag = 0;
        }

    so when i comment this function it was working fine(not resetting), and im sure that NVIC_system_reset() have no role in this issue.(this reset function is for security propose, means my code will respond to only our customized mobile application).

    NOTE: please find my new application zip file in attachments.

    so i changed my parsing code then its working fine(not resetting) but my doubt is what is the reason to reset?

    Since NRF52840 have huge RAM(256KB) so it should not reset because of memory issue, so please help to understand.

    BestRegards

    Rajender.

  • There are only three reasons for the chip to reset when it has stable power supply.

    1. Application calling NVIC_SystemReset() explicitly.
    2. Watchdog timeout reset
    3. Wakeup from the System Off (deep sleep)

    Start your application in debugger mode and put breakpoints to all the places that match any one or more of the above three points (breakpoints at NVIC_SystemReset, wdt ISR if configured or trigger to system off)and reproduce your reset. You will find that one of your breakpoint will be hit. You can then understand more about the contexts and nature of your reset.. 

  • Hi. I'm having the same problem and I still don't know why my board is resetting. Did you find out why?

Reply Children
Related