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.

LAUNCHXL-F280049C: TRM SCIFFRX register INT bits 6-7

Guru 56418 points

Part Number: LAUNCHXL-F280049C

Tool/software:

Hello Group,

It would seem there is a misprint in the TRM SCIFFRX register description field, to clear a read only bit 7 when bit 6 is R/W? Bit zero is real in base 10 and not considered bit 1, a typo?

The defines used to R/W the SCIFFRX interrupt status and clear seems incorrect, not reading clearing correct bits in FIFFO level interrups mode. Oddly suspicious SCI_RXST_BRKDT in SCI_O_RXST register returns status being used in FIFO level mode to only drive the RXISR via interruptStatus |= SCI_INT_RXRDY.

Thought the debug GEL register names the bit field (RXWAKE) the flag bit is not at all a PIE/CPU interrupt status flag? Perhaps in blocking mode some of the C2KWare status and clear calls work correctly to clear blocking flags via the read buffer. Also, for FIFO level mode interrupts TRM states to place RX buffer overflow error detection routine inside the ISR and enable BRKDT interrupt for early error detection. Yet the receiver flags OE, PE, FE status flags were cleared after entry to the SCIRXFFE ISR by calling SCI_clearInterruptStatus(). 

Seemingly C2Kware needs to separate TX/RX buffer read mode ISR's and SCIFIFRX/TX interrupt status and interrupt clear functions FIFO level mode. C2KWare driver library forces both ISR modes into one function respectively and forces RX error SW reset when that is to be put inside the RXISR. Result of library mayhem; SCIFFRX interrupt not being cleared there are random OE errors, the wrong bits defines (sci.h) for SCIFFRX register shown below.

SCI_clearInterruptStatus():

if((HWREGH(base + SCI_O_FFRX) & SCI_FFRX_RXFFINT) == SCI_FFRX_RXFFINT)
{
    interruptStatus |= SCI_INT_RXFF;  // 0x10U ??
}

SCI_getInterupt Status()

