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

Gazell not functioning inside SoftDevice timeslots

I'm running BLE and Gazell host concurrently using the timeslot API. I also have 2 Gazell peripherals transmitting all the time. Everything works just fine when I run Gazell on its own, but when I try to put it inside a SoftDevice timeslot it doesn't do anything. It doesn't receive any data. I've looked around and saw someone mention I should put Gazell into NRF_GZLL_MODE_SUSPEND mode.

This is the function that gets executed in a timeslot. It runs in the main (application) context.

void timeslotProc(void *data, uint16_t dataSize)
{
    debugOut("#");
    nrf_gzll_set_mode(NRF_GZLL_MODE_HOST);
    nrf_gpio_pin_write(6, 1);
    timerStart();
    while(timerRead() < 9000) nrf_delay_us(1); // Await incoming Gazell transmissions
    nrf_gzll_set_mode(NRF_GZLL_MODE_SUSPEND);
    nrf_gpio_pin_write(6, 0);
    timerStop();
}

How do I get it working? Thank you

EDIT: I'm using the standard variant of the Gazell library, not the SD resources variant. Could it be because of that? The propblem is I can't use that one due to SWI1 conflict with app_timer_ble_gzll and ble_radio_notification

EDIT 2: After some rewriting I successfully switched over to Gazell SD resources variant. It didn't matter though, Gazell is still not working:

nrf_radio_signal_callback_return_param_t *timeslotHandler(uint8_t signalType)
{
    static nrf_radio_signal_callback_return_param_t returnParams;
    returnParams.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE;
    
    switch(signalType)
    {
        case NRF_RADIO_CALLBACK_SIGNAL_TYPE_START:
            if(!isGazellOn)
            {
                gazellInit(true);
                isGazellOn = true;
            }
            else nrf_gzll_set_mode(NRF_GZLL_MODE_HOST);
        
            NRF_TIMER0->CC[3]    = 9000;
            NRF_TIMER0->INTENSET = TIMER_INTENSET_COMPARE3_Enabled << TIMER_INTENSET_COMPARE3_Pos;
            NRF_TIMER0->SHORTS   = TIMER_SHORTS_COMPARE3_CLEAR_Enabled << TIMER_SHORTS_COMPARE3_CLEAR_Pos;
            NVIC_EnableIRQ(TIMER0_IRQn);
            NRF_TIMER0->TASKS_START = 1;
            
            nrf_gpio_pin_write(6, 1);
            break;
        
        case NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0:
            if(NRF_TIMER0->EVENTS_COMPARE[3])
            {
                nrf_gzll_set_mode(NRF_GZLL_MODE_SUSPEND);
                
                nrf_gpio_pin_write(6, 0);
                NRF_TIMER0->EVENTS_COMPARE[3] = 0;
                NRF_TIMER0->TASKS_STOP = 1;
                returnParams.params.request.p_next = &tsReqParams;
                returnParams.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_REQUEST_AND_END;
            }
            break;
    }
    
    return &returnParams;
}
  • @ImQ009: I don't have an example for gazell host, with timeslot, but I have one for gazel device. It's based on SDK v6.1.

    I think you can first test if it works in device mode then try to convert the example to host mode.

    But keep in mind that since the host is running in timslot, so most likely the timer won't be synced and then you would need to keep all the connection in out of sync mode. This will result a slower data throught put due to retransmission.

    HRS Gazell device multi protocol.zip

  • I keep transmitting on a single channel, so that won't be a problem. Thanks! I'll take a look

  • It seems to be done in a very similar way to what I did. Except for the fact that I didn't set the Gazell XOSC control to manual. That did nothing though. Although, when I removed the SD resources variant of Gazell and used the normal one the application started to receive data and send acks. Though as soon as that happens I get a HardFault. Not sure what's up with that :/ I also get a ton of NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO signals

  • Oh, I see. I have to redirect those radio events to RADIO_IRQHandler(); That worked! Awesome! Thank you so much!

Related