This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems with event handling and having ble_evt_dispatch called

Folks,

Sorry if I'm just being boneheaded here, but have been fighting with a couple problems while migrating my app on nRF51822/"C0"/SDK 4.2.2/S110 5 to nRF51822/"G0"/SDK 6.1.0/S110 7.1.0.

App worked fine before, e.g., Advertising started, responded to a Connection attempt (from an iOS app), Connected and sent Notifications to the phone just fine.

Now, after migrating to the new environment (and adding some app timers, etc. -- sorry for the possible sources of error :-) I'm having trouble in two main places:

  • If I try to run "power_manage" after starting Advertising (with a call to sd_app_evt_wait();), the MCU goes into such a deep sleep that Advertising is cut off.
  • If instead I go into a polling loop, waiting for a connection, Advertising happens as expected. But when Central (the iOS app) attempts to connect, I never get a call to ble_evt_dispatch, even though it was passed during stack enable to softdevice_ble_evt_handler_set(ble_evt_dispatch); without error.

Note: I've checked to see if I've initialized any peripherals which might have generated "pending" interrupts (i.e., without properly calling sd_nvic_EnableIRQ, but I don't think so.

Any hints on what I'm missing here?

Thanks,

Mike

Parents
  • Still working on this problem and am getting very inconsistent behavior. Suspect a timing or race condition. For example, power_manage sometimes works as expected and sometimes not. In one case, after starting advertising and entering power_manage, it immediately reawakens (some errant interrupt, not a callback to ble_evt_dispatch?) and hits a breakpoint I set on the line after power_manage. Exiting that breakpoint doesn't go anywhere but into ble_debug_assert_handler with the following traceback:

    s_file_name: 0x20002EAC 'src\rem.c'
    s_line_num: 0x0561
    s_error_code: 0xDEADBEEF
    0x0001A408
    0x000130A4
    0x21000018
    

    Is this informative (or just a "DS" error?

Reply
  • Still working on this problem and am getting very inconsistent behavior. Suspect a timing or race condition. For example, power_manage sometimes works as expected and sometimes not. In one case, after starting advertising and entering power_manage, it immediately reawakens (some errant interrupt, not a callback to ble_evt_dispatch?) and hits a breakpoint I set on the line after power_manage. Exiting that breakpoint doesn't go anywhere but into ble_debug_assert_handler with the following traceback:

    s_file_name: 0x20002EAC 'src\rem.c'
    s_line_num: 0x0561
    s_error_code: 0xDEADBEEF
    0x0001A408
    0x000130A4
    0x21000018
    

    Is this informative (or just a "DS" error?

Children
No Data
Related