if((HWREGH(base + SCI_O_FFRX) & SCI_FFRX_RXFFINT) == SCI_FFRX_RXFFINT)
{
    interruptStatus |= SCI_INT_RXFF;  // 0x40U ??
}
 

   

  • Hello,

    Apologies for the delay in response, I was unexpectedly out of office.

    I want to quickly note that the image you've posted is from an out-of-date version of the device TRM (version -d). Ideally, refer to the most up-to-date documentation (currently version -h)

    Moving on to your concerns, first, if the 'Type' column refers to a bit as read-only or write-only and the 'Description' column describes R/W behavior, it is still a read-only or write-only bit. The Description column is usually just explaining the behavior if you try and use the incorrect action.

    Second, I'm not certain what you mean when you're referring to a typo related to bits 6 and 7. Bit 7 [RXFFINT] is a read-only flag, while bit 6 [RXFFINTCLR] is a write-only clear bit, which clears RXFFINT.

    For SCI_clearInterruptStatus(), the excerpt you've posted does not match the behavior defined in Driverlib, which appears correct. I'm afraid I don't understand what you're trying to convey?

    Regards,
    Jason Osborn

  • Hi Jason,

    Second, I'm not certain what you mean when you're referring to a typo related to bits 6 and 7. Bit 7 [RXFFINT] is a read-only flag, while bit 6 [RXFFINTCLR] is a write-only clear bit, which clears RXFFINT.

    Right must have been older version about bit 6 and 7 note wording (in bit 7). And debug GEL file layout is not same bit locations as depicted in TRM. GEL decode omits reserve bits in decoding the XDS110 emulator returns to the debug simulator. Keep forgetting that at times when deep in the yuck.  

    For SCI_clearInterruptStatus(), the excerpt you've posted does not match the behavior defined in Driverlib, which appears correct. I'm afraid I don't understand what you're trying to convey?

    Oddly the driver lib calls cannot clear the RXFIFO overflow condition, not the OE flag. The trouble is those calls cannot clear the FIFO overflow bit first then the interrupt flag to release the FIFO data into the application read buffer without stalling RXISR and locking the RXFIFO. We can only clear the condition manually in debug registers, only in the order just mentioned does the RXFIFO respond to flag bit changes. The application cannot clear the overflow FIFO flag or interrupt even in the TXFIFO calls that continue to function. Have been fighting this overflow issue for very long time not fully understanding what was going wrong.

    The interrupt flags mentioned above are not the same hex address as one might expect to see during mouse hover over interrupt enable disable code while in debug pause and switching to editor view. Tracing back source interrupt hex address is not so easy to track along with TRM registers view. The way driver lib was written to call an interrupt clear function, the actual PIE flag address is not exposed to CCS editor making troubleshooting very difficult to follow in the TRM registers via offset addresses and target bits to R/W. 

    Why cannot the code snip below clear the RXFIFO overflow condition that manual bit toggle in debug run can easily do like below snip?    

      

  • Hi Jason,

    The identified issue SCIB RXFIFO level check does not return level status once the RXFFINT flag has been set high. That level check always occurs after the RXISR function calls handler incoming data. The code snip below (FIFO level status) when placed in the RX data handler debug halts inside level check snip always with RXFIFO overflow flag set and the RXFFINT flag being set, No RX error flags being set, e.g. OE, FE, PE.

    To make things more complicated ADCC has highest group interrupt priority (1.3) granted inside SCIB TX/RX FIFO ISR handlers. That was in MCSDK 21µs ISR thus suspect UMCSDK is roughly the same ISR timing.

    And SCIB TXFIFO keeps interrupting even as RXFIFO overflowed last RXFFINT flag pend to ePIE. Suspect FIFO level check (HWREG) even when locally placed inside the RX handler (code snip) without stacking (push/pop address) is using a volatile CPU instruction decode. So it often freezes PIE SCIB RXFFINT interrupt to the CPU. Being the RXFIFO RXFFINT flag is perpetually locked high state, requires debug CPU reset to clear locked ePIE flag. 

    /* Timeout MAX count for getting RXD FIFO bytes */
    for(Timeout = 0; Timeout < timeout; Timeout++)
    {
    	/* Load RX data elements */
    	for(i = 0; i <= 31; i++)//<= 15-31
    	{
    		/* Blocking checks FIFO space filled 0-15=16 words */
    		//while(SCI_getRxFIFOStatus(SCIB_BASE) == SCI_FIFO_RX16)
    
            /* Check RXFIFO OVF flag */
            if(i >= 32)
            {
                /* Check SCIFFRX register FIFO has overflowed */
                if(SCI_getOverflowStatus(SCIB_BASE) == SCI_FFRX_RXFFOVF)
                {
                   if(((HWREGH(SCIB_BASE + SCI_O_FFRX) &= SCI_FFRX_RXFFOVF) &&
                           (HWREGH(SCIB_BASE + SCI_O_FFRX) &= SCI_FFRX_RXFFINT)))
                   {
                       /* Clear Rx overflow status */
                       while(HWREGH(SCIB_BASE + SCI_O_FFRX) &= SCI_FFRX_RXFFOVF)
                       {
                           /* clear SCIFFRX RXFFOVF SCIB */
                           HWREGH(SCIB_BASE + SCI_O_FFRX) |= SCI_FFRX_RXFFOVRCLR;
                       }
                       while(HWREGH(SCIB_BASE + SCI_O_FFRX) &= SCI_FFRX_RXFFINTCLR)
                       {
                           /* clear SCIFFRX RXFINT SCIB */
                           HWREGH(SCIB_BASE + SCI_O_FFRX) |= SCI_FFRX_RXFFINTCLR;
                       }
                    }
                 }
    
                /* Stop OVF FIFO loading */
                return(0);
            }
    
            CcRxBuff[i] = (HWREG(SCIB_BASE + SCI_O_RXBUF) & SCI_RXBUF_SAR_M); 
            
                    /* If the RX FIFO FULL status wait until it empties */
             while(((HWREG(SCIB_BASE + SCI_O_FFRX) &SCI_FFRX_RXFFST_M) >>
                                      SCI_FFRX_RXFFST_S) >= SCI_FIFO_RX8{}
            
            }
            
        }
    }    

      

  • Long story short if RXFFOVF & RXFFINT flags cannot be cleared in the ISR handlers or the application. More likely the TXFFINT ISR or called function is causing the fault condition in RXFFOVF. Strategic placement of TXFIFO level check after data input via (for / while) loops can arrest the RXFFOVF random flag set.

    Oddly doing FIFO blocking level test before data output caused random RXFFOVF flag set. High speed circular data handling between RX/TX FIFO interrupt level requires specific application handling to avoid RXFFOVF. Since the RXERROR flag is not being set for the RXFFOVF RXFFINT flag sets that occur After the RX/TX-FFINT clear ACK. Not sure placing clear ACK near the top of either ISR would stop the issue since ADCC ISR granted priority both TX/RX FIFO interrupts. 

    Seemingly issue describes a race condition and modification of silicon could help to stop random RXFFOVF flag conditions.