Menu

QP and FreeRTOS for ESP32

Andy Aoe
2020-07-15
2020-11-25
<< < 1 2 (Page 2 of 2)
  • Andy Aoe

    Andy Aoe - 2020-07-24

    Thanks Miro, can you point me to any resources or explain why I'm running out of free events?

     
  • Quantum Leaps

    Quantum Leaps - 2020-07-25

    First, please check if the capacity of your event pool(s) is adequate. Perhaps simply increasing the number of events in the right event-pool will help.

    But it is also possible to have a leak in your event-pool(s). For example, if you allocate some events with Q_NEW() or Q_NEW_X() but then don't post or publish some of them, those events will be leaked.

    Another possibility of leaking events could be by using event deferral incorrectly.

    Yet another possibility of leaking events could be by using Q_NEW_REF() incorrectly.

    Please check all these possibilities.

    --MMS

     

    Last edit: Quantum Leaps 2020-07-25
  • Andy Aoe

    Andy Aoe - 2020-07-25

    Ah thanks, due to your comment I realized I was being silly and was allocating two QEvt.

             QEvt *event;
             event = Q_NEW(QEvt, BUTTON_SIG);
             QF_PUBLISH_FROM_ISR(Q_NEW_FROM_ISR(QEvt, BUTTON_SIG),
                                 &xHigherPriorityTaskWoken,
                                 0);
    

    Miro, at some point, if you'd like me to transfer the freertos-esp32 port to you, just let me know. I have one active object working and will be adding more in the weeks ahead. I've had to make some changes. For example, since there are two cores the ApplicationTickHook gets called twice. I noticed the timers were running at double speed! I had to make the change below

    /* Application hooks used in this project ==================================*/
    /* NOTE: only the "FromISR" API variants are allowed in vApplicationTickHook */
    void vApplicationTickHook(void) {
        BaseType_t xHigherPriorityTaskWoken = pdFALSE;
        static int8_t counter = 0;
    
        //application tick hook is called by both cores so only call isr for every other call
        if ((counter++ % 2) == 0) {
           /* process time events for rate 0 */
           QF_TICK_X_FROM_ISR(0U, &xHigherPriorityTaskWoken, &l_TickHook);
        }
    
    #ifdef Q_SPY
        {
            tmp = SysTick->CTRL; /* clear SysTick_CTRL_COUNTFLAG */
            QS_tickTime_ += QS_tickPeriod_; /* account for the clock rollover */
        }
    #endif
    
        /* notify FreeRTOS to perform context switch from ISR, if needed */
    
       if (xHigherPriorityTaskWoken == pdTRUE) {
          portYIELD_FROM_ISR();
       }
       //portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); //only  available in newer versions of FreeRTOS
    }
    
     
    👍
    1
  • Quantum Leaps

    Quantum Leaps - 2020-11-24

    Hi Andy,
    I see some interest in ESP32 from the QP users, so I'd like to take you up on the offer of sending over your QP-ESP32 port. Could you please send it to info@state-machine.com? Thanks a lot!
    --MMS

     
    👍
    1
  • Leonardo Goncalves

    Hi, Andy, how are you?

    Ccould you share your dpp project?

    Thanks.

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.