Keil Logo

ARM: project using RTX 5 library fails, but works with RTX 5 source

Information in this knowledgebase article applies to:

  • RTX 5.2.0 (from CMSIS pack 5.1.0)


I am using RTX 5 in my project as library and notice, that my application randomly crashes. When I switch in the RTE Runtime Manger to the RTX 5 source, then the application runs without this problem. What is the reason for this?


Problem is, that the library includes the code to configure the SysTick as the RTX timer source and also calls NVIC_SetPriority() as part of that. This function is used inline and also depends on a macro __NVIC_PRIO_BITS, which is taken from the chip specific header file.
Different devices have different number of priority bits implemented. The RTX library was build for the "ARMCM3" device, which defines __NVIC_PRIO_BITS = 3. Your device probably has more priority bits implemented. So incorrect priorities get configured. That is, the SysTick gets a higher priority than SVCALL, which must not happen. As a consequence, this causes random errors.
You can verify the problem during runtime by inspecting the Peripherals -> Core Peripherals -> Nested Vectored Interrupt Controller (NVIC) dialog.


For now, use the RTX 5 in source in your project.


This is fixed in RTX 5.2.1, which was released with CMSIS pack 5.1.1.


Last Reviewed: Wednesday, September 20, 2017

Did this article provide the answer you needed?
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.