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

Unstable timeslot with esb and ble concurrently

Hi,

I've just got the example running with one DK as ble peripheral and ESB at the same time uing the timeslot API and one DK as only ESB receiver. I can communicate fine between all elements (ble master is a laptop). But if I just keep the timeslot DK running with BLE in advertising mode restarting each 10 seconds (blinking LED) and check the start and end of the timeslot for the ESB stuff with a GPIO toggle I can see sporadic (each 5 minutes) a crash of the timeslot (stays HIGH for 10 seconds). What could be the reason since nothing is sending or receiving either on ESB or BLE.

If I hit the pause button of GDB in eclipse I pause at

Thread #1 57005 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) 0x12402 0x12400

But then without a reset it returns to normal operation. Any idea?

  • what do you mean by "crash of the timeslot" ? There is a chance that the time slot was just rejected (because the softdevice was busy for example) and then was requested again and granted after that ? It's normal that a timeslot can be missed and then granted after that.

    Could you specify what exactly you meant by "But if I just keep the timeslot DK running with BLE in advertising mode restarting each 10 seconds (blinking LED)" . How do you restart every 10 seconds ? by using the advertising timeout ? or by using extra timer ? Is the issue related to the issue you are discussing here ?

  • I restart with:

    uint32_t err_code;
    
    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
        	NRF_LOG_INFO("Fast advertising\r\n");
            err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            APP_ERROR_CHECK(err_code);
            break;
        case BLE_ADV_EVT_IDLE:
        	//sleep_mode_enter();
        	// Re-start advertising
        	err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
            break;
        default:
            break;
    }
    

    Because if I send the softdevice to sleep mode both BLE and ESB are dying. That's why I keep the BLE advertising. And after approximiately 5 mins the timeslot is not assigned for 10 seconds and it restarts without a reset. I've checked the reset line with an osci, or it has to be a software reset, but the BLE LED keeps on blinking during these 10 seconds. So from my impression the timeslot is not that stable in my implementation or it has to be something more general.

  • Have you tried to to simply keep the BLE advertising continuously ? Simply set APP_ADV_TIMEOUT_IN_SECONDS = 0 and advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE; should allow the device to advertise in BLE without timeout.

    5 minutes timeout doesn't ring any bell for me. It could be smth else. Please make sure you check that the device reset or not. You can detect it simply by printing out something on UART when you starting up or blink LED.

    Please try to debug and find what exactly cause the timeslot to be skipped, check if it's just simply the NRF_EVT_RADIO_BLOCKED or NRF_EVT_RADIO_CANCELED or anything else.

  • Have you tried to to simply keep the BLE advertising continuously ? Simply set APP_ADV_TIMEOUT_IN_SECONDS = 0 and advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;

    Yes I tried it but it then directly crashes with invalid parameter error. And I mean continious advertising is not realy what I want. I would like to put the BLE for 180 s in advertising and then overtake the full timeslot if possible for ESB. The other flags I will check thanks for the hint.

  • When you set APP_ADV_TIMEOUT_IN_SECONDS = 0 you need to set advdata.flags = *_GENERAL_DISC_MODE; instead of *_LIMITED_DISC_MODE or you will receive invalid parameter as the LIMTED mode can't be use with infinite advertising.

    Please try to test with the esb timeslot ble example and send me the project if you can reproduce the issue with minimum modification from the example.

Related