Hello
I am trying to run the dual mode BLE/Gazell application example ble_app_gzll. I adapted it slightly such that the stacks are switched automatically in main() as follows:
// Enter main loop.
for (;;)
{
power_manage();
//if (running_mode != previous_mode)
//{
// previous_mode = running_mode;
if (running_mode == GAZELL)
{
nrf_gpio_pin_set(GZLL_DEBUG_PIN);
// Stop all heart rate functionality before disabling the SoftDevice.
ble_hrs_app_stop();
// Disable the S110 stack.
ble_stack_stop();
nrf_gpio_pin_clear(ADVERTISING_LED_PIN_NO);
nrf_gpio_pin_clear(CONNECTED_LED_PIN_NO );
// Enable Gazell.
gzll_app_start();
timers_init();
gpiote_init();
buttons_init();
running_mode = BLE;
nrf_gpio_pin_clear(GZLL_DEBUG_PIN);
}
else if (running_mode == BLE)
{
nrf_gpio_pin_set(BLE_DEBUG_PIN);
// Disable Gazell.
gzll_app_stop();
nrf_gpio_pin_clear(GZLL_TX_SUCCESS_LED_PIN_NO);
nrf_gpio_pin_clear(GZLL_TX_FAIL_LED_PIN_NO );
// Re-enable the S110 stack.
ble_stack_start();
timers_init();
gpiote_init();
buttons_init();
ble_hrs_app_start();
running_mode = GAZELL;
nrf_gpio_pin_clear(BLE_DEBUG_PIN);
}
//}
}
However, the program crashes every time it reaches advertising_start();
and ends in the app_error_handler with a NRF_ERROR_INVALID_STATE error.
Moreover, in the very first execution a NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED error occurs during initialization upon calling ble_stack_start();
and resets the device.
Any ideas what I am doing wrong here? The s110_nrf51822_5.2.1_softdevice.hex SoftDevice is flashed on my nRF51822. Does the Gazell protocoll need something like a pre-flashed "SoftDevice" too?
Thanks for your advice!
BR, christof