Skip to main content
burn_
Associate III
January 15, 2021
Question

STM32WB scheduler and CubeMX: adding different priority levels for tasks using CubeMx

  • January 15, 2021
  • 3 replies
  • 1170 views

Good day,

I'm using the scheduler to be able to run tasks on the STM32WB. It all works fine, but I would like to be able to add different priority levels to tasks, since the timing of some tasks are more critical than others.

I edited app_conf.h as follows (default only had CFG_SCH_PRIO_0 and CFG_PRIO_NBR):

/**
 * This is the list of priority required by the application
 * Each Id shall be in the range 0..31
 */
typedef enum
{
 CFG_SCH_PRIO_0,
 CFG_SCH_PRIO_1,
 CFG_SCH_PRIO_2,
 CFG_PRIO_NBR,
} CFG_SCH_Prio_Id_t;

I also edited utilities_conf.h as follows (was 2, now 4):

#define UTIL_SEQ_CONF_PRIO_NBR (4)

I'm happy to report that this works! However, I need to keep on changing these two files every time I regenerate code with CubeMx (I'm using it from within STM32CubeIDE). Is this perhaps something that could be added to a next revision of the STM32WB software package? Perhaps under the scheduler, the number of priority levels can be chosen.

This topic has been closed for replies.

3 replies

ST Employee
January 18, 2021

​Hello,

Your analysis is correct.

This issue will be reported to the developement team.

Regards.

Piranha
Principal III
January 19, 2021

Also the UTIL_SEQ_CONF_PRIO_NBR macro is redundant and unnecessary. It can be replaced by the CFG_PRIO_NBR constant, which will change it's value automatically.

burn_
burn_Author
Associate III
January 19, 2021

Thank you @Christophe Arnal​ ! I appreciate that.