ChibiOS 19.1.0, os-less bug osalSysLock Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
Shevchenko
Posts: 11
Joined: Tue Nov 13, 2018 9:25 am
Has thanked: 1 time
Been thanked: 3 times

ChibiOS 19.1.0, os-less bug osalSysLock

Post by Shevchenko »

Hi, osalSysLock does not work properly in ChibiOS 19.1.0. I tested on the stm32f429 processor.
static inline void osalSysLock (void) {

#if CORTEX_MODEL == 0
  __disable_irq ();
#else
  __set_BASEPRI (OSAL_IRQ_MAXIMUM_PRIORITY);
#endif
}


OSAL_IRQ_MAXIMUM_PRIORITY for CortexM! = 0 is defined as 1.
#if (CORTEX_MODEL == 0) || defined (__ DOXYGEN__)
#define OSAL_IRQ_MAXIMUM_PRIORITY 0
#else
#define OSAL_IRQ_MAXIMUM_PRIORITY 1
#endif


If we open the Programming manual from ST it can be seen that the first 4 bits reserved.
screen.png

After setting BASEPRI as 1, if the reader again registers then it gets its value as 0. It means that interrupts are not disabled. And after testing on stm32f429xi, interrupts are not disabled after calling the osalSysLock function. To solve this problem I have improved this function:

static inline void osalSysLock (void) {

#if CORTEX_MODEL == 0
  __disable_irq ();
#else
  __set_BASEPRI (OSAL_IRQ_MAXIMUM_PRIORITY << 4);
#endif
}
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ChibiOS 19.1.0, os-less bug osalSysLock

Post by Giovanni »

Hi,

Thanks for finding this.

Fixed as bug #1056.

Giovanni
Post Reply