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

App Freezing randomly

Dear All,

We are using nrf52480, we our app is simply scanning for Near By Ble, and if the UUID of a ble Matches it send the data to another controller through Lib Uart Serial port.

1) Main controller sends a command to the BLE through UART and tells the BLE to Store the UUID it needs to scan in its Flash(fds Controller).

2) The BLE keeps scanning for UUID and when a uuid matches the stored UUID it send a command to the Main controller using serial port.

3) this works well most of the time almost for 1 day sometimes 2 days at a time and then the BLE Crashes...

We are not sure how to find the error as its impossible to be looking at the screen continuesly in debug mode... Any idea how we can find out why it crashed so we can solve the problem.. 

Secondly for a quick fix is it possible to just make the BLE automatically Reset When it crashes....

Look forward to your urgent help.

thanks

Parents
  • Hi,

    Can you attach the debugger after the device has crashed to see where the program got stuck (e.g., by running "nrfjprog --readregs")? A "crash" will usually cause the program to either enter the app_error_fault handler (Error module) or the hardfault exception handler (HardFault handling library)..

    If you just want the device to automaitcally reset if a fault is triggered, then you can define the hardfault interrupt handler like this:

    void HardFault_Handler(void)
    {
        /* Perform a system reset to recover from fault */
        NVIC_SystemReset();
    }

    Best regards,

    Vidar

  • Dear Vidar,

    Thanks allot for your reply..

    Please can you explain more how to do this nrfjprog --readregs?  I have no idea where to start with this command? Is there a command line in Segger?

    I have been trying to figure out how to do what your suggesting but whenever i connect to the ble it reset its .. So the error is lost. It will be greatly appreciated if you can explain more.

    Thanks for the HardFault Code..

    void HardFault_Handler(void)
    {
    /* Perform a system reset to recover from fault */
    NVIC_SystemReset();
    }

    Do you just put this code in my code, do i need to register this handler anywhere or is it automaticaly taken care of..

    thanking you,

    Nadeem Jamal

  • Hi Nadeem,

    nrfjprog is included in our nRF Command Line Tools package, so you need to make sure you have installed this package first. Once it is installed you can run the command from terminal window as the screenshot below shows.

    Nadeem said:
    Do you just put this code in my code, do i need to register this handler anywhere or is it automaticaly taken care of..

     yes, you can place it anywhere in your code. This will replace the default "weak" hardfault handler implementation in the startup file.

    Best regards,

    Vidar

Reply
  • Hi Nadeem,

    nrfjprog is included in our nRF Command Line Tools package, so you need to make sure you have installed this package first. Once it is installed you can run the command from terminal window as the screenshot below shows.

    Nadeem said:
    Do you just put this code in my code, do i need to register this handler anywhere or is it automaticaly taken care of..

     yes, you can place it anywhere in your code. This will replace the default "weak" hardfault handler implementation in the startup file.

    Best regards,

    Vidar

Children
Related