FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2016 Threads]
I'm using an STM32F10 microcontroller with FreeRTOS V8.2.3 port for the Cortex M3. The microcontroller has four priority bits implemented. I understood that the highest priority of any interrupt using system calls is defined by configMAXSYSCALLINTERRUPTPRIORITY. FreeRTOS expects this priority to be stored in the upper nibble of configMAXSYSCALLINTERRUPTPRIORITY for this specific core.
configMAXSYSCALLINTERRUPTPRIORITY will be written to the BASEPRI register to enter a critical section and zero will be written to it when exiting the critical section (basically this disables the function of BASEPRI). This is the reason why configMAXSYSCALLINTERRUPTPRIORITY shall never be set to zero.
I saw in xPortStartScheduler in port.c that configMAXSYSCALLINTERRUPTPRIORITY is explicitly asserted to being non-zero:
configASSERT( configMAXSYSCALLINTERRUPTPRIORITY );
I just wanted to share that it might make sense to include the position of the priority bits of the particular core into this assertion. For the microcontroller I'm using in this case, I could set configMAXSYSCALLINTERRUPT_PRIORITY to 0x0F, not get the assertion to fail, but still break the critical section mechanism.
In this case the assert could look like:
configASSERT( configMAXSYSCALLINTERRUPTPRIORITY & CM3PRIORITY_MASK );
where CM3PRIORITYMASK is 0xF0.
Matthias
Thank you for the interesting input.
There is no real portable way of achieving this without adding in
additional dependencies on the FreeRTOSConfig.h values, as currently
only configMAXSYSCALLINTERRUPTPRIORITY and
configKERNELINTERRUPT_PRIORITY are mandated. However, the code does
manually check the number of priority bits implemented by testing the
hardware directly - so the assert could then be moved to that part of
the code (where the number of bits is known).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.