Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

configMAX_PRIORITIES values

In the only example in SDK16.0.0 with soft_device and FreeRTOS, configMAX_PRIORITIES is set to 3, which means available  priorities 0,1 and 2.

Is it possible to change configMAX_PRIORITIES to value more than 3 and if so what else other than softdevice_task priority have to be changed accordingly?

Thanks

Parents
  • The configMAX_PRIORITIES are not the same as Interrupt priorities on the ARM Cortex M4 core. configMAX_PRIORITIES  are task priorities relevant only to the FreeRTOS and have nothing to do with the interrupt priority scheme on the CPU. You can ofcourse change it to any value upto 32, but remember that each priority addition will consume some RAM as housekeeping resource inside the FreeRTOS kernel. 

  • Thanks. Is there any information how much RAM will cost me each more priority level?

  • If you go to tasks.c inside the Kernel files, you can see the definition

    PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ];/*< Prioritised ready tasks. */
    This is where it consumes more static space for every extra priority.

    Looking at the definition of List_t

    /*
     * Definition of the type of queue used by the scheduler.
     */
    typedef struct xLIST
    {
    	listFIRST_LIST_INTEGRITY_CHECK_VALUE				/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
    	volatile UBaseType_t uxNumberOfItems;
    	ListItem_t * configLIST_VOLATILE pxIndex;			/*< Used to walk through the list.  Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
    	MiniListItem_t xListEnd;							/*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
    	listSECOND_LIST_INTEGRITY_CHECK_VALUE				/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
    } List_t;
    turns out, that the size of List_t on the GCC compiler is 149 bytes.

Reply
  • If you go to tasks.c inside the Kernel files, you can see the definition

    PRIVILEGED_DATA static List_t pxReadyTasksLists[ configMAX_PRIORITIES ];/*< Prioritised ready tasks. */
    This is where it consumes more static space for every extra priority.

    Looking at the definition of List_t

    /*
     * Definition of the type of queue used by the scheduler.
     */
    typedef struct xLIST
    {
    	listFIRST_LIST_INTEGRITY_CHECK_VALUE				/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
    	volatile UBaseType_t uxNumberOfItems;
    	ListItem_t * configLIST_VOLATILE pxIndex;			/*< Used to walk through the list.  Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
    	MiniListItem_t xListEnd;							/*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
    	listSECOND_LIST_INTEGRITY_CHECK_VALUE				/*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
    } List_t;
    turns out, that the size of List_t on the GCC compiler is 149 bytes.

Children
No Data
Related