2021-01-14 10:27 PM
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.
2021-01-18 02:00 PM
Hello,
Your analysis is correct.
This issue will be reported to the developement team.
Regards.
2021-01-18 10:14 PM
Thank you @Christophe Arnal ! I appreciate that.
2021-01-18 11:37 PM
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.