Skip to content

Commit

Permalink
Make sure SVCall uses highest exception priority
Browse files Browse the repository at this point in the history
  • Loading branch information
jefftenney committed Oct 11, 2023
1 parent eade81b commit 1498e04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion portable/GCC/ARM_CM4F/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
#define portNVIC_SHPR2_REG ( *( ( volatile uint32_t * ) 0xe000e01c ) )
#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
/* ...then bits in the registers. */
#define portNVIC_SYSTICK_CLK_BIT ( 1UL << 2UL )
Expand Down Expand Up @@ -409,9 +410,11 @@ BaseType_t xPortStartScheduler( void )
}
#endif /* configASSERT_DEFINED */

/* Make PendSV and SysTick the lowest priority interrupts. */
/* Make PendSV and SysTick the lowest priority interrupts, and make SVCall
* the highest priority. */
portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
portNVIC_SHPR2_REG = 0;

/* Start the timer that generates the tick ISR. Interrupts are disabled
* here already. */
Expand Down

0 comments on commit 1498e04

Please sign in to comment.