The NVIC supports software-assigned priority levels. You can assign a priority level from 0 to 3 to an interrupt by writing to the two-bit IP_N field in an Interrupt Priority Register, see Interrupt Priority Registers. Priority level 0 is the highest priority level and priority level 3 is the lowest. For example, if you assign priority level 1 to IRQ and priority level 0 to IRQ, then IRQ has priority over IRQ.
Software prioritization does not affect reset, Non-Maskable Interrupt (NMI), and Hard Fault. They always have higher priority than the external interrupts.
When multiple exceptions have the same priority number, the pending exception with the lowest exception number takes precedence. For example, if both IRQ and IRQ are priority level 1, then IRQ has precedence over IRQ.
An exception is pre-empted if the handler receives an exception that has a higher priority. If the handler receives an interrupt of the same priority the exception is not pre-empted, irrespective of the interrupt number.
For more information on the IP_N fields, see Interrupt Priority Registers.