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

Unexpected System resets

SourceCode_SSDI_BTLE_BeaconReceiver.zipI am starting to use the Nordic chips, and have a PCA10004 board running. I have modified the experimental_ble_app_multiactivity_beacon example a bit to see what is happening. I disabled the advertising_start() because I want to use the receiver bit only. I added a output pin toggle in the main loop and disabled the power_manage call. Depending on counter limit value, the frequency of the toggle is changed. Starting at 200 (2,3kHz toggle). As soon as I receive a beacon message from a MKIT board, (a call to beacon_evt_handler is executed) I change the counter limit value from 200 to 1500 (resulting in a toggle in the mainloop 300hz). This part is working. After a few seconds (20-30), the system is reset and the 2,3kHz toggle will show again. I already removed the sd_power_off() in the on_ble_evt() (seems to be not executed). What did I do wrong?

I copied the error_code, line_num and p_file_name to global variable, and found the following: error_code= DEADBEEF p_file_name=src\soc_radio_timeslot.c line_num = 190. However I cannot find the source soc_radio_timeslot.c in my project. I suppose it is part of the Softkit?

I used S110 v7.1.0 and nRF51 Software Development Kit 6.0.0 (If Iam correct. Not sure about the SDK, but it seems the only one on my disk). Find attached the modified demo.

  • I recommend you to try to use the debugger.

    Start a debug session and put a breakpoint in app_error_handler(). To see the actual error code; remove optimization (click Options for Target->C/C++. Select Level 0 instead of Level 3).

    app_error_handler() will reset the chip and I see that beacon_scanner_error_handler() calls it. This may be the reason, but I'm not sure why.

    Please edit your question and include your findings.

    Edit: I have been able to reproduce the issue, I'm not really sure what's happening. Investigating.

    Edit2: It seems the issue occurs because of a drift difference between RTC0 and TIMER0. RTC0 is used internally by the timeslot, while TIMER0 is used by the application.

    The issue should be resolved by replacing

    NRF_TIMER0->CC[1] += TIMESLOT_LEN_US;

    with

    NRF_TIMER0->CC[1] += TIMESLOT_LEN_US - (TIMESLOT_LEN_US / 1000) - 1;

    in scanner_beacon.c, line 289.

  • Could you add your complete project? If it is secret, please create a case in the MyPage support portal. What SDK version and SoftDevice version are you using?

Related