Menu

An event posted to AO, but AO never gets it

2019-10-18
2019-10-18
  • Mikhail Nagoga

    Mikhail Nagoga - 2019-10-18

    Hello,
    I am evaluating the QP/C 6.5.1 and QTools 6.6.0 on a PIC32 based platform and trying to get work the QUTest, but observing some strange behaviour.

    The event USER_STANDBY_SIG is posted to the AO l_arbitre. After the message AO-POST I expected to find the AO-Get, but there is no such. Where could be the problem? It's looking like the posted message remains in the AO queue (29 of 30 slots free) but the AO never gets it. Who is supposed to check the AO queue and extract the messages in the test fixture?

    0000000001 QF-New   Sig=USER_STANDBY_SIG,Size=4
    0000000002 MP-Get   Obj=EvtPool1,Free=198,Min=198
    0000000003 AO-Post  Sdr=QS_RX,Obj=l_Arbitre,Evt<Sig=USER_STANDBY_SIG,Pool=1,Ref=1>,Que<Free=29,Min=29>
    0000000004 Trg-Done QS_RX_EVENT
    

    It's worth mentionning that QS_onTestLoop is missing for the PIC32. Here is my code:

    void QS_onTestLoop() {
        QF_INT_ENABLE();
        QS_rxPriv_.inTestLoop = true;
        while (QS_rxPriv_.inTestLoop) {
            QS_rxParse();  /* parse all the received bytes */
    
            if (U4STAbits.UTXBF == 0) { /* TX Buffer not full? */
                uint16_t b;
    
                QF_INT_DISABLE();
                b = QS_getByte();
                QF_INT_ENABLE();
    
                if (b != QS_EOD) { /* End-Of-Data reached? */
                    UART4_Write(b);
                }
            }
        }
        /* set inTestLoop to true in case calls to QS_onTestLoop() nest,
    
        * which can happen through the calls to QS_TEST_PAUSE().
        */
        QS_rxPriv_.inTestLoop = true;
    }
    

    Here is the complete QS log where I do two tests, perhaps it would be helpful to find the problem:

       <USER-> Sending RESET to the Target Stat=OK
       <COMMS> ERROR    Discontinuity Seq=0->2
    ########## Trg-RST  QP-Ver=651,Build=191018_122203
               Obj-Dict 0xA000074C->QS_RX
               Obj-Dict 0x9D04EE22->l_tickISR
               Obj-Dict 0x9D04EE23->l_SysTick_Handler
               Sig-Dict 00000055,Obj=0x00000000->POWER_ON_TIMEOUT_SIG
               Sig-Dict 00000018,Obj=0x00000000->USER_STANDBY_SIG
               TstPause
       <F-END> Attached Chan=00000010
       <COMMS> ERROR    Discontinuity Seq=0->2
    ########## Trg-RST  QP-Ver=651,Build=191018_122203
               Obj-Dict 0xA000074C->QS_RX
               Obj-Dict 0x9D04EE22->l_tickISR
               Obj-Dict 0x9D04EE23->l_SysTick_Handler
               Sig-Dict 00000055,Obj=0x00000000->POWER_ON_TIMEOUT_SIG
               Sig-Dict 00000018,Obj=0x00000000->USER_STANDBY_SIG
               TstPause
               Trg-Ack  QS_RX_GLB_FILTER
               Trg-Ack  QS_RX_TEST_CONTINUE
               Obj-Dict 0xA0000694->EvtPool1
               Obj-Dict 0xA00006A8->EvtPool2
               Obj-Dict 0xA00006BC->EvtPool3
               Obj-Dict 0xA00006D0->EvtPool4
               Obj-Dict 0xA00006E4->EvtPool5
               Obj-Dict 0xA00006F8->EvtPool6
               Obj-Dict 0xA00095DC->l_Arbitre
               Fun-Dict 0x9D032310->QHsm_top
               Fun-Dict 0x9D030594->Arbitre_initial
               Fun-Dict 0x9D030788->Arbitre_standby
               Obj-Dict 0xA000960C->l_Arbitre.timeEvt
               Obj-Dict 0xA00095FC->l_Arbitre.powerOnTimeEvt
    ===RTC===> St-Init  Obj=l_Arbitre,State=QHsm_top->Arbitre_standby
    0000000001 QF-New   Sig=USER_STANDBY_SIG,Size=4
    0000000002 MP-Get   Obj=EvtPool1,Free=199,Min=199
    0000000003 AO-Post  Sdr=l_Arbitre,Obj=l_Arbitre,Evt<Sig=USER_STANDBY_SIG,Pool=1,Ref=1>,Que<Free=30,Min=30>
    ===RTC===> St-Entry Obj=l_Arbitre,State=Arbitre_standby
    0000000004 Init===> Obj=l_Arbitre,State=Arbitre_standby
               Fun-Dict 0x9D0369AC->QActive_post_
               Fun-Dict 0x9D036E5C->QActive_postLIFO_
               Fun-Dict 0x9D036380->QS_processTestEvts_
               Trg-Ack  QS_RX_TEST_SETUP
               Trg-Ack  QS_RX_TEST_TEARDOWN
       <COMMS> ERROR    Discontinuity Seq=0->2
    ########## Trg-RST  QP-Ver=651,Build=191018_122203
               Obj-Dict 0xA000074C->QS_RX
               Obj-Dict 0x9D04EE22->l_tickISR
               Obj-Dict 0x9D04EE23->l_SysTick_Handler
               Sig-Dict 00000055,Obj=0x00000000->POWER_ON_TIMEOUT_SIG
               Sig-Dict 00000018,Obj=0x00000000->USER_STANDBY_SIG
               TstPause
               Trg-Ack  QS_RX_TEST_CONTINUE
               Obj-Dict 0xA0000694->EvtPool1
               Obj-Dict 0xA00006A8->EvtPool2
               Obj-Dict 0xA00006BC->EvtPool3
               Obj-Dict 0xA00006D0->EvtPool4
               Obj-Dict 0xA00006E4->EvtPool5
               Obj-Dict 0xA00006F8->EvtPool6
               Obj-Dict 0xA00095DC->l_Arbitre
               Fun-Dict 0x9D032310->QHsm_top
               Fun-Dict 0x9D030594->Arbitre_initial
               Fun-Dict 0x9D030788->Arbitre_standby
               Obj-Dict 0xA000960C->l_Arbitre.timeEvt
               Obj-Dict 0xA00095FC->l_Arbitre.powerOnTimeEvt
               Fun-Dict 0x9D0369AC->QActive_post_
               Fun-Dict 0x9D036E5C->QActive_postLIFO_
               Fun-Dict 0x9D036380->QS_processTestEvts_
               Trg-Ack  QS_RX_GLB_FILTER
               Trg-Ack  QS_RX_CURR_OBJ
               Trg-Ack  QS_RX_CURR_OBJ
               Trg-Ack  QS_RX_TEST_SETUP
               Trg-Ack  QS_RX_EVENT
    0000000001 QF-New   Sig=USER_STANDBY_SIG,Size=4
    0000000002 MP-Get   Obj=EvtPool1,Free=198,Min=198
    0000000003 AO-Post  Sdr=QS_RX,Obj=l_Arbitre,Evt<Sig=USER_STANDBY_SIG,Pool=1,Ref=1>,Que<Free=29,Min=29>
    0000000004 Trg-Done QS_RX_EVENT
       <F-END> Detached ######################################
    
     

    Last edit: Mikhail Nagoga 2019-10-18
  • Mikhail Nagoga

    Mikhail Nagoga - 2019-10-18

    Update

    After some searching I found that the following macro defined in the qv.h:

    #define QACTIVE_EQUEUE_SIGNAL_(me_) \
            QPSet_insert(&QV_readySet_, (uint_fast8_t)(me_)->prio)
    

    This macro is redefined in the port to arm-cm (qpc_6_5_1/ports/arm-cm/qutest/qf_port.h) but not to pic32 as following:

    #define QACTIVE_EQUEUE_SIGNAL_(me_) \
        QPSet_insert(&QS_rxPriv_.readySet, (uint_fast8_t)(me_)->prio)
    

    I copied the missing section to the qf_port.h of pic32 port and my AO started to get messages. However now there are plenty of compiler warnings about macros redifinition.
    What I am missing?

     
  • Quantum Leaps

    Quantum Leaps - 2019-10-18

    The QP support for PIC32 is still missing the "qutest port" at this time. This would need to be added (perahps by copying and modifiying the existing qutest port for ARM Cortex-M).

    qpc/
    +-ports/
    | +-arm-cm/
    | | +-qk/
    | | +-qutest/  <-- QUTest port for ARM Cortex-M
    | | +-qv/
    | | +-qxk/
    | |
    | +-pic32/
    | | +-qk/
    | | +-qutest/  <-- missing QUTest port for PIC32
    | | +-qv/
    

    --MMS

     

    Last edit: Quantum Leaps 2019-10-18

Log in to post a comment.

MongoDB Logo MongoDB