Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11379

TimerP_getTimeInUsecs() race condition issue

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • PDK
    • PDK-12893
    • NA
    • PROCESSOR_SDK_09.00.00
    • PROCESSOR_SDK_09.00.00
    • Hide
      j721e-evm
      j7200-evm
      j721s2-evm
      j784s4-evm
      Show
      j721e-evm j7200-evm j721s2-evm j784s4-evm

      Issue Description
      (1) Race conditions in uiPortgetRuntimeCounterValue and uxPortReadPmuCounter in R5 FreeRTOS port
      Issue in uxPortReadPmuCounter: ulPmuTsOverFlowCount may be increased multiple times, if it is handled from task and ISR context, during context switch.
      (2) Integer underflow due to incorrect handling of critical section. Tick timer interrupt may occur after pmuCounterRead in line, uxDeltaTs = pmuCounterRead - ullPortLastTickPmuTs;. The value of uxDeltaTs will be corrupted, as ullPortLastTickPmuTs will be greated than pmuCounterRead.

      Resolution
      (1) Added check in the uxPortReadPmuCounter API to make sure that the overflow is handled only from ISR context. PMU counter overflows in every 4.2 Seconds, and its sufficient to handle overflow in Tick ISR(i.e., in ISR context).
      (2) Made sure that the ullPortLastTickPmuTs is not larger than pmuCounterRead while calculating uxDeltaTs.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: