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.

  • Hi Edvin,

    i need some time to show you the log because we are having work from home due to COVID 19 here and all the stuff is in office right now.

    so i will update you when i can have the access to the hardware

    Best Regards,

    Raj

  • Hi, Edvin,

    Thank you for the waiting,

    Now i can access my hardware,

    at present my situation is the device continuously restarting after connecting to the BLE, i can't even run my application,

    NOTE: my custom android app will sends some data over ble after connection is established

    Im using SDK:15.1.0, SESV5.20 

    Im attaching my project as a zip file, log file, ...

    please help me out

    Best Regards

    Rajender

    ble_app_uart - Warmer2.zip

    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    <info> app: Connected
    <info> app: Data len is set to 0xF4(244)
    <info> app: PROGRAM STARTED
    <info> app: Reset reason = 0x00000004.
    
    <info> app: Debug logging for UART over RTT started.
    

  • 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.

Related