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: TI-RTOS Interrupt Priority setup.

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hi there,

  I'm using TI-RTOS  2.16.0.08 + XDCtools 3.32.2.25_core with CCS9.1/9.2 to do development on the lauchpad EK-TM4C1294XL.

  I'm having issue with the setting priority of 3 Hardware Interrupts.  The following is the section where I dynamically setting up the HWI interrupts

I attempt to set interrupt number for event1  and event3 to 2 and  interrupt number for event2 to 3 but got aborted during run time. 

If I have the priority number to -1 for all of the 3 interrupts, then things work fine but not to what I intented for my aplicaction.

Hwi_Params hwiEvent1Params;
Hwi_Params_init(&hwiEvent1Params);
hwiEvent1Params.arg = 0;
hwiEvent1Params.priority = 2; //priority 2.
hwi_event1 = Hwi_create(21, (Hwi_FuncPtr)Event1_ISR, &hwiEvent1Params,NULL); //use number in the vector number column from datasheet

Hwi_Params hwiEvent2Params;

Hwi_Params_init(&hwiEvent2Params);

hwiEvent2Params.arg = 0;
hwiEvent2Params.priority = 3; //priority: higher than Event1 and Event3. .
hwi_event2 = Hwi_create(68, (Hwi_FuncPtr)Event2_ISR, &hwiEvent2Params,NULL); //K3

Hwi_Params hwiEvent3Params;
Hwi_Params_init(&hwiEvent3Params);
hwiEvent3Params.arg = 0;
hwiEvent3Params.priority = 2; //priority setting: lower than Event2. .
hwi_event3 = Hwi_create(95, (Hwi_FuncPtr)Event3_ISR, &hwiEvent3Params,NULL);

I also tried to setup the interrupts using the GUI, but got the same issue: that is I can't set to a different priority number other than -1.

Please tell me what I could have done wrong here.

Thanks in advance.

-CD

  • Hi CD,

      Not sure why it is giving an abort by assigning different priorities. First of all, 0 will have higher priority than 1. If you want event2 to have higher priority than event1 and event3 then you need to assign a lower value for event2 instead of a higher value. -1 means lowest priority. This below link talks about Hwi priority which will provide additional information.

    https://processors.wiki.ti.com/index.php/SYS/BIOS_for_Stellaris_Devices#SYS.2FBIOS_M4_Hardware_Interrupt_.28Hwi.29_Handling

  • Charles,

     Thanks for you quick response and the document. I'm going to spend more time reading.

     I just noticed that if the priority numbers are set to -1, the ROV shows that the interrupts are Dispatched interrupts and priority =224, group =7 ans subPriority= 0.

     When the priority numbers are set to other numbers other than -1, even if they are the same, the interrupts are Zero Latency interrupts and piority = 0, group - 7 and subPriority = 0.

     Initial reading shows that Zero Latency interrupts should not call Semiphore_post, I think that's why it gives runtime abort. I will need to figure out what are the different between the 2 types of interrupts Zero Latency verse Dispatched and how to deal with group and subpriority.

     If you have any suggestions to get out of this, please let me know.

    Thanks,

    -CD

  • Hi,

      In the link that I referenced it has this line of note:

    Due to a hardware design subtlety, the 3 bits of priority required to define the 8 priority values occupy bits [7:5] of the 8 bit priority value rather than bits [2:0] as one might expect. Consequently, the values of the 8 supported priorities are not 0x00 thru 0x07 but 0x00, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, and 0xe0, where 0x00 is the HIGHEST priority and 0xe0 the LOWEST priority.

    Let's say if you want to assign higher priority to event 2 than event 1 and event 3. You could assign priority 0 to event 2 and priority 1 to event 1 and event 3. To set priority 1, you should use 0x20, not 0x1 since it is the upper three bits will determine the priority value. Try 0x0 for event 2 and 0x20 for event 1 and event 3 and see if that makes a difference. 

     

  • Thanks Charles, It works now.