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.

AM3352: Interrupt priority threshold

Part Number: AM3352

Hi,

Is it possible to modify the PRIORITYTHRESHOLD inside an interrupt routine?

Currently we have an interrupt with PRIORITYTHRESHOLD set as "0x30"
and due to some requirment we need to increase the THRESHOLD to 0x08 inside the
interrupt service routine and return it back to 0x30 later.

Unfortunately we are not able to achieve this, we are getting lower priority
interrupts(like 0x10,0x20) even though the THRESHOLD is set to 0x08.

Below is the procedure we are trying to implement.

1> Enable priority masking threshold(PRIORITYTHRESHOLD) for an interrupt as 0x30
as mentioned in the TRM's "INTC Preemptive Processing Sequence".
2> Once the interrupt routine is called, modify the PRIORITYTHRESHOLD value to 0x08
so that interrupts lower or equal priority than 0x08 are masked.
3> Return back the PRIORITYTHRESHOLD value to the original one (0x30).

Please let me if this kind of usage is possible and if there is any
suggestion to implement this.

OS used: This is a non-OS bare metal application.

Best Regards
paddu

  • The factory team have been notified. They will respond here.
  • Review section 6.2.3 of the TRM. You might be hitting a write posting issue whereby the new lower priority interrupt is triggered before the PRIORITYTHRESHOLD is actually written. Ensure that the PRIORITHRESHOLD register is getting written before the NEWIRQAGR is written, and ensure a DSB is being used (or reread the value written to PRIORITYTHRESHOLD ) before reenabling the IRQ at ARM.

    Regards,
    James
  • Hi James,

    Thank you very much for the information.
    We were able to implement above mentioned procedure to avoid interrupts temporarily
    as per your suggestion.

    But,we would like to confirm if our procedure is correct or not.

    Could you please confirm if it is necessary to Read the active interrupt priority in the
    INTC_IRQ_PRIORITY IRQPRIORITY and write it to the PRIORITYTHRESHOLD(1) field mentioned in the procedure below?

    We believe Reading the active interrupt priority and Reading the active interrupt number
    mentioned in the procedure is not necessary if we are using PRIORITYTHRESHOLD just to avoid some
    interrupts temporarily.

    Following is the sequence we have used to set PRIORITYTHRESHOLD higher to avoid
    interruption temporarily.

    1. Disable IRQ at ARM side.
    2. Save the INTC_THRESHOLD PRIORITYTHRESHOLD field before modifying it.
    3. Write the PRIORITYTHRESHOLD(1) field to expected value.
    5. Write 1 to the INTC_CONTROL NEWIRQAGR bit while an interrupt is still
        processing to allow only higher priority interrupts to preempt.
    6. Use Data Synchronization Barrier is used to ensure that the IRQ line
        is de-asserted before IRQ.
    7. Enable IRQ at ARM side.

    Please let me know if this kind of usage is possible.

    Best Regards
    paddu

  • Paddu, i don't think reading the active int priority is necessary if you already know what you want to set the priority threshold to.
    You would read the active priority if you want to implement a typical interrupt priority scheme, which would be to set the threshold to to same value as the active interrupt.

    Regards,
    James