We had a big problem with interrupt priorities, they actually never worked. But we found reason and solution
there is asm code
Code: Select all
RDPGPR SP, SP
ADDIU SP, SP, -16
SW R30, 12(SP)
MFC0 R30, 12, 2
SW R30, 8(SP)
MFC0 R30, 14, 0
SW R30, 4(SP)
MFC0 R30, 12, 0
SW R30, 0(SP)
INS R30, R0, 1, 15
ORI R30, R0,5120 // bug; must be: ORI R30, R30,5120
MTC0 R30, 12, 0
that higher priority interrupt will call the handler. After finishing interrupt routine, asm enables interrupts.
We fixed it in asm and proved that priorities work after fix.
ORI R30, R0,5120 // bug; must be: ORI R30, R30,5120
Also, please consider changing help and example files where you sugested to use IRQ priority 7 is not the best idea.
We prefer irq priority 4 as base priority. It gives us a way to use higher or lower priorities than base priority.
Using Priority 7 as base priority gives you no easy way to add something that is higher. Only changing all the code
and facing lot's of code flow logic bugs that are hard to find. Etc you receive something from uart, decided to answer,
but uart tx code uses tx irq with higher priority, it not happens, and code enters deadlock. We had that situation actually