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

Unexpected warning

I am receiving an unexpected warning from nrf_atfifo_item_get that reports "Get failed - no item in the FIFO." This occurs when I start advertising using

void advertising_start(bool erase_bonds)

This calls bsp_led_indication which calls app_timer_start which triggers drv_rtc_irq_trigger

I am assuming this is to catch short timer periods, but can this warning be avoided so that there is no call to the rtc trigger?

  • I have not tested but this problem with nrf_atfifo_item_check could affect other routines such as in nrf_fstorage_sd.c in the following:

    /* Load a new operation from the queue. */
    static bool queue_load_next(void)
    {
        if (nrf_atfifo_item_check(m_fifo, &m_iget_ctx)) {
        m_p_cur_op = nrf_atfifo_item_get(m_fifo, &m_iget_ctx);

        return (true);
        } else {
            return (false);
        }
    }

  • The following is a workaround that resets the head of the FIFO queue to its original value after the check so that it correctly returns the next item and avoids the call that would return an empty queue message.

    /**
     * @brief Function for processing user requests.
     *
     * Function is called only in the context of RTC interrupt.
     */
    static void timer_req_process(drv_rtc_t const * const  p_instance)
    {
        nrf_atfifo_item_get_t fifo_ctx;
        timer_req_t *         p_req;
            bool                                    req = nrf_atfifo_item_check(m_req_fifo, &fifo_ctx);

        while (req)
        {
                    m_req_fifo->head.tag = fifo_ctx.last_head.tag;
                    m_req_fifo->head.pos.wr = fifo_ctx.last_head.pos.wr;
                    m_req_fifo->head.pos.rd = fifo_ctx.last_head.pos.rd;
                    p_req = nrf_atfifo_item_get(m_req_fifo, &fifo_ctx);
            switch (p_req->type)
            {

  • Ok, I'm convinced Slight smile 

    What time period are you using? Could you share your code? You could of course modify the code any way you would like, but it's not recommended, as a consequence can make errors not handled properly. 

    regards

    Jared 

Related