Other Parts Discussed in Thread: LM3S8971
It would seem ARM Cortex M4v7 programmers guide priority bit fields are missing from how TI has implemented TM4C1294 NVIC Priority/Sub priority groups.
Specifically the sub priority fields (0-7) for each group priority (0-7) in a 3 bit split configured REG58 (APINT) are missing from datasheet. ARM Cortex M4v7 NVIC supports up to 256 priority levels for each interrupt. The sub priority bit fields (nibble) for each primary grouping (0-7) interrupt source that ARM programmers guide shows are missing in TI datasheet. Datasheet Table 3-9 row 1 (0x0-0x4) is incorrect to suggest only 1 sub priority can exist in 3 bit split as that would violate ARM Cortex M4v7 (proven) NVIC architecture.
For clarity of issue I added grouping bit split (Notes) M4v7 NVIC is capable to decode next to the Tivaware (hw_nvic.h) NVIC_APINT defines. It would seem the interrupt sub priority interrupt fields 3 bit split for 0x00000200 [2:0] Tivaware does not set sub priority levels, 8 interrupt priority level bits (0x0-0x7), e.g. priority groupings 0x00-0xE0. ARM M4v7 Core NVIC supports primary priority groupings and levels of interrupt priority within this case 0-7 groupings 0x0-0xE0. That is not being configured by IntPrioritySet() which only sets the Sub priority interrupt bit field to act only as a primary grouping and that will never work properly in M4v7 NVIC schema. It seems someone at TI has mistaken how NVIC works as ARM Cortex documents suggest it should.
We need 8 priority groups 0x0-0xE0 (5:3 split) with minimum 8 sub priory levels (0-7) within each grouping. It seems Tivaware IntPrioritySet() limits NVIC to 1 group with 8 sub priorities in conflict with table 3-9. It seems we can't make the call but one time to IntPriorityGroupingSet(2 or 4) again each one restricts us to only one group, not 8 separate groups as table 3-9 indicates.
Accordingly what seems to occur as a result of asserting higher priority interrupt groupings they incorrectly speed up lower priority tail chaining relative to the higher priority asserts with that group.
//***************************************************************************** // // The following are defines for the bit fields in the NVIC_APINT register. // //***************************************************************************** #define NVIC_APINT_VECTKEY_M 0xFFFF0000 // Register Key #define NVIC_APINT_VECTKEY 0x05FA0000 // Vector key #define NVIC_APINT_ENDIANESS 0x00008000 // Data Endianess #define NVIC_APINT_PRIGROUP_M 0x00000700 // INT Priority Grouping Pri[Bits] SubPri[Bits] #define NVIC_APINT_PRIGROUP_7_1 0x00000000 // Priority group 7.1 split, ARM [7:1] [0] #define NVIC_APINT_PRIGROUP_6_2 0x00000100 // Priority group 6.2 split, ARM [7:2] [1:0] #define NVIC_APINT_PRIGROUP_5_3 0x00000200 // Priority group 5.3 split, ARM [7:3] [2:0] #define NVIC_APINT_PRIGROUP_4_4 0x00000300 // Priority group 4.4 split, ARM [7:4] [3:0] #define NVIC_APINT_PRIGROUP_3_5 0x00000400 // Priority group 3.5 split, ARM [7:5] [4:0] #define NVIC_APINT_PRIGROUP_2_6 0x00000500 // Priority group 2.6 split, ARM [7:6] [5:0] #define NVIC_APINT_PRIGROUP_1_7 0x00000600 // Priority group 1.7 split, ARM [7] [6:0] #define NVIC_APINT_PRIGROUP_0_8 0x00000700 // Priority group 0.8 split, ARM [0] [7:0] #define NVIC_APINT_SYSRESETREQ 0x00000004 // System Reset Request #define NVIC_APINT_VECT_CLR_ACT 0x00000002 // Clear Active NMI / Fault #define NVIC_APINT_VECT_RESET 0x00000001 // System Reset