This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SIMPLELINK-CC13X2-26X2-SDK: Event Fabric routing of RAT_GPO0 output to GPTxA/B capture input

Part Number: SIMPLELINK-CC13X2-26X2-SDK

Hello everyone,

I am trying to use the event fabric functionality on CC1352R1 to route RF Core signal RAT_GPO0 output to GPTxA/B capture input. I am looking at `EventRegister(uint32_t ui32EventSubscriber, uint32_t ui32EventSource)` parameters in the documentation and this operation is not explicit.

dev.ti.com/.../group__event__api.html

I suspect that it could be accomplished by using one of this multipurpose parameters for the `ui32EventSource`:

EventRegister(EVENT_O_GPTxXCAPTSEL, ui32EventSource);

where `ui32EventSource` could be one of the options:

RFC_HW_COMB - getting all HW interrupts from Dorbell interface (not ideal)

RFC_CPE_x - I suspect this is the post mortem SWI IRQ, it will not

PORT_EVENTx - configurable to RFC signals

Is one of this options this feasible?

Regards,

Adrian

  • Hi Adrian

    Just wanted to let you know that we are looking into this to figure out if/how this can be done.

    Can I ask how you are intended to use this? Have you considered using the timestamp appended to the packet instead, for timing information?

    BR

    Siri

  • I have talked to the driver team, and it does not seem possible to achieve what you want.

    My best suggestion is to either use the timestamps of the packets for syncing, if that is possible, or to output the RAT_GPO0 to a pin X, and connect that pin Y, that again will be input to the GPTimer.

    BR

    Siri

  • Hi Siri,

    Thank you for the investigation.

    We are using RAT_GPO0 already for evaluation, but that requires use of additional pins and PCB routing. In our case we have used all pins available already, PCB respin does not sound ideal.

    I was hoping to get a higher frequency sampling rate then the 4 MHz RAT on the RF Core signals. Also if I would sample all state of Tx and Rx (rising edge and falling edge), I would need 3 more RAT channels plus the Rx timestamp.

    Is `RFC_HW_COMB` IRQ bundle a real time interrupt from the RF Core? (In the sense that is acting on the configured events in real time, not post mortem).

    Regards,

    Adrian

  • Could you please add some details from the discussion with the driver team.

    How is the event fabric suppose to be used?

    Adrian

  • so we do not have any reference SW etc.

    I managed to set up an example where I used RFC_CPE_0 (Combined interrupt for CPE-generated events, corresponding flags found in RFC_DBELL:RFCPEIFG).

    #define RED_LED     CONFIG_PIN_0 // DIO_6
    #define GREEN_LED   CONFIG_PIN_1 // DIO_7
    
    void timerCallback0A(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask)
    {
        time0A = GPTimerCC26XX_getValue(handle);
        PIN_setOutputValue(ledPinHandle, GREEN_LED,!PIN_getOutputValue(GREEN_LED));
    }
    
    static void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
    {
        if (e & RF_EventRxEntryDone)
        {
            PIN_setOutputValue(ledPinHandle, RED_LED,!PIN_getOutputValue(RED_LED));
            RFQueue_nextEntry();
        }
    }
    
    PIN_Config pinTable[] =
    {
         RED_LED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
         GREEN_LED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
         PIN_TERMINATE
    };
    
    static uint8_t packet[10];
    
    void *mainThread(void *arg0)
    {
        RF_Params rfParams;
        RF_Params_init(&rfParams);
    
        if( RFQueue_defineQueue(&dataQueue,
                                   rxDataEntryBuffer,
                                   sizeof(rxDataEntryBuffer),
                                   NUM_DATA_ENTRIES,
                                   MAX_LENGTH + NUM_APPENDED_BYTES))
        {
            /* Failed to allocate space for all data entries */
            while(1);
        }
    
        /* Modify CMD_PROP_RX command for application needs */
        /* Set the Data Entity queue for received data */
        RF_cmdPropRx.pQueue = &dataQueue;
        /* Discard ignored packets from Rx queue */
        RF_cmdPropRx.rxConf.bAutoFlushIgnored = 1;
        /* Discard packets with CRC error from Rx queue */
        RF_cmdPropRx.rxConf.bAutoFlushCrcErr = 1;
        /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
        RF_cmdPropRx.maxPktLen = MAX_LENGTH;
        RF_cmdPropRx.pktConf.bRepeatOk = 1;
        RF_cmdPropRx.pktConf.bRepeatNok = 1;
    
        ledPinHandle = PIN_open(&ledPinState, pinTable);
        if (ledPinHandle == NULL)
        {
            while(1);
        }
    
        GPTimerCC26XX_Params params0A;
        GPTimerCC26XX_Params_init(&params0A);
        params0A.width          = GPT_CONFIG_16BIT;
        params0A.mode           = GPT_MODE_EDGE_TIME_UP;
        params0A.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
        hTimer0A = GPTimerCC26XX_open(CONFIG_GPTIMER_0, &params0A);
        if(hTimer0A == NULL)
        {
            while(1);
        }
    
        GPTimerCC26XX_registerInterrupt(hTimer0A, timerCallback0A, GPT_INT_CAPTURE);
    
        GPTimerCC26XX_setCaptureEdge(hTimer0A, GPTimerCC26XX_POS_EDGE);
        GPTimerCC26XX_setLoadValue(hTimer0A, 0xFFFFFF);
        GPTimerCC26XX_start(hTimer0A);
    
        EventRegister(EVENT_O_GPT0ACAPTSEL, EVENT_GPT0ACAPTSEL_EV_RFC_CPE_0);
    
        rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
        RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
    
        /* Enter RX mode and stay forever in RX */
        RF_EventMask terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx, RF_PriorityNormal, &callback, RF_EventRxEntryDone);
    
        while(1);
    }
    

    I see that I get a timerCallback0A every time I receive a packet. I have not been able to do something similar using RFC_HW_COMB, and I am not sure it would help you even if I managed to do so, as I do not think you would be able to keep track of which interrupt caused the capture, as it is a combined interrupt.

    I am sorry that I am not able to give you a solution for what you are asking.

    BR

    Siri