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.

dmaBTCAInterrupt

Other Parts Discussed in Thread: HALCOGEN

Hi

In the generated interrupt routine dmaBTCAInterrupt there is bug.

If the dmaBTCAInterrupt is generated for DMAchannel 0 the offset calculated for dmaGroupANotification.

    uint32 offset;

/* USER CODE BEGIN (6) */
/* USER CODE END */

    if (dmaREG->BTCAOFFSET != 0U)
    {
        offset = dmaREG->BTCAOFFSET - 1U;
        dmaGroupANotification(BTC, offset);
    }


Somehow dmaREG->BTCAOFFSET is resetted after the if condition and then the channel variable passed to dmaGroupNotificaton is wrapped off to 0xFFFFFFFF.

This can be solved by

    uint32 offset = dmaREG->BTCAOFFSET;

/* USER CODE BEGIN (6) */
/* USER CODE END */

    if (offset != 0U)
    {
        offset = offset - 1U;
        dmaGroupANotification(BTC, offset);
    }

Kind regards,

C.W.

  • Hello C.W,

      Your observation is correct. When reading the BTCAOFFSET and other offset registers such as FTCAOFFSET, the corresponding highest priority interrupt pending flag will be cleared. This is documented in the TRM. Will report the issue to our HalcoGen team.

    regards,

    Charles