Keil Logo

ARM: KEIL RTX app ported to CMSIS RTOS does not run


Information in this knowledgebase article applies to:

  • KEIL RTX, CMSIS RTOS

SYMPTOM

I have ported a KEIL RTX based application for a Cortex-M target to use CMSIS RTOS. However, after that the application fails to run correctly and may also crash after some time.

CAUSE

One possible reason is the modification of the NVIC priority grouping during runtime. From the previous KEIL RTX you are probably aware, that such settings need to be done before the operating system is started e. g. in the main() function before the os_sys_init() call.

As the CMSIS RTOS is based on the KEIL RTX, it has the same requirements for changing the NVIC priority grouping configuration. But the big difference now is, that in the KEIL CMSIS RTOS, main() is already a thread and so the operating system started already when your program reaches main(). Modifying the NVIC priority grouping settings here, will now cause problems.

RESOLUTION

Put the code which configures the NVIC priority grouping in the part of the program, which runs before main(), e. g. in the SystemInit() function.

STATUS

In the CMSIS-RTOS version 4.75, which was released with the CMSIS pack 4.2.0, the Interrupt Priority Grouping can also be configured between calls to osKernelInitialize() and osKernelStart().

MORE INFORMATION

Last Reviewed: Friday, December 18, 2015


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.