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

Bug: App Scheduler and freeRTOS

There seems to be a bit over a bug with the freeRTOS example. If you add the Scheduler to the BLE thread, Scheduler events will always be one event behind as there are only executed on the next loop. The fix is adding your power_manage() function both before and after the intern_softdevice_events_execute(); in the BLE task.

Parents
  • Hi,

    If you are pulling SoftDevice events in the scheduler you will see this bug. We are fixing this in the upcoming SDK version 14.1. The solution in SDK 14 is to switch the sequence in the softdevice_task() in nrf_sdh_freertos.c

    static void softdevice_task(void * pvParameter)\{
    
        NRF_LOG_DEBUG("Enter softdevice_task.");
    
        if (m_task_hook != NULL) \{
    
            m_task_hook(pvParameter);
    
        }
    
        while (true) \{
    
            nrf_sdh_evts_poll();
    
            (void) ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
    
        }
    
    }
    
Reply
  • Hi,

    If you are pulling SoftDevice events in the scheduler you will see this bug. We are fixing this in the upcoming SDK version 14.1. The solution in SDK 14 is to switch the sequence in the softdevice_task() in nrf_sdh_freertos.c

    static void softdevice_task(void * pvParameter)\{
    
        NRF_LOG_DEBUG("Enter softdevice_task.");
    
        if (m_task_hook != NULL) \{
    
            m_task_hook(pvParameter);
    
        }
    
        while (true) \{
    
            nrf_sdh_evts_poll();
    
            (void) ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
    
        }
    
    }
    
Children
Related