#443 Wrong CORTEX_PRIORITY_PENDSV value

closed-fixed
None
2014-05-09
2013-11-22
Witold
No

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

Discussion

  • Witold

    Witold - 2013-11-22

    Correction: CORTEX_BASEPRI_KERNEL is set correctly but CORTEX_PRIORITY_PENDSV shouldn't be based on it but should use CORTEX_MAX_KERNEL_PRIORITY instead.

     
  • Giovanni Di Sirio

    • summary: Wrong CORTEX_PRIORITY_PENDSV and CORTEX_BASEPRI_KERNEL values --> Wrong CORTEX_PRIORITY_PENDSV value
    • status: open --> open-fixed
     
  • Giovanni Di Sirio

    Hi,

    Thanks for finding, fixed in repository, will be fixed in versions 2.4.6stable, 2.6.2stable, 2.7.0unstable.

     
  • Giovanni Di Sirio

    • assigned_to: Giovanni Di Sirio
     
  • Giovanni Di Sirio

    • Group: trunk --> 2.6.2
    • Priority: 5 --> 6
     
  • Giovanni Di Sirio

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks