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

Softdevice 7.0/7.1 hangs on sd_softdevice_enable

I am using Eclipse Kepler, gcc and the nrf51 plugin (sourceforge.net/.../) on OS X. I had an application that worked fine with SDK 5.2 and S110 Softdevice 6.0. I had been building multiple applications for months with no problems.

Yesterday, I tried to update to the newest software. I downloaded SDK 6.1 and Softdevice 7.0. I updated all the header files and re-worked my code to use them (like the SPI API, which heavily changed). Once I compile and try to debug, the program hangs in sd_softdevice_enable. The Eclipse debugger just jumps to this spot and never leaves, I cannot even place a breakpoint before it. See the error here: image description

I noticed that the new Softdevice requires 88KB now, so I changed my mem.ld file accordingly. However, that did not help. I also tried to load Softdevice 7.1. Same error.

I am running this on an nrf51822 evaluation kit. Again, this HW and SW all worked fine with the older version of SW. I am sure this is a configuration issue somewhere, but I can't seem to find it.

Thoughts?

Parents
  • This is the new init sequence for SD7

    static void ble_stack_init(void)
    {
        uint32_t err_code;
    
        // Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);
    
        // Enable BLE stack
    
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    }
    
Reply
  • This is the new init sequence for SD7

    static void ble_stack_init(void)
    {
        uint32_t err_code;
    
        // Initialize the SoftDevice handler module.
        SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);
    
        // Enable BLE stack
    
        ble_enable_params_t ble_enable_params;
        memset(&ble_enable_params, 0, sizeof(ble_enable_params));
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = sd_ble_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    
        // Register with the SoftDevice handler module for BLE events.
        err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
        APP_ERROR_CHECK(err_code);
    }
    
Children
  • Ok, that does seem to fix the issue. However, I cannot attach the debugger at all now. If I use your code and just power on the board, things work fine. But if I try to attach the debugger (even with no breakpoints), it will still get caught in this same spot and hang.

    I checked, the old init function still would not work even without the debugger attached. This was also not the same behavior I had in SD6. At least there, I could run with the debugger attached (and generally had issues when I tried to place a breakpoint). Is there something different in SD7 that prevents the debugger from working?

  • Were you able to break at the beginning of main or in the Reset function at all ? There is a different between SD6 and SD7. It crashes when I first tried SD7 moving from SD6. So I compared the sample code between both versions and found that init is different. Also bond manage is replaced by device manager.
    Important, must do a clean before recompile in SD7.

  • No, I can't seem to set a breakpoint anywhere. No matter what I do, it falls into this trap if I have the debugger attached.

    I will try more tomorrow, at least my code can run again. Thanks for all your help!

  • I am still having other issues with SD7, I am not getting the BLE_EVT_TX_COMPLETE event anymore either which breaks my custom service. However, this question is answered and so I will open another thread for my other problems.

    I must say, upgrading from one version to another is quite aggravating...

Related