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

ble_app_gzll example

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

Parents
  • Hi I started to use the ble_app_gzll example but I have one problem. As I see in the source code switching require to reinit the whole BLE/gzll stack. This means that every time I switch back to BLE mode I starts from advertising and the previous connection with device is lost. How can I hold the connection information between switching?

    I know that it is possible to skip few messages/ack between central and peripherial and still maintain the connection over BLE, but how to achieve it with ble_app_gzll example? Is it possible? I hope so.

Reply
  • Hi I started to use the ble_app_gzll example but I have one problem. As I see in the source code switching require to reinit the whole BLE/gzll stack. This means that every time I switch back to BLE mode I starts from advertising and the previous connection with device is lost. How can I hold the connection information between switching?

    I know that it is possible to skip few messages/ack between central and peripherial and still maintain the connection over BLE, but how to achieve it with ble_app_gzll example? Is it possible? I hope so.

Children
Related