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.

TM4C1294NCPDT: SysTick Priority - TivaWare Macro

Part Number: TM4C1294NCPDT


Gents,

Configuring one particular interrupt priority with TivaWare is done by:

IntPrioritySet(INT_UART0, PRIORITYLEVEL);   // Example for UART_0 priority level

What is the equivalent macro for the SysTick priority? I could not find anything in hw_ints.h, nor in other forum posts...

Regards

Bruno

  • Believe firm/I came across that fairly recently - not here - but w/in our "4C123 MCU Manual." From memory (thus unconfirmed) this was a preset value - and rather high placed (fastest responding) as I recall.     *** Note the "saving" effect of "From memory" which proved, "Not so much" on this particular (early) Sunday morn...   (i.e. default priority of SysTick "appears" to be of lowered priority...)

    Now your MCU is different - if you can check as described - and NOT find/answer - I'll search our notes & advise... Bon chance, mon ami.

    [edit]  My response was so lame & inept - could not leave it stand - unaided.

    For "4C123" there is Register "STCTRL" - and it enables 4 Control Mechanisms - yet NONE govern, "Interrupt Priority!"      Those 4 mechanisms include:

    • SysTick Count
    • SysTick Clock Source
    • SysTick Interrupt Generation (yes/no)
    • SysTick Enable

    Alas - no provision for Interrupt Priority - at least not here - w/this MCU.

    [edit 2]... *** FEEB ALERT!     I NOW find that the MCU DOES suggest SystTick Is Programmable!      (thus my court pleading slides to (just) Temporary Insanity.)

    My vector to Pg. 170 was NOT particularly satisfying - so pressed on - and then (drumbeat maestro!)       Do note - the following was NOT found upon Pg. 170!    (but upon Pg. 172  4C123 man!)

    I believe (now) that your question has been fully/properly addressed & answered...     At least the procedure for investigating & discovery has been well revealed - which is (often) of greater value than any single "answer."      (Methods trump individual, one-time "answers!"    Indeed that's how small firm Goes PUBLIC!)

    Should documentation from this vendor prove sparse - your visit to "ARM site" is likely to prove fruitful...

  • TIVAWare doe have a function for this

    Use IntPrioritySet.

    Robert
  • Bruno Saraiva said:

    IntPrioritySet(INT_UART0, PRIORITYLEVEL);   // Example for UART_0 priority level

    What is the equivalent macro for the SysTick priority? I could not find anything in hw_ints.h, nor in other forum posts...

    From hw_ints.h

    //*****************************************************************************
    //
    // The following are defines for the fault assignments.
    //
    //*****************************************************************************
    #define FAULT_NMI               2           // NMI fault
    #define FAULT_HARD              3           // Hard fault
    #define FAULT_MPU               4           // MPU fault
    #define FAULT_BUS               5           // Bus fault
    #define FAULT_USAGE             6           // Usage fault
    #define FAULT_SVCALL            11          // SVCall
    #define FAULT_DEBUG             12          // Debug monitor
    #define FAULT_PENDSV            14          // PendSV
    #define FAULT_SYSTICK           15          // System Tick

    Notice the last line.

    Robert

  • Robert, thanks!
    Considering all the enlightening comments to this thread, I guess there was "something wrong" with my question: SysTick is not really an "interrupt level" event, but rather something higher up on the food chain, a "fault level" event! That I was not aware of.
    Hence no matter what we configure for "other peripheral interrupts" (i.e. setting a UART Tx interrupt as high as possible, to the value ZERO), Systick will by default always have priority.
    There is no purpose on trying to give SysTick more importance than it already was born with, and I probably don't need to run IntPrioritySet(FAULT_SYSTICK, 1)!!!
    Bruno
  • Thanks! This time I did not want to learn how to fish, I really just wanted my tuna! :)
    Still, there was some good learning out of your investigation, added to Robert's plain (and assertive) answer!
    Bruno
  • Bruno Saraiva said:
    Considering all the enlightening comments to this thread, I guess there was "something wrong" with my question: SysTick is not really an "interrupt level" event, but rather something higher up on the food chain, a "fault level" event! That I was not aware of.

    Nothing wrong with the question. The only real difference between an interrupt and a fault on a Cortex is the name, at least as far as I've been able to determine so far. And there are lots of reasons for changing SysTick priority. For instance if you have other interrupts with a higher frequency than SysTick then they should have a higher priority.

    It's quite possible to have a system with SysTick being the lowest priority interrupt.

    Robert

  • True enough. Actually what I really wanted (and briefly forgot), was to LOWER the priority.

  • Thinking further - and w/the recall that this topic (long... > 3-5 years past) "arrived here" - I believe that the define as, "FAULT SYSTICK" was judged as a "charting convenience."

    I past argued that the occurrence of a SysTick Interrupt would often occur without any "Fault" - thus the "fault" label was gratuitous...   (chart consistency trumped appropriateness!)

    We note that poster Bruno listed that exact function call - yet not the "obscure, crudely defined parameter" - w/in his opening post...

  • cb1_mobile said:
    We note that poster Bruno listed that exact function call - yet not the "obscure, crudely defined parameter"

    I appreciate your hawk eyes!

  • cb1_mobile said:
    I past argued that the occurrence of a SysTick Interrupt would often occur without any "Fault" - thus the "fault" label was gratuitous...  

    Hopefully it would never be associated with an actual fault.

    I think ARM's choice of terminology here is unhelpful. Perhaps they needed something to distinguish the fixed interrupts from those modifiable by the client but a clearer choice would have been helpful.

    Robert

  • Robert Adsett said:
    I think ARM's choice of terminology here is unhelpful.

    So true that!     Again - the "belief" is that "charting convenience" trumped a more "helpful" word choice...

    Indeed casting SysTick as a "fault" was in itself - faulty!

  • I wouldn't limit the accusation of misappellation to systick. Of the nine interrupts in that list I quoted at least 5 are badly characterised as faults

    Robert