cancel
Showing results for 
Search instead for 
Did you mean: 

Setting TIMER_TASK_PRIORITY with help of a macro

Rajeev Arora
Senior

Hello @Khouloud ZEMMELI​ ,

I have request with regards to TIMER_TASK_PRIORITY setting available under FreeRTOS -> Configuration Peripherals (with CMCIS V2 in use, which will set / Enable USE_TIMERS).

I believe it is not a good practice to use a constant value for TIMER_TASK_PRIORITY. Below are my reasons for it.

  1. If user adds a new task with priority higher than the (FreeRTOS) TIMER TASK, the performance of the firmware will be impacted.
  2. In case a timer task is used by FreeRTOS it must have the highest priority compared to all other tasks priority. I believe such a check is possibly missing in the STM32CubeMX generated code.
  3. A user who is not aware of the use of the TIMER_TASK_PRIORITY setting might leave it at its default value (of 2). Thus the resulting firmware will have performance issues.

What is currently working:

I had earlier requested for setting of some UART and CAN configurations with help of macros. This was provided (possibly) with STM32CubeMX version 6.0.0. I do get a warning (when generating the code) that the UART and CAN peripherals having some warnings that must be fixed, however I continue with code generation. I have a custom Header file that I include to all C files that use the macros. The custom header file defines the macros that were made known to the STM32CubeMX.

Request:

Please help with following:

  1. Either set the value to 54 (as value 55 is reserved for interrupts)
  2. STM32CubeMX generates an additional code which checks value of configTIMER_TASK_PRIORITY with Prio argument being passed to functions for Creating Task (like xTaskCreateStatic() ). and ASSERTS if the configTIMER_TASK_PRIORITY value is less than the value passed to Prio argument.
  3. Allow STM32CubeMX tool user to use an Alphanumeric value instead of a numeric value. The alphanumeric value i.e. macro can then be declared in the user code section or user included header file.

Please refer to the attached screenshots and share your views.

Thanks,

Rajeev

1 REPLY 1
Pavel A.
Evangelist III

+1 for #3 (Allow to use a User Constant in numeric fields)