CORTEX_BASEPRI_KERNEL (os/ports/GCC/ARMCMx/chcore_v7m.h line 158)
constant is set incorrectly using CORTEX_PRIORITY_MASK macro. This value is later used to set
CORTEX_PRIORITY_PENDSV (os/ports/GCC/ARMCMx/chcore_v7m.h line 172)
constant which is used to set PendSV interrupt priority in function
_port_init() (os/ports/GCC/ARMCMx/chcore_v7m.c line 120)
where it is used in CORTEX_PRIORITY_MASK macro again. Since this macro is used twice, priority is set beyond maximum range and effectively set to 0 (highest priority).
Looks like CORTEX_BASEPRI_KERNEL should be set directly to CORTEX_MAX_KERNEL_PRIORITY instead of CORTEX_PRIORITY_MASK(CORTEX_MAX_KERNEL_PRIORITY).
Fix should be backported to version 2.4
Log in to post a comment.